mbox series

[v5,0/2] Basic support for TI TDP158

Message ID 20240812-tdp158-v5-0-78684a84ec23@freebox.fr (mailing list archive)
Headers show
Series Basic support for TI TDP158 | expand

Message

Marc Gonzalez Aug. 12, 2024, 2:51 p.m. UTC
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,

Comments

Robert Foss Sept. 3, 2024, 12:40 p.m. UTC | #1
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
Jani Nikula Sept. 3, 2024, 3:30 p.m. UTC | #2
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 Sept. 4, 2024, 8:54 a.m. UTC | #3
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
Marc Gonzalez Oct. 7, 2024, 2:33 p.m. UTC | #4
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
Dmitry Baryshkov Oct. 7, 2024, 2:42 p.m. UTC | #5
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.
Marc Gonzalez Oct. 7, 2024, 2:50 p.m. UTC | #6
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