* [PATCH v5 0/2] Basic support for TI TDP158
@ 2024-08-12 14:51 Marc Gonzalez
2024-08-12 14:51 ` [PATCH v5 1/2] dt-bindings: display: bridge: add " Marc Gonzalez
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Marc Gonzalez @ 2024-08-12 14:51 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Daniel Vetter, Liam Girdwood,
Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: dri-devel, devicetree, linux-arm-msm, Arnaud Vrac,
Pierre-Hugues Husson, Dmitry Baryshkov, Konrad Dybcio,
Marc Gonzalez
TDP158 is an AC-coupled DVI / HDMI to TMDS level shifting Redriver.
Like the TFP410, the TDP158 can be set up in 2 different ways:
1) hard-coding its configuration settings using pin-strapping resistors
2) placing it on an I2C bus, and defer set-up until run-time
The mode is selected by pin 8 = I2C_EN
I2C_EN = 1 ==> I2C Control Mode
I2C_EN = 0 ==> Pin Strap Mode
On our board, I2C_EN is pulled high (hard-wired).
---
Changes in v5:
- Add BSD-2-Clause option in YAML binding (Rob) + add Rob's tag
- Link to v4: https://lore.kernel.org/r/20240730-tdp158-v4-0-da69001bdea2@freebox.fr
Changes in v4:
- Rebase series on top of v6.11-rc1
- Add blurb about I2C vs pin strap mode in cover letter
- Add blurb about I2C vs pin strap mode in binding commit message
- Add blurb about I2C mode in driver commit message
- Add comment in binding explaining when reg is required
- Add comment in binding describing Operation Enable / Reset Pin
- Link to v3: https://lore.kernel.org/r/20240627-tdp158-v3-0-fb2fbc808346@freebox.fr
Changes in v3:
- Add 'select DRM_PANEL_BRIDGE' in driver Kconfig
- Fix checkpatch errors
- log errors using dev_err (so save dev pointer)
- expand a few error messages
- expand commit messages with info from the datasheet
- mark regulators as required in the DT binding
- Link to v2: https://lore.kernel.org/r/20240625-tdp158-v2-0-a3b344707fa7@freebox.fr
Changes in v2:
- Don't overload simple-bridge, spin new minimal driver
- New driver, new binding
- Default device settings work fine for us, so we don't tweak registers
- Link to v1: https://lore.kernel.org/r/20240617-tdp158-v1-0-df98ef7dec6d@freebox.fr
- Link to v0b: https://lore.kernel.org/r/b41f2f86-0d99-4199-92a9-42cbb9d6a6d5@freebox.fr/
- Link to v0a: https://lore.kernel.org/r/d3de652f-ce89-4f57-b900-07b11f8bf8f9@free.fr/
---
Marc Gonzalez (2):
dt-bindings: display: bridge: add TI TDP158
drm/bridge: add support for TI TDP158
.../bindings/display/bridge/ti,tdp158.yaml | 57 +++++++++++
drivers/gpu/drm/bridge/Kconfig | 7 ++
drivers/gpu/drm/bridge/Makefile | 1 +
drivers/gpu/drm/bridge/ti-tdp158.c | 108 +++++++++++++++++++++
4 files changed, 173 insertions(+)
---
base-commit: c6072668fcfb13295b600747dbd89f00da1a4ed9
change-id: 20240617-tdp158-418200d6cc0b
Best regards,
--
Marc Gonzalez <mgonzalez@freebox.fr>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH v5 1/2] dt-bindings: display: bridge: add TI TDP158
2024-08-12 14:51 [PATCH v5 0/2] Basic support for TI TDP158 Marc Gonzalez
@ 2024-08-12 14:51 ` Marc Gonzalez
2024-08-12 14:51 ` [PATCH v5 2/2] drm/bridge: add support for " Marc Gonzalez
2024-09-03 12:40 ` [PATCH v5 0/2] Basic " Robert Foss
2 siblings, 0 replies; 10+ messages in thread
From: Marc Gonzalez @ 2024-08-12 14:51 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Daniel Vetter, Liam Girdwood,
Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: dri-devel, devicetree, linux-arm-msm, Arnaud Vrac,
Pierre-Hugues Husson, Dmitry Baryshkov, Konrad Dybcio,
Marc Gonzalez
TDP158 is an AC-coupled DVI / HDMI to TMDS level shifting Redriver.
It supports DVI 1.0, HDMI 1.4b and 2.0b.
It supports 4 TMDS channels, HPD, and a DDC interface.
It supports dual power supply rails (1.1V on VDD, 3.3V on VCC)
for power reduction. Several methods of power management are
implemented to reduce overall power consumption.
It supports fixed receiver EQ gain using I2C or pin strap to
compensate for different lengths input cable or board traces.
Features
- AC-coupled TMDS or DisplayPort dual-mode physical layer input
to HDMI 2.0b TMDS physical layer output supporting up to 6Gbps
data rate, compatible with HDMI 2.0b electrical parameters
- DisplayPort dual-mode standard version 1.1
- Programmable fixed receiver equalizer up to 15.5dB
- Global or independent high speed lane control, pre-emphasis
and transmit swing, and slew rate control
- I2C or pin strap programmable
- Configurable as a DisplayPort redriver through I2C
- Full lane swap on main lanes
- Low power consumption (200 mW at 6Gbps, 8 mW in shutdown)
https://www.ti.com/lit/ds/symlink/tdp158.pdf
Like the TFP410, the TDP158 can be set up in 2 different ways:
1) hard-coding its configuration settings using pin-strapping resistors
2) placing it on an I2C bus, and defer set-up until run-time
The mode is selected via pin 8 = I2C_EN
I2C_EN high = I2C Control Mode
I2C_EN low = Pin Strap Mode
On our board, I2C_EN is pulled high.
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Marc Gonzalez <mgonzalez@freebox.fr>
---
.../bindings/display/bridge/ti,tdp158.yaml | 57 ++++++++++++++++++++++
1 file changed, 57 insertions(+)
diff --git a/Documentation/devicetree/bindings/display/bridge/ti,tdp158.yaml b/Documentation/devicetree/bindings/display/bridge/ti,tdp158.yaml
new file mode 100644
index 0000000000000..1c522f72c4bae
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/bridge/ti,tdp158.yaml
@@ -0,0 +1,57 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/bridge/ti,tdp158.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: TI TDP158 HDMI to TMDS Redriver
+
+maintainers:
+ - Arnaud Vrac <avrac@freebox.fr>
+ - Pierre-Hugues Husson <phhusson@freebox.fr>
+
+properties:
+ compatible:
+ const: ti,tdp158
+
+# The reg property is required if and only if the device is connected
+# to an I2C bus. In pin strap mode, reg must not be specified.
+ reg:
+ description: I2C address of the device
+
+# Pin 36 = Operation Enable / Reset Pin
+# OE = L: Power Down Mode
+# OE = H: Normal Operation
+# Internal weak pullup - device resets on H to L transitions
+ enable-gpios:
+ description: GPIO controlling bridge enable
+
+ vcc-supply:
+ description: Power supply 3.3V
+
+ vdd-supply:
+ description: Power supply 1.1V
+
+ ports:
+ $ref: /schemas/graph.yaml#/properties/ports
+
+ properties:
+ port@0:
+ $ref: /schemas/graph.yaml#/properties/port
+ description: Bridge input
+
+ port@1:
+ $ref: /schemas/graph.yaml#/properties/port
+ description: Bridge output
+
+ required:
+ - port@0
+ - port@1
+
+required:
+ - compatible
+ - vcc-supply
+ - vdd-supply
+ - ports
+
+additionalProperties: false
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH v5 2/2] drm/bridge: add support for TI TDP158
2024-08-12 14:51 [PATCH v5 0/2] Basic support for TI TDP158 Marc Gonzalez
2024-08-12 14:51 ` [PATCH v5 1/2] dt-bindings: display: bridge: add " Marc Gonzalez
@ 2024-08-12 14:51 ` Marc Gonzalez
2024-08-27 13:39 ` Robert Foss
2024-09-03 12:40 ` [PATCH v5 0/2] Basic " Robert Foss
2 siblings, 1 reply; 10+ messages in thread
From: Marc Gonzalez @ 2024-08-12 14:51 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Robert Foss, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Daniel Vetter, Liam Girdwood,
Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley
Cc: dri-devel, devicetree, linux-arm-msm, Arnaud Vrac,
Pierre-Hugues Husson, Dmitry Baryshkov, Konrad Dybcio,
Marc Gonzalez
TDP158 is an AC-coupled DVI / HDMI to TMDS level shifting Redriver.
It supports DVI 1.0, HDMI 1.4b and 2.0b.
It supports 4 TMDS channels, HPD, and a DDC interface.
It supports dual power supply rails (1.1V on VDD, 3.3V on VCC)
for power reduction. Several methods of power management are
implemented to reduce overall power consumption.
It supports fixed receiver EQ gain using I2C or pin strap to
compensate for different lengths input cable or board traces.
Features
- AC-coupled TMDS or DisplayPort dual-mode physical layer input
to HDMI 2.0b TMDS physical layer output supporting up to 6Gbps
data rate, compatible with HDMI 2.0b electrical parameters
- DisplayPort dual-mode standard version 1.1
- Programmable fixed receiver equalizer up to 15.5dB
- Global or independent high speed lane control, pre-emphasis
and transmit swing, and slew rate control
- I2C or pin strap programmable
- Configurable as a DisplayPort redriver through I2C
- Full lane swap on main lanes
- Low power consumption (200 mW at 6Gbps, 8 mW in shutdown)
https://www.ti.com/lit/ds/symlink/tdp158.pdf
On our board, I2C_EN is pulled high.
Thus, this code defines a module_i2c_driver.
The default settings work fine for our use-case.
So this basic driver doesn't need to tweak any I2C registers.
Signed-off-by: Marc Gonzalez <mgonzalez@freebox.fr>
---
drivers/gpu/drm/bridge/Kconfig | 7 +++
drivers/gpu/drm/bridge/Makefile | 1 +
drivers/gpu/drm/bridge/ti-tdp158.c | 108 +++++++++++++++++++++++++++++++++++++
3 files changed, 116 insertions(+)
diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig
index c621be1a99a89..c0ab5b620b57d 100644
--- a/drivers/gpu/drm/bridge/Kconfig
+++ b/drivers/gpu/drm/bridge/Kconfig
@@ -368,6 +368,13 @@ config DRM_TI_DLPC3433
It supports up to 720p resolution with 60 and 120 Hz refresh
rates.
+config DRM_TI_TDP158
+ tristate "TI TDP158 HDMI/TMDS bridge"
+ depends on OF
+ select DRM_PANEL_BRIDGE
+ help
+ Texas Instruments TDP158 HDMI/TMDS Bridge driver
+
config DRM_TI_TFP410
tristate "TI TFP410 DVI/HDMI bridge"
depends on OF
diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile
index 7df87b582dca3..3daf803ce80b6 100644
--- a/drivers/gpu/drm/bridge/Makefile
+++ b/drivers/gpu/drm/bridge/Makefile
@@ -32,6 +32,7 @@ obj-$(CONFIG_DRM_I2C_ADV7511) += adv7511/
obj-$(CONFIG_DRM_TI_DLPC3433) += ti-dlpc3433.o
obj-$(CONFIG_DRM_TI_SN65DSI83) += ti-sn65dsi83.o
obj-$(CONFIG_DRM_TI_SN65DSI86) += ti-sn65dsi86.o
+obj-$(CONFIG_DRM_TI_TDP158) += ti-tdp158.o
obj-$(CONFIG_DRM_TI_TFP410) += ti-tfp410.o
obj-$(CONFIG_DRM_TI_TPD12S015) += ti-tpd12s015.o
obj-$(CONFIG_DRM_NWL_MIPI_DSI) += nwl-dsi.o
diff --git a/drivers/gpu/drm/bridge/ti-tdp158.c b/drivers/gpu/drm/bridge/ti-tdp158.c
new file mode 100644
index 0000000000000..4ee0ad29874de
--- /dev/null
+++ b/drivers/gpu/drm/bridge/ti-tdp158.c
@@ -0,0 +1,108 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright 2024 Freebox SAS
+ */
+#include <drm/drm_bridge.h>
+#include <drm/drm_atomic_helper.h>
+#include <linux/i2c.h>
+
+struct tdp158 {
+ struct drm_bridge bridge;
+ struct drm_bridge *next;
+ struct gpio_desc *enable; // Operation Enable - pin 36
+ struct regulator *vcc; // 3.3V
+ struct regulator *vdd; // 1.1V
+ struct device *dev;
+};
+
+static void tdp158_enable(struct drm_bridge *bridge, struct drm_bridge_state *prev)
+{
+ int err;
+ struct tdp158 *tdp158 = bridge->driver_private;
+
+ err = regulator_enable(tdp158->vcc);
+ if (err)
+ dev_err(tdp158->dev, "failed to enable vcc: %d", err);
+
+ err = regulator_enable(tdp158->vdd);
+ if (err)
+ dev_err(tdp158->dev, "failed to enable vdd: %d", err);
+
+ gpiod_set_value_cansleep(tdp158->enable, 1);
+}
+
+static void tdp158_disable(struct drm_bridge *bridge, struct drm_bridge_state *prev)
+{
+ struct tdp158 *tdp158 = bridge->driver_private;
+
+ gpiod_set_value_cansleep(tdp158->enable, 0);
+ regulator_disable(tdp158->vdd);
+ regulator_disable(tdp158->vcc);
+}
+
+static int tdp158_attach(struct drm_bridge *bridge, enum drm_bridge_attach_flags flags)
+{
+ struct tdp158 *tdp158 = bridge->driver_private;
+
+ return drm_bridge_attach(bridge->encoder, tdp158->next, bridge, flags);
+}
+
+static const struct drm_bridge_funcs tdp158_bridge_funcs = {
+ .attach = tdp158_attach,
+ .atomic_enable = tdp158_enable,
+ .atomic_disable = tdp158_disable,
+ .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
+ .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
+ .atomic_reset = drm_atomic_helper_bridge_reset,
+};
+
+static int tdp158_probe(struct i2c_client *client)
+{
+ struct tdp158 *tdp158;
+ struct device *dev = &client->dev;
+
+ tdp158 = devm_kzalloc(dev, sizeof(*tdp158), GFP_KERNEL);
+ if (!tdp158)
+ return -ENOMEM;
+
+ tdp158->next = devm_drm_of_get_bridge(dev, dev->of_node, 1, 0);
+ if (IS_ERR(tdp158->next))
+ return dev_err_probe(dev, PTR_ERR(tdp158->next), "missing bridge");
+
+ tdp158->vcc = devm_regulator_get(dev, "vcc");
+ if (IS_ERR(tdp158->vcc))
+ return dev_err_probe(dev, PTR_ERR(tdp158->vcc), "vcc");
+
+ tdp158->vdd = devm_regulator_get(dev, "vdd");
+ if (IS_ERR(tdp158->vdd))
+ return dev_err_probe(dev, PTR_ERR(tdp158->vdd), "vdd");
+
+ tdp158->enable = devm_gpiod_get_optional(dev, "enable", GPIOD_OUT_LOW);
+ if (IS_ERR(tdp158->enable))
+ return dev_err_probe(dev, PTR_ERR(tdp158->enable), "enable");
+
+ tdp158->bridge.of_node = dev->of_node;
+ tdp158->bridge.funcs = &tdp158_bridge_funcs;
+ tdp158->bridge.driver_private = tdp158;
+ tdp158->dev = dev;
+
+ return devm_drm_bridge_add(dev, &tdp158->bridge);
+}
+
+static const struct of_device_id tdp158_match_table[] = {
+ { .compatible = "ti,tdp158" },
+ { }
+};
+MODULE_DEVICE_TABLE(of, tdp158_match_table);
+
+static struct i2c_driver tdp158_driver = {
+ .probe = tdp158_probe,
+ .driver = {
+ .name = "tdp158",
+ .of_match_table = tdp158_match_table,
+ },
+};
+module_i2c_driver(tdp158_driver);
+
+MODULE_DESCRIPTION("TI TDP158 driver");
+MODULE_LICENSE("GPL");
--
2.34.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH v5 2/2] drm/bridge: add support for TI TDP158
2024-08-12 14:51 ` [PATCH v5 2/2] drm/bridge: add support for " Marc Gonzalez
@ 2024-08-27 13:39 ` Robert Foss
0 siblings, 0 replies; 10+ messages in thread
From: Robert Foss @ 2024-08-27 13:39 UTC (permalink / raw)
To: Marc Gonzalez
Cc: Andrzej Hajda, Neil Armstrong, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Daniel Vetter, Liam Girdwood,
Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
dri-devel, devicetree, linux-arm-msm, Arnaud Vrac,
Pierre-Hugues Husson, Dmitry Baryshkov, Konrad Dybcio
On Mon, Aug 12, 2024 at 4:51 PM Marc Gonzalez <mgonzalez@freebox.fr> wrote:
>
> TDP158 is an AC-coupled DVI / HDMI to TMDS level shifting Redriver.
> It supports DVI 1.0, HDMI 1.4b and 2.0b.
> It supports 4 TMDS channels, HPD, and a DDC interface.
> It supports dual power supply rails (1.1V on VDD, 3.3V on VCC)
> for power reduction. Several methods of power management are
> implemented to reduce overall power consumption.
> It supports fixed receiver EQ gain using I2C or pin strap to
> compensate for different lengths input cable or board traces.
>
> Features
>
> - AC-coupled TMDS or DisplayPort dual-mode physical layer input
> to HDMI 2.0b TMDS physical layer output supporting up to 6Gbps
> data rate, compatible with HDMI 2.0b electrical parameters
> - DisplayPort dual-mode standard version 1.1
> - Programmable fixed receiver equalizer up to 15.5dB
> - Global or independent high speed lane control, pre-emphasis
> and transmit swing, and slew rate control
> - I2C or pin strap programmable
> - Configurable as a DisplayPort redriver through I2C
> - Full lane swap on main lanes
> - Low power consumption (200 mW at 6Gbps, 8 mW in shutdown)
>
> https://www.ti.com/lit/ds/symlink/tdp158.pdf
>
> On our board, I2C_EN is pulled high.
> Thus, this code defines a module_i2c_driver.
>
> The default settings work fine for our use-case.
> So this basic driver doesn't need to tweak any I2C registers.
>
> Signed-off-by: Marc Gonzalez <mgonzalez@freebox.fr>
> ---
> drivers/gpu/drm/bridge/Kconfig | 7 +++
> drivers/gpu/drm/bridge/Makefile | 1 +
> drivers/gpu/drm/bridge/ti-tdp158.c | 108 +++++++++++++++++++++++++++++++++++++
> 3 files changed, 116 insertions(+)
>
> diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig
> index c621be1a99a89..c0ab5b620b57d 100644
> --- a/drivers/gpu/drm/bridge/Kconfig
> +++ b/drivers/gpu/drm/bridge/Kconfig
> @@ -368,6 +368,13 @@ config DRM_TI_DLPC3433
> It supports up to 720p resolution with 60 and 120 Hz refresh
> rates.
>
> +config DRM_TI_TDP158
> + tristate "TI TDP158 HDMI/TMDS bridge"
> + depends on OF
> + select DRM_PANEL_BRIDGE
> + help
> + Texas Instruments TDP158 HDMI/TMDS Bridge driver
> +
> config DRM_TI_TFP410
> tristate "TI TFP410 DVI/HDMI bridge"
> depends on OF
> diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile
> index 7df87b582dca3..3daf803ce80b6 100644
> --- a/drivers/gpu/drm/bridge/Makefile
> +++ b/drivers/gpu/drm/bridge/Makefile
> @@ -32,6 +32,7 @@ obj-$(CONFIG_DRM_I2C_ADV7511) += adv7511/
> obj-$(CONFIG_DRM_TI_DLPC3433) += ti-dlpc3433.o
> obj-$(CONFIG_DRM_TI_SN65DSI83) += ti-sn65dsi83.o
> obj-$(CONFIG_DRM_TI_SN65DSI86) += ti-sn65dsi86.o
> +obj-$(CONFIG_DRM_TI_TDP158) += ti-tdp158.o
> obj-$(CONFIG_DRM_TI_TFP410) += ti-tfp410.o
> obj-$(CONFIG_DRM_TI_TPD12S015) += ti-tpd12s015.o
> obj-$(CONFIG_DRM_NWL_MIPI_DSI) += nwl-dsi.o
> diff --git a/drivers/gpu/drm/bridge/ti-tdp158.c b/drivers/gpu/drm/bridge/ti-tdp158.c
> new file mode 100644
> index 0000000000000..4ee0ad29874de
> --- /dev/null
> +++ b/drivers/gpu/drm/bridge/ti-tdp158.c
> @@ -0,0 +1,108 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Copyright 2024 Freebox SAS
> + */
> +#include <drm/drm_bridge.h>
> +#include <drm/drm_atomic_helper.h>
> +#include <linux/i2c.h>
> +
> +struct tdp158 {
> + struct drm_bridge bridge;
> + struct drm_bridge *next;
> + struct gpio_desc *enable; // Operation Enable - pin 36
> + struct regulator *vcc; // 3.3V
> + struct regulator *vdd; // 1.1V
> + struct device *dev;
> +};
> +
> +static void tdp158_enable(struct drm_bridge *bridge, struct drm_bridge_state *prev)
> +{
> + int err;
> + struct tdp158 *tdp158 = bridge->driver_private;
> +
> + err = regulator_enable(tdp158->vcc);
> + if (err)
> + dev_err(tdp158->dev, "failed to enable vcc: %d", err);
> +
> + err = regulator_enable(tdp158->vdd);
> + if (err)
> + dev_err(tdp158->dev, "failed to enable vdd: %d", err);
> +
> + gpiod_set_value_cansleep(tdp158->enable, 1);
> +}
> +
> +static void tdp158_disable(struct drm_bridge *bridge, struct drm_bridge_state *prev)
> +{
> + struct tdp158 *tdp158 = bridge->driver_private;
> +
> + gpiod_set_value_cansleep(tdp158->enable, 0);
> + regulator_disable(tdp158->vdd);
> + regulator_disable(tdp158->vcc);
> +}
> +
> +static int tdp158_attach(struct drm_bridge *bridge, enum drm_bridge_attach_flags flags)
> +{
> + struct tdp158 *tdp158 = bridge->driver_private;
> +
> + return drm_bridge_attach(bridge->encoder, tdp158->next, bridge, flags);
> +}
> +
> +static const struct drm_bridge_funcs tdp158_bridge_funcs = {
> + .attach = tdp158_attach,
> + .atomic_enable = tdp158_enable,
> + .atomic_disable = tdp158_disable,
> + .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state,
> + .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state,
> + .atomic_reset = drm_atomic_helper_bridge_reset,
> +};
> +
> +static int tdp158_probe(struct i2c_client *client)
> +{
> + struct tdp158 *tdp158;
> + struct device *dev = &client->dev;
> +
> + tdp158 = devm_kzalloc(dev, sizeof(*tdp158), GFP_KERNEL);
> + if (!tdp158)
> + return -ENOMEM;
> +
> + tdp158->next = devm_drm_of_get_bridge(dev, dev->of_node, 1, 0);
> + if (IS_ERR(tdp158->next))
> + return dev_err_probe(dev, PTR_ERR(tdp158->next), "missing bridge");
> +
> + tdp158->vcc = devm_regulator_get(dev, "vcc");
> + if (IS_ERR(tdp158->vcc))
> + return dev_err_probe(dev, PTR_ERR(tdp158->vcc), "vcc");
> +
> + tdp158->vdd = devm_regulator_get(dev, "vdd");
> + if (IS_ERR(tdp158->vdd))
> + return dev_err_probe(dev, PTR_ERR(tdp158->vdd), "vdd");
> +
> + tdp158->enable = devm_gpiod_get_optional(dev, "enable", GPIOD_OUT_LOW);
> + if (IS_ERR(tdp158->enable))
> + return dev_err_probe(dev, PTR_ERR(tdp158->enable), "enable");
> +
> + tdp158->bridge.of_node = dev->of_node;
> + tdp158->bridge.funcs = &tdp158_bridge_funcs;
> + tdp158->bridge.driver_private = tdp158;
> + tdp158->dev = dev;
> +
> + return devm_drm_bridge_add(dev, &tdp158->bridge);
> +}
> +
> +static const struct of_device_id tdp158_match_table[] = {
> + { .compatible = "ti,tdp158" },
> + { }
> +};
> +MODULE_DEVICE_TABLE(of, tdp158_match_table);
> +
> +static struct i2c_driver tdp158_driver = {
> + .probe = tdp158_probe,
> + .driver = {
> + .name = "tdp158",
> + .of_match_table = tdp158_match_table,
> + },
> +};
> +module_i2c_driver(tdp158_driver);
> +
> +MODULE_DESCRIPTION("TI TDP158 driver");
> +MODULE_LICENSE("GPL");
>
> --
> 2.34.1
>
Reviewed-by: Robert Foss <rfoss@kernel.org>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v5 0/2] Basic support for TI TDP158
2024-08-12 14:51 [PATCH v5 0/2] Basic support for TI TDP158 Marc Gonzalez
2024-08-12 14:51 ` [PATCH v5 1/2] dt-bindings: display: bridge: add " Marc Gonzalez
2024-08-12 14:51 ` [PATCH v5 2/2] drm/bridge: add support for " Marc Gonzalez
@ 2024-09-03 12:40 ` Robert Foss
2024-09-03 15:30 ` Jani Nikula
2024-10-07 14:33 ` Marc Gonzalez
2 siblings, 2 replies; 10+ messages in thread
From: Robert Foss @ 2024-09-03 12:40 UTC (permalink / raw)
To: Andrzej Hajda, Neil Armstrong, Laurent Pinchart, Jonas Karlman,
Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Daniel Vetter, Liam Girdwood,
Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Marc Gonzalez
Cc: dri-devel, devicetree, linux-arm-msm, Arnaud Vrac,
Pierre-Hugues Husson, Dmitry Baryshkov, Konrad Dybcio
On Mon, 12 Aug 2024 16:51:00 +0200, Marc Gonzalez wrote:
> TDP158 is an AC-coupled DVI / HDMI to TMDS level shifting Redriver.
>
> Like the TFP410, the TDP158 can be set up in 2 different ways:
> 1) hard-coding its configuration settings using pin-strapping resistors
> 2) placing it on an I2C bus, and defer set-up until run-time
>
> The mode is selected by pin 8 = I2C_EN
> I2C_EN = 1 ==> I2C Control Mode
> I2C_EN = 0 ==> Pin Strap Mode
>
> [...]
Applied, thanks!
[1/2] dt-bindings: display: bridge: add TI TDP158
https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/887665792b99
[2/2] drm/bridge: add support for TI TDP158
https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/a15710027afb
Rob
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v5 0/2] Basic support for TI TDP158
2024-09-03 12:40 ` [PATCH v5 0/2] Basic " Robert Foss
@ 2024-09-03 15:30 ` Jani Nikula
2024-09-04 8:54 ` Jani Nikula
2024-10-07 14:33 ` Marc Gonzalez
1 sibling, 1 reply; 10+ messages in thread
From: Jani Nikula @ 2024-09-03 15:30 UTC (permalink / raw)
To: Robert Foss, Andrzej Hajda, Neil Armstrong, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Daniel Vetter, Liam Girdwood,
Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Marc Gonzalez
Cc: dri-devel, devicetree, linux-arm-msm, Arnaud Vrac,
Pierre-Hugues Husson, Dmitry Baryshkov, Konrad Dybcio
On Tue, 03 Sep 2024, Robert Foss <rfoss@kernel.org> wrote:
> On Mon, 12 Aug 2024 16:51:00 +0200, Marc Gonzalez wrote:
>> TDP158 is an AC-coupled DVI / HDMI to TMDS level shifting Redriver.
>>
>> Like the TFP410, the TDP158 can be set up in 2 different ways:
>> 1) hard-coding its configuration settings using pin-strapping resistors
>> 2) placing it on an I2C bus, and defer set-up until run-time
>>
>> The mode is selected by pin 8 = I2C_EN
>> I2C_EN = 1 ==> I2C Control Mode
>> I2C_EN = 0 ==> Pin Strap Mode
>>
>> [...]
>
> Applied, thanks!
>
> [1/2] dt-bindings: display: bridge: add TI TDP158
> https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/887665792b99
> [2/2] drm/bridge: add support for TI TDP158
> https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/a15710027afb
Fails build with:
../drivers/gpu/drm/bridge/ti-tdp158.c: In function ‘tdp158_enable’:
../drivers/gpu/drm/bridge/ti-tdp158.c:31:9: error: implicit declaration of function ‘gpiod_set_value_cansleep’ [-Werror=implicit-function-declaration]
31 | gpiod_set_value_cansleep(tdp158->enable, 1);
| ^~~~~~~~~~~~~~~~~~~~~~~~
../drivers/gpu/drm/bridge/ti-tdp158.c: In function ‘tdp158_probe’:
../drivers/gpu/drm/bridge/ti-tdp158.c:80:26: error: implicit declaration of function ‘devm_gpiod_get_optional’; did you mean ‘devm_regulator_get_optional’? [-Werror=implicit-function-declaration]
80 | tdp158->enable = devm_gpiod_get_optional(dev, "enable", GPIOD_OUT_LOW);
| ^~~~~~~~~~~~~~~~~~~~~~~
| devm_regulator_get_optional
../drivers/gpu/drm/bridge/ti-tdp158.c:80:65: error: ‘GPIOD_OUT_LOW’ undeclared (first use in this function)
80 | tdp158->enable = devm_gpiod_get_optional(dev, "enable", GPIOD_OUT_LOW);
| ^~~~~~~~~~~~~
../drivers/gpu/drm/bridge/ti-tdp158.c:80:65: note: each undeclared identifier is reported only once for each function it appears in
BR,
Jani.
--
Jani Nikula, Intel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v5 0/2] Basic support for TI TDP158
2024-09-03 15:30 ` Jani Nikula
@ 2024-09-04 8:54 ` Jani Nikula
0 siblings, 0 replies; 10+ messages in thread
From: Jani Nikula @ 2024-09-04 8:54 UTC (permalink / raw)
To: Robert Foss, Andrzej Hajda, Neil Armstrong, Laurent Pinchart,
Jonas Karlman, Jernej Skrabec, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Daniel Vetter, Liam Girdwood,
Mark Brown, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Marc Gonzalez
Cc: dri-devel, devicetree, linux-arm-msm, Arnaud Vrac,
Pierre-Hugues Husson, Dmitry Baryshkov, Konrad Dybcio
On Tue, 03 Sep 2024, Jani Nikula <jani.nikula@linux.intel.com> wrote:
> On Tue, 03 Sep 2024, Robert Foss <rfoss@kernel.org> wrote:
>> On Mon, 12 Aug 2024 16:51:00 +0200, Marc Gonzalez wrote:
>>> TDP158 is an AC-coupled DVI / HDMI to TMDS level shifting Redriver.
>>>
>>> Like the TFP410, the TDP158 can be set up in 2 different ways:
>>> 1) hard-coding its configuration settings using pin-strapping resistors
>>> 2) placing it on an I2C bus, and defer set-up until run-time
>>>
>>> The mode is selected by pin 8 = I2C_EN
>>> I2C_EN = 1 ==> I2C Control Mode
>>> I2C_EN = 0 ==> Pin Strap Mode
>>>
>>> [...]
>>
>> Applied, thanks!
>>
>> [1/2] dt-bindings: display: bridge: add TI TDP158
>> https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/887665792b99
>> [2/2] drm/bridge: add support for TI TDP158
>> https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/a15710027afb
>
> Fails build with:
>
> ../drivers/gpu/drm/bridge/ti-tdp158.c: In function ‘tdp158_enable’:
> ../drivers/gpu/drm/bridge/ti-tdp158.c:31:9: error: implicit declaration of function ‘gpiod_set_value_cansleep’ [-Werror=implicit-function-declaration]
> 31 | gpiod_set_value_cansleep(tdp158->enable, 1);
> | ^~~~~~~~~~~~~~~~~~~~~~~~
> ../drivers/gpu/drm/bridge/ti-tdp158.c: In function ‘tdp158_probe’:
> ../drivers/gpu/drm/bridge/ti-tdp158.c:80:26: error: implicit declaration of function ‘devm_gpiod_get_optional’; did you mean ‘devm_regulator_get_optional’? [-Werror=implicit-function-declaration]
> 80 | tdp158->enable = devm_gpiod_get_optional(dev, "enable", GPIOD_OUT_LOW);
> | ^~~~~~~~~~~~~~~~~~~~~~~
> | devm_regulator_get_optional
> ../drivers/gpu/drm/bridge/ti-tdp158.c:80:65: error: ‘GPIOD_OUT_LOW’ undeclared (first use in this function)
> 80 | tdp158->enable = devm_gpiod_get_optional(dev, "enable", GPIOD_OUT_LOW);
> | ^~~~~~~~~~~~~
> ../drivers/gpu/drm/bridge/ti-tdp158.c:80:65: note: each undeclared identifier is reported only once for each function it appears in
Fix at [1].
BR,
Jani.
[1] https://lore.kernel.org/r/20240904085206.3331553-1-jani.nikula@intel.com
--
Jani Nikula, Intel
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v5 0/2] Basic support for TI TDP158
2024-09-03 12:40 ` [PATCH v5 0/2] Basic " Robert Foss
2024-09-03 15:30 ` Jani Nikula
@ 2024-10-07 14:33 ` Marc Gonzalez
2024-10-07 14:42 ` Dmitry Baryshkov
1 sibling, 1 reply; 10+ messages in thread
From: Marc Gonzalez @ 2024-10-07 14:33 UTC (permalink / raw)
To: Robert Foss
Cc: dri-devel, devicetree, linux-arm-msm, Arnaud Vrac,
Pierre-Hugues Husson, Dmitry Baryshkov, Konrad Dybcio
On 03/09/2024 14:40, Robert Foss wrote:
> On Mon, 12 Aug 2024 16:51:00 +0200, Marc Gonzalez wrote:
>
>> TDP158 is an AC-coupled DVI / HDMI to TMDS level shifting Redriver.
>>
>> Like the TFP410, the TDP158 can be set up in 2 different ways:
>> 1) hard-coding its configuration settings using pin-strapping resistors
>> 2) placing it on an I2C bus, and defer set-up until run-time
>>
>> The mode is selected by pin 8 = I2C_EN
>> I2C_EN = 1 ==> I2C Control Mode
>> I2C_EN = 0 ==> Pin Strap Mode
>>
>> [...]
>
> Applied, thanks!
>
> [1/2] dt-bindings: display: bridge: add TI TDP158
> https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/887665792b99
> [2/2] drm/bridge: add support for TI TDP158
> https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/a15710027afb
Hello Robert,
I expected this series to be included in v6.12-rc1, since you applied it
before the v6.12 merge window opened. Did I misunderstand the process?
If not in v6.12, does that mean it will be in v6.13?
Regards
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v5 0/2] Basic support for TI TDP158
2024-10-07 14:33 ` Marc Gonzalez
@ 2024-10-07 14:42 ` Dmitry Baryshkov
2024-10-07 14:50 ` Marc Gonzalez
0 siblings, 1 reply; 10+ messages in thread
From: Dmitry Baryshkov @ 2024-10-07 14:42 UTC (permalink / raw)
To: Marc Gonzalez
Cc: Robert Foss, dri-devel, devicetree, linux-arm-msm, Arnaud Vrac,
Pierre-Hugues Husson, Konrad Dybcio
On Mon, 7 Oct 2024 at 16:33, Marc Gonzalez <mgonzalez@freebox.fr> wrote:
>
> On 03/09/2024 14:40, Robert Foss wrote:
>
> > On Mon, 12 Aug 2024 16:51:00 +0200, Marc Gonzalez wrote:
> >
> >> TDP158 is an AC-coupled DVI / HDMI to TMDS level shifting Redriver.
> >>
> >> Like the TFP410, the TDP158 can be set up in 2 different ways:
> >> 1) hard-coding its configuration settings using pin-strapping resistors
> >> 2) placing it on an I2C bus, and defer set-up until run-time
> >>
> >> The mode is selected by pin 8 = I2C_EN
> >> I2C_EN = 1 ==> I2C Control Mode
> >> I2C_EN = 0 ==> Pin Strap Mode
> >>
> >> [...]
> >
> > Applied, thanks!
> >
> > [1/2] dt-bindings: display: bridge: add TI TDP158
> > https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/887665792b99
> > [2/2] drm/bridge: add support for TI TDP158
> > https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/a15710027afb
>
> Hello Robert,
>
> I expected this series to be included in v6.12-rc1, since you applied it
> before the v6.12 merge window opened. Did I misunderstand the process?
drm-misc-next stops propagating new changes to drm-next one or two
weeks before the release.
> If not in v6.12, does that mean it will be in v6.13?
Yes.
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH v5 0/2] Basic support for TI TDP158
2024-10-07 14:42 ` Dmitry Baryshkov
@ 2024-10-07 14:50 ` Marc Gonzalez
0 siblings, 0 replies; 10+ messages in thread
From: Marc Gonzalez @ 2024-10-07 14:50 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Robert Foss, dri-devel, devicetree, linux-arm-msm, Arnaud Vrac,
Pierre-Hugues Husson, Konrad Dybcio
On 07/10/2024 16:42, Dmitry Baryshkov wrote:
> On Mon, 7 Oct 2024 at 16:33, Marc Gonzalez <mgonzalez@freebox.fr> wrote:
>>
>> On 03/09/2024 14:40, Robert Foss wrote:
>>
>>> On Mon, 12 Aug 2024 16:51:00 +0200, Marc Gonzalez wrote:
>>>
>>>> TDP158 is an AC-coupled DVI / HDMI to TMDS level shifting Redriver.
>>>>
>>>> Like the TFP410, the TDP158 can be set up in 2 different ways:
>>>> 1) hard-coding its configuration settings using pin-strapping resistors
>>>> 2) placing it on an I2C bus, and defer set-up until run-time
>>>>
>>>> The mode is selected by pin 8 = I2C_EN
>>>> I2C_EN = 1 ==> I2C Control Mode
>>>> I2C_EN = 0 ==> Pin Strap Mode
>>>>
>>>> [...]
>>>
>>> Applied, thanks!
>>>
>>> [1/2] dt-bindings: display: bridge: add TI TDP158
>>> https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/887665792b99
>>> [2/2] drm/bridge: add support for TI TDP158
>>> https://gitlab.freedesktop.org/drm/misc/kernel/-/commit/a15710027afb
>>
>> Hello Robert,
>>
>> I expected this series to be included in v6.12-rc1, since you applied it
>> before the v6.12 merge window opened. Did I misunderstand the process?
>
> drm-misc-next stops propagating new changes to drm-next one or two
> weeks before the release.
Oh right, the "stop at rc6" rule of thumb that Krzysztof mentioned.
Regards
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2024-10-07 14:50 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-12 14:51 [PATCH v5 0/2] Basic support for TI TDP158 Marc Gonzalez
2024-08-12 14:51 ` [PATCH v5 1/2] dt-bindings: display: bridge: add " Marc Gonzalez
2024-08-12 14:51 ` [PATCH v5 2/2] drm/bridge: add support for " Marc Gonzalez
2024-08-27 13:39 ` Robert Foss
2024-09-03 12:40 ` [PATCH v5 0/2] Basic " Robert Foss
2024-09-03 15:30 ` Jani Nikula
2024-09-04 8:54 ` Jani Nikula
2024-10-07 14:33 ` Marc Gonzalez
2024-10-07 14:42 ` Dmitry Baryshkov
2024-10-07 14:50 ` Marc Gonzalez
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).