Lines Matching full:ktd253

3  * Backlight driver for the Kinetic KTD253
37 static void ktd253_backlight_set_max_ratio(struct ktd253_backlight *ktd253) in ktd253_backlight_set_max_ratio() argument
39 gpiod_set_value_cansleep(ktd253->gpiod, 1); in ktd253_backlight_set_max_ratio()
44 static int ktd253_backlight_stepdown(struct ktd253_backlight *ktd253) in ktd253_backlight_stepdown() argument
62 gpiod_set_value(ktd253->gpiod, 0); in ktd253_backlight_stepdown()
64 gpiod_set_value(ktd253->gpiod, 1); in ktd253_backlight_stepdown()
67 dev_err(ktd253->dev, "PCM on backlight took too long (%llu ns)\n", ns); in ktd253_backlight_stepdown()
76 struct ktd253_backlight *ktd253 = bl_get_data(bl); in ktd253_backlight_update_status() local
79 u16 current_ratio = ktd253->ratio; in ktd253_backlight_update_status()
82 dev_dbg(ktd253->dev, "new brightness/ratio: %d/32\n", brightness); in ktd253_backlight_update_status()
91 gpiod_set_value_cansleep(ktd253->gpiod, 0); in ktd253_backlight_update_status()
94 * to actually switch the KTD253 off. in ktd253_backlight_update_status()
97 ktd253->ratio = 0; in ktd253_backlight_update_status()
102 ktd253_backlight_set_max_ratio(ktd253); in ktd253_backlight_update_status()
112 ret = ktd253_backlight_stepdown(ktd253); in ktd253_backlight_update_status()
119 gpiod_set_value_cansleep(ktd253->gpiod, 0); in ktd253_backlight_update_status()
121 ktd253_backlight_set_max_ratio(ktd253); in ktd253_backlight_update_status()
130 ktd253->ratio = current_ratio; in ktd253_backlight_update_status()
132 dev_dbg(ktd253->dev, "new ratio set to %d/32\n", target_ratio); in ktd253_backlight_update_status()
146 struct ktd253_backlight *ktd253; in ktd253_backlight_probe() local
151 ktd253 = devm_kzalloc(dev, sizeof(*ktd253), GFP_KERNEL); in ktd253_backlight_probe()
152 if (!ktd253) in ktd253_backlight_probe()
154 ktd253->dev = dev; in ktd253_backlight_probe()
174 ktd253->gpiod = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW); in ktd253_backlight_probe()
175 if (IS_ERR(ktd253->gpiod)) in ktd253_backlight_probe()
176 return dev_err_probe(dev, PTR_ERR(ktd253->gpiod), in ktd253_backlight_probe()
178 gpiod_set_consumer_name(ktd253->gpiod, dev_name(dev)); in ktd253_backlight_probe()
182 bl = devm_backlight_device_register(dev, dev_name(dev), dev, ktd253, in ktd253_backlight_probe()
198 ktd253->bl = bl; in ktd253_backlight_probe()
206 { .compatible = "kinetic,ktd253" },
214 .name = "ktd253-backlight",
222 MODULE_DESCRIPTION("Kinetic KTD253 Backlight Driver");
224 MODULE_ALIAS("platform:ktd253-backlight");