Lines Matching +full:reset +full:- +full:assert +full:- +full:ms

1 // SPDX-License-Identifier: GPL-2.0-only
69 struct i2c_adapter *adap = client->adapter; in ps8622_set()
73 msg.addr = client->addr + page; in ps8622_set()
81 client->addr + page, reg, val, ret); in ps8622_set()
87 struct i2c_client *cl = ps8622->client; in ps8622_send_config()
138 /* [7:5] DCO_FTRNG=+-40% */ in ps8622_send_config()
148 /* Gitune=-37% */ in ps8622_send_config()
168 /* [7:6] Right-bar GPIO output strength is 8mA */ in ps8622_send_config()
180 err = ps8622_set(cl, 0x01, 0x02, 0x80 | ps8622->max_lane_count); in ps8622_send_config()
185 err = ps8622_set(cl, 0x01, 0x21, 0x80 | ps8622->lane_count); in ps8622_send_config()
202 /* Counter number, add 1ms counter delay */ in ps8622_send_config()
273 if (ps8622->bl) { in ps8622_send_config()
281 ps8622->bl->props.brightness); in ps8622_send_config()
291 /* Set LVDS output as 6bit-VESA mapping, single LVDS channel */ in ps8622_send_config()
301 /* Set SSC enabled and +/-1% central spreading */ in ps8622_send_config()
312 /* LC -> RCO */ in ps8622_send_config()
321 return err ? -EIO : 0; in ps8622_send_config()
326 struct ps8622_bridge *ps8622 = dev_get_drvdata(&bl->dev); in ps8622_backlight_update()
329 if (!ps8622->enabled) in ps8622_backlight_update()
330 return -EINVAL; in ps8622_backlight_update()
332 ret = ps8622_set(ps8622->client, 0x01, 0xa7, brightness); in ps8622_backlight_update()
346 if (ps8622->enabled) in ps8622_pre_enable()
349 gpiod_set_value(ps8622->gpio_rst, 0); in ps8622_pre_enable()
351 if (ps8622->v12) { in ps8622_pre_enable()
352 ret = regulator_enable(ps8622->v12); in ps8622_pre_enable()
354 DRM_ERROR("fails to enable ps8622->v12"); in ps8622_pre_enable()
357 gpiod_set_value(ps8622->gpio_slp, 1); in ps8622_pre_enable()
362 * data sheet specifies we should deassert the reset pin. in ps8622_pre_enable()
365 * T2.min before deasserting the reset pin. If it takes T1.min for the in ps8622_pre_enable()
367 * reset pin. in ps8622_pre_enable()
372 gpiod_set_value(ps8622->gpio_rst, 1); in ps8622_pre_enable()
374 /* wait 20ms after RST high */ in ps8622_pre_enable()
383 ps8622->enabled = true; in ps8622_pre_enable()
396 if (!ps8622->enabled) in ps8622_post_disable()
399 ps8622->enabled = false; in ps8622_post_disable()
403 * else might keep them on. In that case, we want to assert the slp gpio in ps8622_post_disable()
406 gpiod_set_value(ps8622->gpio_slp, 0); in ps8622_post_disable()
408 if (ps8622->v12) in ps8622_post_disable()
409 regulator_disable(ps8622->v12); in ps8622_post_disable()
417 gpiod_set_value(ps8622->gpio_rst, 0); in ps8622_post_disable()
427 return drm_bridge_attach(ps8622->bridge.encoder, ps8622->panel_bridge, in ps8622_attach()
428 &ps8622->bridge, flags); in ps8622_attach()
448 struct device *dev = &client->dev; in ps8622_probe()
455 return -ENOMEM; in ps8622_probe()
457 panel_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 0, 0); in ps8622_probe()
461 ps8622->panel_bridge = panel_bridge; in ps8622_probe()
462 ps8622->client = client; in ps8622_probe()
464 ps8622->v12 = devm_regulator_get(dev, "vdd12"); in ps8622_probe()
465 if (IS_ERR(ps8622->v12)) { in ps8622_probe()
467 ps8622->v12 = NULL; in ps8622_probe()
470 ps8622->gpio_slp = devm_gpiod_get(dev, "sleep", GPIOD_OUT_HIGH); in ps8622_probe()
471 if (IS_ERR(ps8622->gpio_slp)) { in ps8622_probe()
472 ret = PTR_ERR(ps8622->gpio_slp); in ps8622_probe()
478 * Assert the reset pin high to avoid the bridge being in ps8622_probe()
481 ps8622->gpio_rst = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); in ps8622_probe()
482 if (IS_ERR(ps8622->gpio_rst)) { in ps8622_probe()
483 ret = PTR_ERR(ps8622->gpio_rst); in ps8622_probe()
488 ps8622->max_lane_count = id->driver_data; in ps8622_probe()
490 if (of_property_read_u32(dev->of_node, "lane-count", in ps8622_probe()
491 &ps8622->lane_count)) { in ps8622_probe()
492 ps8622->lane_count = ps8622->max_lane_count; in ps8622_probe()
493 } else if (ps8622->lane_count > ps8622->max_lane_count) { in ps8622_probe()
494 dev_info(dev, "lane-count property is too high," in ps8622_probe()
496 ps8622->lane_count = ps8622->max_lane_count; in ps8622_probe()
499 if (!of_find_property(dev->of_node, "use-external-pwm", NULL)) { in ps8622_probe()
500 ps8622->bl = backlight_device_register("ps8622-backlight", in ps8622_probe()
503 if (IS_ERR(ps8622->bl)) { in ps8622_probe()
505 ret = PTR_ERR(ps8622->bl); in ps8622_probe()
506 ps8622->bl = NULL; in ps8622_probe()
509 ps8622->bl->props.max_brightness = PS8622_MAX_BRIGHTNESS; in ps8622_probe()
510 ps8622->bl->props.brightness = PS8622_MAX_BRIGHTNESS; in ps8622_probe()
513 ps8622->bridge.funcs = &ps8622_bridge_funcs; in ps8622_probe()
514 ps8622->bridge.type = DRM_MODE_CONNECTOR_LVDS; in ps8622_probe()
515 ps8622->bridge.of_node = dev->of_node; in ps8622_probe()
516 drm_bridge_add(&ps8622->bridge); in ps8622_probe()
527 backlight_device_unregister(ps8622->bl); in ps8622_remove()
528 drm_bridge_remove(&ps8622->bridge); in ps8622_remove()
551 MODULE_DESCRIPTION("Parade ps8622/ps8625 eDP-LVDS converter driver");