summaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/pwm_backlight.c22
-rw-r--r--drivers/video/simple_panel.c2
-rw-r--r--drivers/video/tegra124/display.c2
-rw-r--r--drivers/video/vidconsole-uclass.c1
4 files changed, 17 insertions, 10 deletions
diff --git a/drivers/video/pwm_backlight.c b/drivers/video/pwm_backlight.c
index 3697f4905c..fbd7bf7838 100644
--- a/drivers/video/pwm_backlight.c
+++ b/drivers/video/pwm_backlight.c
@@ -28,11 +28,13 @@ struct pwm_backlight_priv {
static int pwm_backlight_enable(struct udevice *dev)
{
struct pwm_backlight_priv *priv = dev_get_priv(dev);
+ struct dm_regulator_uclass_platdata *plat;
uint duty_cycle;
int ret;
- debug("%s: Enable '%s', regulator '%s'\n", __func__, dev->name,
- priv->reg->name);
+ plat = dev_get_uclass_platdata(priv->reg);
+ debug("%s: Enable '%s', regulator '%s'/'%s'\n", __func__, dev->name,
+ priv->reg->name, plat->name);
ret = regulator_set_enable(priv->reg, true);
if (ret) {
debug("%s: Cannot enable regulator for PWM '%s'\n", __func__,
@@ -59,12 +61,11 @@ static int pwm_backlight_enable(struct udevice *dev)
static int pwm_backlight_ofdata_to_platdata(struct udevice *dev)
{
struct pwm_backlight_priv *priv = dev_get_priv(dev);
- struct fdtdec_phandle_args args;
- const void *blob = gd->fdt_blob;
- int node = dev_of_offset(dev);
+ struct ofnode_phandle_args args;
int index, ret, count, len;
const u32 *cell;
+ debug("%s: start\n", __func__);
ret = uclass_get_device_by_phandle(UCLASS_REGULATOR, dev,
"power-supply", &priv->reg);
if (ret) {
@@ -79,14 +80,14 @@ static int pwm_backlight_ofdata_to_platdata(struct udevice *dev)
if (ret != -ENOENT)
return ret;
}
- ret = fdtdec_parse_phandle_with_args(blob, node, "pwms", "#pwm-cells",
- 0, 0, &args);
+ ret = dev_read_phandle_with_args(dev, "pwms", "#pwm-cells", 0, 0,
+ &args);
if (ret) {
debug("%s: Cannot get PWM phandle: ret=%d\n", __func__, ret);
return ret;
}
- ret = uclass_get_device_by_of_offset(UCLASS_PWM, args.node, &priv->pwm);
+ ret = uclass_get_device_by_ofnode(UCLASS_PWM, args.node, &priv->pwm);
if (ret) {
debug("%s: Cannot get PWM: ret=%d\n", __func__, ret);
return ret;
@@ -94,8 +95,8 @@ static int pwm_backlight_ofdata_to_platdata(struct udevice *dev)
priv->channel = args.args[0];
priv->period_ns = args.args[1];
- index = fdtdec_get_int(blob, node, "default-brightness-level", 255);
- cell = fdt_getprop(blob, node, "brightness-levels", &len);
+ index = dev_read_u32_default(dev, "default-brightness-level", 255);
+ cell = dev_read_prop(dev, "brightness-levels", &len);
count = len / sizeof(u32);
if (cell && count > index) {
priv->default_level = fdt32_to_cpu(cell[index]);
@@ -104,6 +105,7 @@ static int pwm_backlight_ofdata_to_platdata(struct udevice *dev)
priv->default_level = index;
priv->max_level = 255;
}
+ debug("%s: done\n", __func__);
return 0;
diff --git a/drivers/video/simple_panel.c b/drivers/video/simple_panel.c
index baa95f6a12..c0ce199c6a 100644
--- a/drivers/video/simple_panel.c
+++ b/drivers/video/simple_panel.c
@@ -25,8 +25,10 @@ static int simple_panel_enable_backlight(struct udevice *dev)
struct simple_panel_priv *priv = dev_get_priv(dev);
int ret;
+ debug("%s: start, backlight = '%s'\n", __func__, priv->backlight->name);
dm_gpio_set_value(&priv->enable, 1);
ret = backlight_enable(priv->backlight);
+ debug("%s: done, ret = %d\n", __func__, ret);
if (ret)
return ret;
diff --git a/drivers/video/tegra124/display.c b/drivers/video/tegra124/display.c
index bbbca13bdc..47752b27f1 100644
--- a/drivers/video/tegra124/display.c
+++ b/drivers/video/tegra124/display.c
@@ -471,7 +471,9 @@ static int tegra124_lcd_probe(struct udevice *dev)
int ret;
start = get_timer(0);
+ bootstage_start(BOOTSTAGE_ID_ACCUM_LCD, "lcd");
ret = tegra124_lcd_init(dev, (void *)plat->base, VIDEO_BPP16);
+ bootstage_accum(BOOTSTAGE_ID_ACCUM_LCD);
debug("LCD init took %lu ms\n", get_timer(start));
if (ret)
printf("%s: Error %d\n", __func__, ret);
diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c
index e9a90b1b9b..b5afd72227 100644
--- a/drivers/video/vidconsole-uclass.c
+++ b/drivers/video/vidconsole-uclass.c
@@ -77,6 +77,7 @@ static int vidconsole_back(struct udevice *dev)
if (priv->ycur < 0)
priv->ycur = 0;
}
+ video_sync(dev->parent);
return 0;
}