Lines Matching +full:second +full:- +full:sourcing
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * i2c.h - definitions for the Linux i2c bus interface
4 * Copyright (C) 1995-2000 Simon G. Vogl
5 * Copyright (C) 2013-2019 Wolfram Sang <wsa@kernel.org>
28 /* --- General options ------------------------------------------------ */
65 * i2c_master_recv - issue a single I2C message in master receive mode
79 * i2c_master_recv_dmasafe - issue a single I2C message in master receive mode
95 * i2c_master_send - issue a single I2C message in master transmit mode
109 * i2c_master_send_dmasafe - issue a single I2C message in master transmit mode
189 * struct i2c_device_identity - i2c client device identification
190 * @manufacturer_id: 0 - 4095, database maintained by NXP
191 * @part_id: 0 - 511, according to manufacturer
192 * @die_revision: 0 - 7, according to manufacturer
221 * struct i2c_driver - represent an I2C device driver
223 * @probe: Callback for device binding - soon to be deprecated
228 * @command: Callback for bus-wide signaling (optional)
233 * @clients: List of detected clients we created (for i2c-core use only)
263 * current probe()'s, more commonly unused than used second parameter.
275 * 16-bit payload data reported by the slave device acting as master.
296 * struct i2c_client - represent an I2C slave device
300 * generic enough to hide second-sourcing and compatible revisions.
305 * @detected: member of an i2c_driver.clients list or i2c-core's
325 unsigned short addr; /* chip address - NOTE: 7bit */
353 return dev_get_drvdata(&client->dev); in i2c_get_clientdata()
358 dev_set_drvdata(&client->dev, data); in i2c_set_clientdata()
379 return client->slave_cb(client, event, val); in i2c_slave_event()
386 * struct i2c_board_info - template for device creation
390 * @dev_name: Overrides the default <busnr>-<addr> dev_name if set
407 * bus numbers identify adapters that aren't yet available. For add-on boards,
425 * I2C_BOARD_INFO - macro used to list an i2c device and its address
431 * fields (such as associated irq, or device-specific platform_data)
440 * Add-on boards should register/unregister their devices; e.g. a board
478 * Modules for add-on boards must use other calls.
494 * struct i2c_algorithm - represent I2C transfer method
512 * be addressed using the same bus algorithms - i.e. bit-banging or the PCF8584
517 * Kernel Documentation file Documentation/i2c/fault-codes.rst.
521 * If an adapter algorithm can't do I2C-level access, set master_xfer
550 * struct i2c_lock_operations - represent I2C locking operations
564 * struct i2c_timings - I2C timing information
588 * struct i2c_bus_recovery_info - I2C bus recovery information
644 * struct i2c_adapter_quirks - describe flaws of an i2c adapter
650 * @max_comb_2nd_msg_len: maximum length of the second msg in a combined message
653 * per transfer, plus something called combined message or write-then-read.
659 * write-then-anything or other variants. To support that, write-then-read has
660 * been broken out into smaller bits like write-first and read-second which can
677 /* second combined message must be read */
681 /* convenience macro for typical write-then read case */
731 return dev_get_drvdata(&adap->dev); in i2c_get_adapdata()
736 dev_set_drvdata(&adap->dev, data); in i2c_set_adapdata()
743 struct device *parent = adapter->dev.parent; in i2c_parent_is_i2c_adapter()
745 if (parent != NULL && parent->type == &i2c_adapter_type) in i2c_parent_is_i2c_adapter()
759 * i2c_lock_bus - Get exclusive access to an I2C bus segment
767 adapter->lock_ops->lock_bus(adapter, flags); in i2c_lock_bus()
771 * i2c_trylock_bus - Try to get exclusive access to an I2C bus segment
781 return adapter->lock_ops->trylock_bus(adapter, flags); in i2c_trylock_bus()
785 * i2c_unlock_bus - Release exclusive access to an I2C bus segment
793 adapter->lock_ops->unlock_bus(adapter, flags); in i2c_unlock_bus()
797 * i2c_mark_adapter_suspended - Report suspended state of the adapter to the core
809 set_bit(I2C_ALF_IS_SUSPENDED, &adap->locked_flags); in i2c_mark_adapter_suspended()
814 * i2c_mark_adapter_resumed - Report resumed state of the adapter to the core
824 clear_bit(I2C_ALF_IS_SUSPENDED, &adap->locked_flags); in i2c_mark_adapter_resumed()
838 /* Construct an I2C_CLIENT_END-terminated array of i2c addresses */
843 /* ----- functions exported by i2c.o */
861 return !IS_ERR_OR_NULL(client) && client->dev.driver; in i2c_client_has_driver()
864 /* call the i2c_client->command() of all attached clients with
878 return adap->algo->functionality(adap); in i2c_get_functionality()
888 * i2c_check_quirks() - Function for checking the quirk flags in an i2c adapter
896 if (!adap->quirks) in i2c_check_quirks()
898 return (adap->quirks->flags & quirks) == quirks; in i2c_check_quirks()
904 return adap->nr; in i2c_adapter_id()
909 return (msg->addr << 1) | (msg->flags & I2C_M_RD ? 1 : 0); in i2c_8bit_addr_from_msg()
917 * module_i2c_driver() - Helper macro for registering a modular I2C driver
929 * builtin_i2c_driver() - Helper macro for registering a builtin I2C driver
986 return -ENOTSUPP; in of_i2c_get_board_info()
1014 return ERR_PTR(-ENODEV); in i2c_acpi_new_device()