Lines Matching +full:fine +full:- +full:tune
1 // SPDX-License-Identifier: GPL-2.0-only
68 struct i2c_adapter *adap = client->adapter; in ps8622_set()
72 msg.addr = client->addr + page; in ps8622_set()
80 client->addr + page, reg, val, ret); in ps8622_set()
86 struct i2c_client *cl = ps8622->client; in ps8622_send_config()
110 * [3:2] CDR tune wait cycle before measure for fine tune in ps8622_send_config()
137 /* [7:5] DCO_FTRNG=+-40% */ in ps8622_send_config()
147 /* Gitune=-37% */ in ps8622_send_config()
167 /* [7:6] Right-bar GPIO output strength is 8mA */ in ps8622_send_config()
179 err = ps8622_set(cl, 0x01, 0x02, 0x80 | ps8622->max_lane_count); in ps8622_send_config()
184 err = ps8622_set(cl, 0x01, 0x21, 0x80 | ps8622->lane_count); in ps8622_send_config()
272 if (ps8622->bl) { in ps8622_send_config()
280 ps8622->bl->props.brightness); in ps8622_send_config()
290 /* Set LVDS output as 6bit-VESA mapping, single LVDS channel */ in ps8622_send_config()
300 /* Set SSC enabled and +/-1% central spreading */ in ps8622_send_config()
311 /* LC -> RCO */ in ps8622_send_config()
320 return err ? -EIO : 0; in ps8622_send_config()
325 struct ps8622_bridge *ps8622 = dev_get_drvdata(&bl->dev); in ps8622_backlight_update()
328 if (!ps8622->enabled) in ps8622_backlight_update()
329 return -EINVAL; in ps8622_backlight_update()
331 ret = ps8622_set(ps8622->client, 0x01, 0xa7, brightness); in ps8622_backlight_update()
345 if (ps8622->enabled) in ps8622_pre_enable()
348 gpiod_set_value(ps8622->gpio_rst, 0); in ps8622_pre_enable()
350 if (ps8622->v12) { in ps8622_pre_enable()
351 ret = regulator_enable(ps8622->v12); in ps8622_pre_enable()
353 DRM_ERROR("fails to enable ps8622->v12"); in ps8622_pre_enable()
356 gpiod_set_value(ps8622->gpio_slp, 1); in ps8622_pre_enable()
371 gpiod_set_value(ps8622->gpio_rst, 1); in ps8622_pre_enable()
382 ps8622->enabled = true; in ps8622_pre_enable()
395 if (!ps8622->enabled) in ps8622_post_disable()
398 ps8622->enabled = false; in ps8622_post_disable()
405 gpiod_set_value(ps8622->gpio_slp, 0); in ps8622_post_disable()
407 if (ps8622->v12) in ps8622_post_disable()
408 regulator_disable(ps8622->v12); in ps8622_post_disable()
416 gpiod_set_value(ps8622->gpio_rst, 0); in ps8622_post_disable()
426 return drm_bridge_attach(ps8622->bridge.encoder, ps8622->panel_bridge, in ps8622_attach()
427 &ps8622->bridge, flags); in ps8622_attach()
447 struct device *dev = &client->dev; in ps8622_probe()
454 return -ENOMEM; in ps8622_probe()
456 panel_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 0, 0); in ps8622_probe()
460 ps8622->panel_bridge = panel_bridge; in ps8622_probe()
461 ps8622->client = client; in ps8622_probe()
463 ps8622->v12 = devm_regulator_get(dev, "vdd12"); in ps8622_probe()
464 if (IS_ERR(ps8622->v12)) { in ps8622_probe()
466 ps8622->v12 = NULL; in ps8622_probe()
469 ps8622->gpio_slp = devm_gpiod_get(dev, "sleep", GPIOD_OUT_HIGH); in ps8622_probe()
470 if (IS_ERR(ps8622->gpio_slp)) { in ps8622_probe()
471 ret = PTR_ERR(ps8622->gpio_slp); in ps8622_probe()
480 ps8622->gpio_rst = devm_gpiod_get(dev, "reset", GPIOD_OUT_HIGH); in ps8622_probe()
481 if (IS_ERR(ps8622->gpio_rst)) { in ps8622_probe()
482 ret = PTR_ERR(ps8622->gpio_rst); in ps8622_probe()
487 ps8622->max_lane_count = id->driver_data; in ps8622_probe()
489 if (of_property_read_u32(dev->of_node, "lane-count", in ps8622_probe()
490 &ps8622->lane_count)) { in ps8622_probe()
491 ps8622->lane_count = ps8622->max_lane_count; in ps8622_probe()
492 } else if (ps8622->lane_count > ps8622->max_lane_count) { in ps8622_probe()
493 dev_info(dev, "lane-count property is too high," in ps8622_probe()
495 ps8622->lane_count = ps8622->max_lane_count; in ps8622_probe()
498 if (!of_property_read_bool(dev->of_node, "use-external-pwm")) { in ps8622_probe()
499 ps8622->bl = backlight_device_register("ps8622-backlight", in ps8622_probe()
502 if (IS_ERR(ps8622->bl)) { in ps8622_probe()
504 ret = PTR_ERR(ps8622->bl); in ps8622_probe()
505 ps8622->bl = NULL; in ps8622_probe()
508 ps8622->bl->props.max_brightness = PS8622_MAX_BRIGHTNESS; in ps8622_probe()
509 ps8622->bl->props.brightness = PS8622_MAX_BRIGHTNESS; in ps8622_probe()
512 ps8622->bridge.funcs = &ps8622_bridge_funcs; in ps8622_probe()
513 ps8622->bridge.type = DRM_MODE_CONNECTOR_LVDS; in ps8622_probe()
514 ps8622->bridge.of_node = dev->of_node; in ps8622_probe()
515 drm_bridge_add(&ps8622->bridge); in ps8622_probe()
526 backlight_device_unregister(ps8622->bl); in ps8622_remove()
527 drm_bridge_remove(&ps8622->bridge); in ps8622_remove()
550 MODULE_DESCRIPTION("Parade ps8622/ps8625 eDP-LVDS converter driver");