Lines Matching refs:data
39 static void tosa_bl_set_backlight(struct tosa_bl_data *data, int brightness)
41 struct spi_device *spi = data->i2c->dev.platform_data;
43 i2c_smbus_write_byte_data(data->i2c, DAC_CH1, data->comadj);
46 i2c_smbus_write_byte_data(data->i2c, DAC_CH2, (u8)(brightness & 0xff));
57 struct tosa_bl_data *data = dev_get_drvdata(&dev->dev);
64 tosa_bl_set_backlight(data, brightness);
85 struct tosa_bl_data *data = kzalloc(sizeof(struct tosa_bl_data), GFP_KERNEL);
87 if (!data)
90 data->comadj = sharpsl_param.comadj == -1 ? COMADJ_DEFAULT : sharpsl_param.comadj;
94 dev_dbg(&data->bl->dev, "Unable to request gpio!\n");
101 i2c_set_clientdata(client, data);
102 data->i2c = client;
106 data->bl = backlight_device_register("tosa-bl", &client->dev, data,
108 if (IS_ERR(data->bl)) {
109 ret = PTR_ERR(data->bl);
113 data->bl->props.brightness = 69;
114 data->bl->props.power = FB_BLANK_UNBLANK;
116 backlight_update_status(data->bl);
121 data->bl = NULL;
125 kfree(data);
131 struct tosa_bl_data *data = i2c_get_clientdata(client);
133 backlight_device_unregister(data->bl);
134 data->bl = NULL;
138 kfree(data);
146 struct tosa_bl_data *data = i2c_get_clientdata(client);
148 tosa_bl_set_backlight(data, 0);
155 struct tosa_bl_data *data = i2c_get_clientdata(client);
157 backlight_update_status(data->bl);