23 #include <linux/kernel.h>
24 #include <linux/module.h>
27 #include <linux/errno.h>
28 #include <linux/sched.h>
29 #include <linux/i2c.h>
41 ret = (*algo_data->
aux_ch)(adapter, mode,
42 write_byte, read_byte);
68 ret = i2c_algo_dp_aux_transaction(adapter, mode, 0,
NULL);
77 i2c_algo_dp_aux_stop(
struct i2c_adapter *adapter,
bool reading)
87 (
void) i2c_algo_dp_aux_transaction(adapter, mode, 0,
NULL);
114 i2c_algo_dp_aux_get_byte(
struct i2c_adapter *adapter,
u8 *byte_ret)
122 ret = i2c_algo_dp_aux_transaction(adapter,
MODE_I2C_READ, 0, byte_ret);
132 bool reading =
false;
136 for (m = 0; m < num; m++) {
140 ret = i2c_algo_dp_aux_address(adapter, msgs[m].
addr, reading);
144 for (b = 0; b < len; b++) {
145 ret = i2c_algo_dp_aux_get_byte(adapter, &buf[b]);
150 for (b = 0; b < len; b++) {
151 ret = i2c_algo_dp_aux_put_byte(adapter, buf[b]);
161 i2c_algo_dp_aux_stop(adapter, reading);
162 DRM_DEBUG_KMS(
"dp_aux_xfer return %d\n", ret);
167 i2c_algo_dp_aux_functionality(
struct i2c_adapter *adapter)
176 .master_xfer = i2c_algo_dp_aux_xfer,
177 .functionality = i2c_algo_dp_aux_functionality,
183 (
void) i2c_algo_dp_aux_address(adapter, 0,
false);
184 (
void) i2c_algo_dp_aux_stop(adapter,
false);
189 i2c_dp_aux_prepare_bus(
struct i2c_adapter *adapter)
191 adapter->
algo = &i2c_dp_aux_algo;
193 i2c_dp_aux_reset_bus(adapter);
202 error = i2c_dp_aux_prepare_bus(adapter);