Lines Matching refs:eeprom_dev
120 static int otp_read_data(struct eeprom_device *eeprom_dev) in otp_read_data() argument
122 struct i2c_client *client = eeprom_dev->client; in otp_read_data()
125 struct device *dev = &eeprom_dev->client->dev; in otp_read_data()
277 eeprom_dev->otp = otp_ptr; in otp_read_data()
280 eeprom_dev->otp = NULL; in otp_read_data()
287 eeprom_dev->otp = NULL; in otp_read_data()
293 static void rkotp_read_module_info(struct eeprom_device *eeprom_dev, in rkotp_read_module_info() argument
297 struct i2c_client *client = eeprom_dev->client; in rkotp_read_module_info()
298 struct device *dev = &eeprom_dev->client->dev; in rkotp_read_module_info()
401 static void rkotp_read_awb(struct eeprom_device *eeprom_dev, in rkotp_read_awb() argument
405 struct i2c_client *client = eeprom_dev->client; in rkotp_read_awb()
406 struct device *dev = &eeprom_dev->client->dev; in rkotp_read_awb()
474 static void rkotp_read_lsc(struct eeprom_device *eeprom_dev, in rkotp_read_lsc() argument
478 struct i2c_client *client = eeprom_dev->client; in rkotp_read_lsc()
479 struct device *dev = &eeprom_dev->client->dev; in rkotp_read_lsc()
549 static void rkotp_read_pdaf(struct eeprom_device *eeprom_dev, in rkotp_read_pdaf() argument
553 struct i2c_client *client = eeprom_dev->client; in rkotp_read_pdaf()
554 struct device *dev = &eeprom_dev->client->dev; in rkotp_read_pdaf()
678 static void rkotp_read_af(struct eeprom_device *eeprom_dev, in rkotp_read_af() argument
682 struct i2c_client *client = eeprom_dev->client; in rkotp_read_af()
683 struct device *dev = &eeprom_dev->client->dev; in rkotp_read_af()
729 static int rkotp_read_data(struct eeprom_device *eeprom_dev) in rkotp_read_data() argument
731 struct i2c_client *client = eeprom_dev->client; in rkotp_read_data()
733 struct device *dev = &eeprom_dev->client->dev; in rkotp_read_data()
749 rkotp_read_module_info(eeprom_dev, in rkotp_read_data()
755 rkotp_read_awb(eeprom_dev, in rkotp_read_data()
761 rkotp_read_lsc(eeprom_dev, in rkotp_read_data()
767 rkotp_read_pdaf(eeprom_dev, in rkotp_read_data()
773 rkotp_read_af(eeprom_dev, in rkotp_read_data()
786 eeprom_dev->otp = otp_ptr; in rkotp_read_data()
789 eeprom_dev->otp = NULL; in rkotp_read_data()
797 static int otp_read(struct eeprom_device *eeprom_dev) in otp_read() argument
800 struct i2c_client *client = eeprom_dev->client; in otp_read()
802 mutex_lock(&eeprom_dev->mutex); in otp_read()
805 otp_read_data(eeprom_dev); in otp_read()
807 rkotp_read_data(eeprom_dev); in otp_read()
810 mutex_unlock(&eeprom_dev->mutex); in otp_read()
814 mutex_unlock(&eeprom_dev->mutex); in otp_read()
821 struct eeprom_device *eeprom_dev = in eeprom_ioctl() local
825 if (!eeprom_dev->otp) { in eeprom_ioctl()
826 if (otp_read(eeprom_dev)) in eeprom_ioctl()
829 if (arg && eeprom_dev->otp) in eeprom_ioctl()
830 memcpy(arg, eeprom_dev->otp, in eeprom_ioctl()
1026 struct eeprom_device *eeprom_dev; in eeprom_probe() local
1033 eeprom_dev = devm_kzalloc(&client->dev, in eeprom_probe()
1034 sizeof(*eeprom_dev), in eeprom_probe()
1037 if (eeprom_dev == NULL) { in eeprom_probe()
1041 mutex_init(&eeprom_dev->mutex); in eeprom_probe()
1042 v4l2_i2c_subdev_init(&eeprom_dev->sd, in eeprom_probe()
1044 eeprom_dev->client = client; in eeprom_probe()
1045 snprintf(eeprom_dev->name, sizeof(eeprom_dev->name), "%s-%d-%02x", in eeprom_probe()
1047 eeprom_proc_init(eeprom_dev); in eeprom_probe()
1060 struct eeprom_device *eeprom_dev = in eeprom_remove() local
1062 kfree(eeprom_dev->otp); in eeprom_remove()
1063 mutex_destroy(&eeprom_dev->mutex); in eeprom_remove()
1065 eeprom_subdev_cleanup(eeprom_dev); in eeprom_remove()
1066 eeprom_proc_cleanup(eeprom_dev); in eeprom_remove()