From: laurent.pinchart@ideasonboard.com (Laurent Pinchart)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/4 v5] drm/bridge: Add timing support to dumb VGA DAC
Date: Mon, 18 Dec 2017 12:51:11 +0200 [thread overview]
Message-ID: <2062807.LCImKMf1yA@avalon> (raw)
In-Reply-To: <20171215121047.3650-4-linus.walleij@linaro.org>
Hi Linus,
Thank you for the patch.
On Friday, 15 December 2017 14:10:46 EET Linus Walleij wrote:
> This extends the dumb VGA DAC bridge to handle the THS8134A
> and THS8134B VGA DACs in addition to those already handled.
>
> We assign the proper timing data to the pointer inside the
> bridge struct so display controllers that need to align their
> timings to the bridge can pick it up and work from there.
>
> Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> ChangeLog v4->v5:
> - Rewrite the support using the new concept of defining
> fine-granular sampling (setup+hold) timing definitions
> stored in the bridge timings struct.
> ChangeLog v3->v4:
> - Actually have the code syntactically correct and compiling :(
> (Kconfig mistake.)
> (...)
> AS usr/initramfs_data.o
> AR usr/built-in.o
> CC drivers/gpu/drm/bridge/dumb-vga-dac.o
> AR drivers/gpu/drm/bridge/built-in.o
> AR drivers/gpu/drm/built-in.o
> AR drivers/gpu/built-in.o
> AR drivers/built-in.o
> (...)
> ChangeLog v2->v3:
> - Move const specifier.
> - Cut one line of code assigning bus flags.
> - Preserve the "ti,ths8135" compatible for elder device trees.
> ChangeLog v1->v2:
> - Alphabetize includes
> - Use a u32 with the bus polarity flags and just encode the
> polarity using the DRM define directly.
> - Rename vendor_data to vendor_info.
> - Simplify assignment of the flag as it is just a simple
> u32 now.
> - Probe all TI variants on the "ti,ths813x" wildcard for now,
> we only need to know that the device is in this family to
> set the clock edge flag right.
> ---
> drivers/gpu/drm/bridge/dumb-vga-dac.c | 61 ++++++++++++++++++++++++++++++--
> 1 file changed, 58 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/dumb-vga-dac.c
> b/drivers/gpu/drm/bridge/dumb-vga-dac.c index de5e7dee7ad6..34788783a90f
> 100644
> --- a/drivers/gpu/drm/bridge/dumb-vga-dac.c
> +++ b/drivers/gpu/drm/bridge/dumb-vga-dac.c
> @@ -11,6 +11,7 @@
> */
>
> #include <linux/module.h>
> +#include <linux/of_device.h>
> #include <linux/of_graph.h>
> #include <linux/regulator/consumer.h>
>
> @@ -176,11 +177,13 @@ static struct i2c_adapter
> *dumb_vga_retrieve_ddc(struct device *dev) static int dumb_vga_probe(struct
> platform_device *pdev)
> {
> struct dumb_vga *vga;
> + const struct drm_bridge_timings *timings;
>
> vga = devm_kzalloc(&pdev->dev, sizeof(*vga), GFP_KERNEL);
> if (!vga)
> return -ENOMEM;
> platform_set_drvdata(pdev, vga);
> + timings = of_device_get_match_data(&pdev->dev);
>
> vga->vdd = devm_regulator_get_optional(&pdev->dev, "vdd");
> if (IS_ERR(vga->vdd)) {
> @@ -204,6 +207,7 @@ static int dumb_vga_probe(struct platform_device *pdev)
>
> vga->bridge.funcs = &dumb_vga_bridge_funcs;
> vga->bridge.of_node = pdev->dev.of_node;
> + vga->bridge.timings = timings;
Do you need the intermediate timings variable ?
> drm_bridge_add(&vga->bridge);
>
> @@ -222,10 +226,61 @@ static int dumb_vga_remove(struct platform_device
> *pdev) return 0;
> }
>
> +/*
> + * We assume the ADV7123 DAC is the "default" for historical reasons
> + * Information taken from the ADV7123 datasheet, revision D.
> + * NOTE: the ADV7123EP seems to have other timings and need a new timings
> + * set if used.
> + */
> +static const struct drm_bridge_timings default_dac_timings = {
> + /* Timing specifications, datasheet page 7 */
> + .sampling_edge = true,
> + .setup_time_ps = 500,
> + .hold_time_ps = 1500,
> +};
You know what's lovely ? The setup time depends on the power supply voltage
:-) Let's use 500ps for now, that's a conservative value that will work for
both 5V and 3.3V. If anyone needs to lower it to 200ps later, they can always
implement support for voltage-dependent timings.
> +/*
> + * Information taken from the THS8134, THS8134A, THS8134B datasheet named
> + * "SLVS205D", dated May 1990, revised March 2000.
> + */
> +static const struct drm_bridge_timings ti_ths8134_dac_timings = {
> + /* From timing diagram, datasheet page 9 */
> + .sampling_edge = true,
> + /* From datasheet, page 12 */
> + .setup_time_ps = 3000,
> + /* I guess this means latched input */
> + .hold_time_ps = 0,
> +};
> +
> +/*
> + * Information taken from the THS8135 datasheet named "SLAS343B", dated
> + * May 2001, revised April 2013.
> + */
> +static const struct drm_bridge_timings ti_ths8135_dac_timings = {
> + /* From timing diagram, datasheet page 14 */
> + .sampling_edge = true,
> + /* From datasheet, page 16 */
> + .setup_time_ps = 2000,
> + .hold_time_ps = 500,
> +};
> +
> static const struct of_device_id dumb_vga_match[] = {
> - { .compatible = "dumb-vga-dac" },
> - { .compatible = "adi,adv7123" },
> - { .compatible = "ti,ths8135" },
> + {
> + .compatible = "dumb-vga-dac",
> + .data = &default_dac_timings,
Shouldn't we leave this NULL for dumb VGA DACs ? They're made of passive
components and don't sample the signal, so there's no real timings that we can
report.
Apart from that,
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> + },
> + {
> + .compatible = "adi,adv7123",
> + .data = &default_dac_timings,
> + },
> + {
> + .compatible = "ti,ths8135",
> + .data = &ti_ths8135_dac_timings,
> + },
> + {
> + .compatible = "ti,ths8134",
> + .data = &ti_ths8134_dac_timings,
> + },
> {},
> };
> MODULE_DEVICE_TABLE(of, dumb_vga_match);
--
Regards,
Laurent Pinchart
WARNING: multiple messages have this Message-ID (diff)
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>,
dri-devel@lists.freedesktop.org,
Bartosz Golaszewski <bgolaszewski@baylibre.com>,
Maxime Ripard <maxime.ripard@free-electrons.com>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 3/4 v5] drm/bridge: Add timing support to dumb VGA DAC
Date: Mon, 18 Dec 2017 12:51:11 +0200 [thread overview]
Message-ID: <2062807.LCImKMf1yA@avalon> (raw)
In-Reply-To: <20171215121047.3650-4-linus.walleij@linaro.org>
Hi Linus,
Thank you for the patch.
On Friday, 15 December 2017 14:10:46 EET Linus Walleij wrote:
> This extends the dumb VGA DAC bridge to handle the THS8134A
> and THS8134B VGA DACs in addition to those already handled.
>
> We assign the proper timing data to the pointer inside the
> bridge struct so display controllers that need to align their
> timings to the bridge can pick it up and work from there.
>
> Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> ChangeLog v4->v5:
> - Rewrite the support using the new concept of defining
> fine-granular sampling (setup+hold) timing definitions
> stored in the bridge timings struct.
> ChangeLog v3->v4:
> - Actually have the code syntactically correct and compiling :(
> (Kconfig mistake.)
> (...)
> AS usr/initramfs_data.o
> AR usr/built-in.o
> CC drivers/gpu/drm/bridge/dumb-vga-dac.o
> AR drivers/gpu/drm/bridge/built-in.o
> AR drivers/gpu/drm/built-in.o
> AR drivers/gpu/built-in.o
> AR drivers/built-in.o
> (...)
> ChangeLog v2->v3:
> - Move const specifier.
> - Cut one line of code assigning bus flags.
> - Preserve the "ti,ths8135" compatible for elder device trees.
> ChangeLog v1->v2:
> - Alphabetize includes
> - Use a u32 with the bus polarity flags and just encode the
> polarity using the DRM define directly.
> - Rename vendor_data to vendor_info.
> - Simplify assignment of the flag as it is just a simple
> u32 now.
> - Probe all TI variants on the "ti,ths813x" wildcard for now,
> we only need to know that the device is in this family to
> set the clock edge flag right.
> ---
> drivers/gpu/drm/bridge/dumb-vga-dac.c | 61 ++++++++++++++++++++++++++++++--
> 1 file changed, 58 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/dumb-vga-dac.c
> b/drivers/gpu/drm/bridge/dumb-vga-dac.c index de5e7dee7ad6..34788783a90f
> 100644
> --- a/drivers/gpu/drm/bridge/dumb-vga-dac.c
> +++ b/drivers/gpu/drm/bridge/dumb-vga-dac.c
> @@ -11,6 +11,7 @@
> */
>
> #include <linux/module.h>
> +#include <linux/of_device.h>
> #include <linux/of_graph.h>
> #include <linux/regulator/consumer.h>
>
> @@ -176,11 +177,13 @@ static struct i2c_adapter
> *dumb_vga_retrieve_ddc(struct device *dev) static int dumb_vga_probe(struct
> platform_device *pdev)
> {
> struct dumb_vga *vga;
> + const struct drm_bridge_timings *timings;
>
> vga = devm_kzalloc(&pdev->dev, sizeof(*vga), GFP_KERNEL);
> if (!vga)
> return -ENOMEM;
> platform_set_drvdata(pdev, vga);
> + timings = of_device_get_match_data(&pdev->dev);
>
> vga->vdd = devm_regulator_get_optional(&pdev->dev, "vdd");
> if (IS_ERR(vga->vdd)) {
> @@ -204,6 +207,7 @@ static int dumb_vga_probe(struct platform_device *pdev)
>
> vga->bridge.funcs = &dumb_vga_bridge_funcs;
> vga->bridge.of_node = pdev->dev.of_node;
> + vga->bridge.timings = timings;
Do you need the intermediate timings variable ?
> drm_bridge_add(&vga->bridge);
>
> @@ -222,10 +226,61 @@ static int dumb_vga_remove(struct platform_device
> *pdev) return 0;
> }
>
> +/*
> + * We assume the ADV7123 DAC is the "default" for historical reasons
> + * Information taken from the ADV7123 datasheet, revision D.
> + * NOTE: the ADV7123EP seems to have other timings and need a new timings
> + * set if used.
> + */
> +static const struct drm_bridge_timings default_dac_timings = {
> + /* Timing specifications, datasheet page 7 */
> + .sampling_edge = true,
> + .setup_time_ps = 500,
> + .hold_time_ps = 1500,
> +};
You know what's lovely ? The setup time depends on the power supply voltage
:-) Let's use 500ps for now, that's a conservative value that will work for
both 5V and 3.3V. If anyone needs to lower it to 200ps later, they can always
implement support for voltage-dependent timings.
> +/*
> + * Information taken from the THS8134, THS8134A, THS8134B datasheet named
> + * "SLVS205D", dated May 1990, revised March 2000.
> + */
> +static const struct drm_bridge_timings ti_ths8134_dac_timings = {
> + /* From timing diagram, datasheet page 9 */
> + .sampling_edge = true,
> + /* From datasheet, page 12 */
> + .setup_time_ps = 3000,
> + /* I guess this means latched input */
> + .hold_time_ps = 0,
> +};
> +
> +/*
> + * Information taken from the THS8135 datasheet named "SLAS343B", dated
> + * May 2001, revised April 2013.
> + */
> +static const struct drm_bridge_timings ti_ths8135_dac_timings = {
> + /* From timing diagram, datasheet page 14 */
> + .sampling_edge = true,
> + /* From datasheet, page 16 */
> + .setup_time_ps = 2000,
> + .hold_time_ps = 500,
> +};
> +
> static const struct of_device_id dumb_vga_match[] = {
> - { .compatible = "dumb-vga-dac" },
> - { .compatible = "adi,adv7123" },
> - { .compatible = "ti,ths8135" },
> + {
> + .compatible = "dumb-vga-dac",
> + .data = &default_dac_timings,
Shouldn't we leave this NULL for dumb VGA DACs ? They're made of passive
components and don't sample the signal, so there's no real timings that we can
report.
Apart from that,
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> + },
> + {
> + .compatible = "adi,adv7123",
> + .data = &default_dac_timings,
> + },
> + {
> + .compatible = "ti,ths8135",
> + .data = &ti_ths8135_dac_timings,
> + },
> + {
> + .compatible = "ti,ths8134",
> + .data = &ti_ths8134_dac_timings,
> + },
> {},
> };
> MODULE_DEVICE_TABLE(of, dumb_vga_match);
--
Regards,
Laurent Pinchart
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2017-12-18 10:51 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-12-15 12:10 [PATCH 0/4 v5] Support bridge timings Linus Walleij
2017-12-15 12:10 ` Linus Walleij
2017-12-15 12:10 ` [PATCH 1/4 v5] drm/bridge: Add bindings for TI THS8134 Linus Walleij
2017-12-15 12:10 ` Linus Walleij
2017-12-16 18:23 ` Rob Herring
2017-12-16 18:23 ` Rob Herring
2017-12-18 8:46 ` Laurent Pinchart
2017-12-18 8:46 ` Laurent Pinchart
2017-12-15 12:10 ` [PATCH 2/4 v5] drm/bridge: Provide a way to embed timing info in bridges Linus Walleij
2017-12-15 12:10 ` Linus Walleij
2017-12-18 8:51 ` Laurent Pinchart
2017-12-18 8:51 ` Laurent Pinchart
2017-12-15 12:10 ` [PATCH 3/4 v5] drm/bridge: Add timing support to dumb VGA DAC Linus Walleij
2017-12-15 12:10 ` Linus Walleij
2017-12-18 10:51 ` Laurent Pinchart [this message]
2017-12-18 10:51 ` Laurent Pinchart
2017-12-15 12:10 ` [PATCH 4/4 v5] drm/pl111: Support handling bridge timings Linus Walleij
2017-12-15 12:10 ` Linus Walleij
2017-12-18 10:53 ` Laurent Pinchart
2017-12-18 10:53 ` Laurent Pinchart
2017-12-15 12:30 ` [PATCH 0/4 v5] Support " Linus Walleij
2017-12-15 12:30 ` Linus Walleij
2017-12-15 15:54 ` Daniel Vetter
2017-12-15 15:54 ` Daniel Vetter
2017-12-18 8:43 ` Andrzej Hajda
2017-12-18 8:43 ` Andrzej Hajda
2017-12-18 11:10 ` Laurent Pinchart
2017-12-18 11:10 ` Laurent Pinchart
2017-12-18 11:01 ` Laurent Pinchart
2017-12-18 11:01 ` Laurent Pinchart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2062807.LCImKMf1yA@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.