Lines Matching full:client

99 	struct i2c_client	*client;  member
106 struct i2c_client *client; member
119 static int adp8860_read(struct i2c_client *client, int reg, uint8_t *val) in adp8860_read() argument
123 ret = i2c_smbus_read_byte_data(client, reg); in adp8860_read()
125 dev_err(&client->dev, "failed reading at 0x%02x\n", reg); in adp8860_read()
133 static int adp8860_write(struct i2c_client *client, u8 reg, u8 val) in adp8860_write() argument
135 return i2c_smbus_write_byte_data(client, reg, val); in adp8860_write()
138 static int adp8860_set_bits(struct i2c_client *client, int reg, uint8_t bit_mask) in adp8860_set_bits() argument
140 struct adp8860_bl *data = i2c_get_clientdata(client); in adp8860_set_bits()
146 ret = adp8860_read(client, reg, &reg_val); in adp8860_set_bits()
150 ret = adp8860_write(client, reg, reg_val); in adp8860_set_bits()
157 static int adp8860_clr_bits(struct i2c_client *client, int reg, uint8_t bit_mask) in adp8860_clr_bits() argument
159 struct adp8860_bl *data = i2c_get_clientdata(client); in adp8860_clr_bits()
165 ret = adp8860_read(client, reg, &reg_val); in adp8860_clr_bits()
169 ret = adp8860_write(client, reg, reg_val); in adp8860_clr_bits()
184 adp8860_write(led->client, ADP8860_ISC1 - led->id + 1, in adp8860_led_work()
200 struct i2c_client *client = led->client; in adp8860_led_setup() local
203 ret = adp8860_write(client, ADP8860_ISC1 - led->id + 1, 0); in adp8860_led_setup()
204 ret |= adp8860_set_bits(client, ADP8860_ISCC, 1 << (led->id - 1)); in adp8860_led_setup()
207 ret |= adp8860_set_bits(client, ADP8860_ISCT1, in adp8860_led_setup()
210 ret |= adp8860_set_bits(client, ADP8860_ISCT2, in adp8860_led_setup()
216 static int adp8860_led_probe(struct i2c_client *client) in adp8860_led_probe() argument
219 dev_get_platdata(&client->dev); in adp8860_led_probe()
220 struct adp8860_bl *data = i2c_get_clientdata(client); in adp8860_led_probe()
225 led = devm_kcalloc(&client->dev, pdata->num_leds, sizeof(*led), in adp8860_led_probe()
230 ret = adp8860_write(client, ADP8860_ISCFR, pdata->led_fade_law); in adp8860_led_probe()
231 ret = adp8860_write(client, ADP8860_ISCT1, in adp8860_led_probe()
233 ret |= adp8860_write(client, ADP8860_ISCF, in adp8860_led_probe()
237 dev_err(&client->dev, "failed to write\n"); in adp8860_led_probe()
248 dev_err(&client->dev, "Invalid LED ID %d\n", in adp8860_led_probe()
255 dev_err(&client->dev, "LED %d used by Backlight\n", in adp8860_led_probe()
266 led_dat->client = client; in adp8860_led_probe()
270 ret = led_classdev_register(&client->dev, &led_dat->cdev); in adp8860_led_probe()
272 dev_err(&client->dev, "failed to register LED %d\n", in adp8860_led_probe()
279 dev_err(&client->dev, "failed to write\n"); in adp8860_led_probe()
298 static int adp8860_led_remove(struct i2c_client *client) in adp8860_led_remove() argument
301 dev_get_platdata(&client->dev); in adp8860_led_remove()
302 struct adp8860_bl *data = i2c_get_clientdata(client); in adp8860_led_remove()
313 static int adp8860_led_probe(struct i2c_client *client) in adp8860_led_probe() argument
318 static int adp8860_led_remove(struct i2c_client *client) in adp8860_led_remove() argument
327 struct i2c_client *client = data->client; in adp8860_bl_set() local
333 ret |= adp8860_clr_bits(client, ADP8860_MDCR, in adp8860_bl_set()
335 ret |= adp8860_write(client, ADP8860_BLMX1, brightness); in adp8860_bl_set()
341 ret |= adp8860_write(client, ADP8860_BLMX1, in adp8860_bl_set()
343 ret |= adp8860_set_bits(client, ADP8860_MDCR, in adp8860_bl_set()
347 ret |= adp8860_write(client, ADP8860_BLMX1, brightness); in adp8860_bl_set()
350 ret |= adp8860_set_bits(client, in adp8860_bl_set()
353 ret |= adp8860_clr_bits(client, in adp8860_bl_set()
382 struct i2c_client *client = data->client; in adp8860_bl_setup() local
386 ret |= adp8860_write(client, ADP8860_BLSEN, ~pdata->bl_led_assign); in adp8860_bl_setup()
387 ret |= adp8860_write(client, ADP8860_BLMX1, pdata->l1_daylight_max); in adp8860_bl_setup()
388 ret |= adp8860_write(client, ADP8860_BLDM1, pdata->l1_daylight_dim); in adp8860_bl_setup()
392 ret |= adp8860_write(client, ADP8860_BLMX2, in adp8860_bl_setup()
394 ret |= adp8860_write(client, ADP8860_BLDM2, in adp8860_bl_setup()
396 ret |= adp8860_write(client, ADP8860_BLMX3, in adp8860_bl_setup()
398 ret |= adp8860_write(client, ADP8860_BLDM3, in adp8860_bl_setup()
401 ret |= adp8860_write(client, ADP8860_L2_TRP, pdata->l2_trip); in adp8860_bl_setup()
402 ret |= adp8860_write(client, ADP8860_L2_HYS, pdata->l2_hyst); in adp8860_bl_setup()
403 ret |= adp8860_write(client, ADP8860_L3_TRP, pdata->l3_trip); in adp8860_bl_setup()
404 ret |= adp8860_write(client, ADP8860_L3_HYS, pdata->l3_hyst); in adp8860_bl_setup()
405 ret |= adp8860_write(client, ADP8860_CCFG, L2_EN | L3_EN | in adp8860_bl_setup()
409 ret |= adp8860_write(client, ADP8860_CFGR, in adp8860_bl_setup()
412 ret |= adp8860_write(client, ADP8860_BLFR, FADE_VAL(pdata->bl_fade_in, in adp8860_bl_setup()
415 ret |= adp8860_set_bits(client, ADP8860_MDCR, BLEN | DIM_EN | NSTBY | in adp8860_bl_setup()
428 error = adp8860_read(data->client, reg, &reg_val); in adp8860_show()
449 adp8860_write(data->client, reg, val); in adp8860_store()
559 error = adp8860_read(data->client, ADP8860_PH1LEVL, &reg_val); in adp8860_bl_ambient_light_level_show()
562 error = adp8860_read(data->client, ADP8860_PH1LEVH, &reg_val); in adp8860_bl_ambient_light_level_show()
585 error = adp8860_read(data->client, ADP8860_CFGR, &reg_val); in adp8860_bl_ambient_light_zone_show()
610 adp8860_set_bits(data->client, ADP8860_MDCR, CMP_AUTOEN); in adp8860_bl_ambient_light_zone_store()
613 adp8860_clr_bits(data->client, ADP8860_MDCR, CMP_AUTOEN); in adp8860_bl_ambient_light_zone_store()
617 ret = adp8860_read(data->client, ADP8860_CFGR, &reg_val); in adp8860_bl_ambient_light_zone_store()
621 adp8860_write(data->client, ADP8860_CFGR, reg_val); in adp8860_bl_ambient_light_zone_store()
651 static int adp8860_probe(struct i2c_client *client) in adp8860_probe() argument
653 const struct i2c_device_id *id = i2c_client_get_device_id(client); in adp8860_probe()
657 dev_get_platdata(&client->dev); in adp8860_probe()
662 if (!i2c_check_functionality(client->adapter, in adp8860_probe()
664 dev_err(&client->dev, "SMBUS Byte Data not Supported\n"); in adp8860_probe()
669 dev_err(&client->dev, "no platform data?\n"); in adp8860_probe()
673 data = devm_kzalloc(&client->dev, sizeof(*data), GFP_KERNEL); in adp8860_probe()
677 ret = adp8860_read(client, ADP8860_MFDVID, &reg_val); in adp8860_probe()
692 dev_err(&client->dev, "failed to probe\n"); in adp8860_probe()
699 data->client = client; in adp8860_probe()
703 i2c_set_clientdata(client, data); in adp8860_probe()
711 bl = devm_backlight_device_register(&client->dev, in adp8860_probe()
712 dev_driver_string(&client->dev), in adp8860_probe()
713 &client->dev, data, &adp8860_bl_ops, &props); in adp8860_probe()
715 dev_err(&client->dev, "failed to register backlight\n"); in adp8860_probe()
728 dev_err(&client->dev, "failed to register sysfs\n"); in adp8860_probe()
740 dev_info(&client->dev, "%s Rev.%d Backlight\n", in adp8860_probe()
741 client->name, data->revid); in adp8860_probe()
744 adp8860_led_probe(client); in adp8860_probe()
756 static void adp8860_remove(struct i2c_client *client) in adp8860_remove() argument
758 struct adp8860_bl *data = i2c_get_clientdata(client); in adp8860_remove()
760 adp8860_clr_bits(client, ADP8860_MDCR, NSTBY); in adp8860_remove()
763 adp8860_led_remove(client); in adp8860_remove()
773 struct i2c_client *client = to_i2c_client(dev); in adp8860_i2c_suspend() local
775 adp8860_clr_bits(client, ADP8860_MDCR, NSTBY); in adp8860_i2c_suspend()
782 struct i2c_client *client = to_i2c_client(dev); in adp8860_i2c_resume() local
784 adp8860_set_bits(client, ADP8860_MDCR, NSTBY | BLEN); in adp8860_i2c_resume()