Lines Matching refs:fcns

16 efb_i2c_stop(void *efb_priv, int port, const efb_i2c_functions_t *fcns)
42 fcns->set_scl(efb_priv, port, 0); /* make sure clock is low */
43 fcns->ddc_clk(efb_priv, port, 1);
45 fcns->set_sda(efb_priv, port, 0); /* make sure data is low */
46 fcns->ddc_clk(efb_priv, port, 1);
48 fcns->set_scl(efb_priv, port, 1); /* release clock */
50 status = efb_i2c_clk_stretch(efb_priv, port, fcns);
55 fcns->ddc_clk(efb_priv, port, 1);
57 fcns->set_sda(efb_priv, port, 1); /* generate the stop */
58 fcns->ddc_clk(efb_priv, port, 1);
65 efb_i2c_start(void *efb_priv, int port, const efb_i2c_functions_t *fcns)
73 fcns->set_scl(efb_priv, port, 0); /* make sure clock is low */
74 fcns->ddc_clk(efb_priv, port, 1);
76 fcns->set_sda(efb_priv, port, 1); /* make sure data is high */
77 fcns->ddc_clk(efb_priv, port, 1);
79 fcns->set_scl(efb_priv, port, 1); /* release clock */
81 status = efb_i2c_clk_stretch(efb_priv, port, fcns);
86 fcns->ddc_clk(efb_priv, port, 1);
88 fcns->set_sda(efb_priv, port, 0); /* generate the start */
89 fcns->ddc_clk(efb_priv, port, 1);
97 const efb_i2c_functions_t *fcns, uint8_t *rval)
104 if ((status = efb_read_bit(efb_priv, port, fcns, &b7)) != EFB_I2C_OK ||
105 (status = efb_read_bit(efb_priv, port, fcns, &b6)) != EFB_I2C_OK ||
106 (status = efb_read_bit(efb_priv, port, fcns, &b5)) != EFB_I2C_OK ||
107 (status = efb_read_bit(efb_priv, port, fcns, &b4)) != EFB_I2C_OK ||
108 (status = efb_read_bit(efb_priv, port, fcns, &b3)) != EFB_I2C_OK ||
109 (status = efb_read_bit(efb_priv, port, fcns, &b2)) != EFB_I2C_OK ||
110 (status = efb_read_bit(efb_priv, port, fcns, &b1)) != EFB_I2C_OK ||
111 (status = efb_read_bit(efb_priv, port, fcns, &b0)) != EFB_I2C_OK) {
131 const efb_i2c_functions_t *fcns, uint8_t *rval)
135 status = efb_read_byte_data(efb_priv, port, fcns, rval);
140 return (efb_write_bit(efb_priv, port, fcns, 0)); /* ack */
146 const efb_i2c_functions_t *fcns, uint8_t *rval)
150 status = efb_read_byte_data(efb_priv, port, fcns, rval);
155 fcns->set_scl(efb_priv, port, 0);
156 fcns->ddc_clk(efb_priv, port, 1);
158 fcns->set_sda(efb_priv, port, 1); /* nack */
159 fcns->ddc_clk(efb_priv, port, 1);
161 fcns->set_scl(efb_priv, port, 1);
163 status = efb_i2c_clk_stretch(efb_priv, port, fcns);
168 fcns->ddc_clk(efb_priv, port, 1);
170 status = fcns->get_sda(efb_priv, port); /* should float high */
171 fcns->ddc_clk(efb_priv, port, 1);
179 const efb_i2c_functions_t *fcns, int *rval)
183 fcns->set_scl(efb_priv, port, 0);
184 fcns->ddc_clk(efb_priv, port, 1);
186 fcns->set_sda(efb_priv, port, 1); /* release data line */
187 fcns->ddc_clk(efb_priv, port, 1);
189 fcns->set_scl(efb_priv, port, 1);
191 status = efb_i2c_clk_stretch(efb_priv, port, fcns);
196 fcns->ddc_clk(efb_priv, port, 1);
198 *rval = fcns->get_sda(efb_priv, port);
199 fcns->ddc_clk(efb_priv, port, 1);
207 const efb_i2c_functions_t *fcns, int data)
218 status = efb_write_bit(efb_priv, port, fcns, bit);
224 return (efb_i2c_check_write_ack(efb_priv, port, fcns));
230 const efb_i2c_functions_t *fcns, int data)
247 fcns->set_scl(efb_priv, port, 0);
248 fcns->ddc_clk(efb_priv, port, 1);
250 fcns->set_sda(efb_priv, port, data);
251 fcns->ddc_clk(efb_priv, port, 1);
253 fcns->set_scl(efb_priv, port, 1);
255 status = efb_i2c_clk_stretch(efb_priv, port, fcns);
260 fcns->ddc_clk(efb_priv, port, 1);
262 fcns->ddc_clk(efb_priv, port, 1);
270 const efb_i2c_functions_t *fcns)
280 fcns->set_scl(efb_priv, port, 0); /* clock low */
281 fcns->ddc_clk(efb_priv, port, 1);
283 fcns->set_sda(efb_priv, port, 1); /* release data line */
284 fcns->ddc_clk(efb_priv, port, 1);
286 fcns->set_scl(efb_priv, port, 1);
288 status = efb_i2c_clk_stretch(efb_priv, port, fcns);
293 fcns->ddc_clk(efb_priv, port, 1);
295 status = fcns->get_sda(efb_priv, port);
296 fcns->ddc_clk(efb_priv, port, 1);
303 efb_i2c_write_reg(void *efb_priv, const efb_i2c_functions_t *fcns,
306 (void) efb_i2c_start(efb_priv, port, fcns);
308 (void) efb_i2c_write_byte(efb_priv, port, fcns, i2c_addr);
309 (void) efb_i2c_write_byte(efb_priv, port, fcns, reg_addr);
310 (void) efb_i2c_write_byte(efb_priv, port, fcns, data);
312 (void) efb_i2c_stop(efb_priv, port, fcns);
317 efb_i2c_clk_stretch(void *efb_priv, int port, const efb_i2c_functions_t *fcns)
320 int count = fcns->clock_stretch; /* 10,000 �sec */
330 if (fcns->get_scl(efb_priv, port)) {