mbox series

[v5,00/12] drm/sun4i: Add A83t LVDS support

Message ID cover.e5a47cc96ec5274dd932daa2bde47df073087da9.1513854122.git-series.maxime.ripard@free-electrons.com
Headers show
Series drm/sun4i: Add A83t LVDS support | expand

Message

Maxime Ripard Dec. 21, 2017, 11:02 a.m. UTC
Hi,

Here is an attempt at supporting the LVDS output in our DRM driver. This
has been tested on the A83T (with DE2), but since everything is basically
in the TCON, it should also be usable on the older SoCs with minor
modifications.

This was the occasion to refactor a bunch of things. The most notable ones
would be the documentation, and split of the UI layers in the mixer code,
and the switch to kfifo for our endpoint parsing code in the driver that
fixes an issue introduced by the switch to BFS.

Let me know what you think,
Maxime

Changes from v4:
  - Changed the order of the clk_prepare_enable and clk_set_rate for the
    mixer module clock
  - Squash the two DT PWM patches
  - Removed the output pins muxing
  - Changed the flag to tell if you have an LVDS alternate clock to
    has_lvds_alt
  - Used SPDX headers

Changes from v3:
  - Collect the tags
  - Use SPDX headers when possible
  - Added the new mixer configuration options
  - Changed the LVDS clock for lvds-alt instead of lvds-pll
  - Removed the MIPI PLL from the A31s
  - Changed the LVDS_ANA0 macros name to reflect the generation they were
    introduced in, and added a comment to mention the changes needed to
    support the older SoCs

Changes from v2:
  - Move the module clock rate to the mixer structure
  - Adjusted the simple-panel documentation for power-supply
  - Changed the compatible for the first A83t mixer to mixer 0
  - Rebased on top of current drm-misc
  - Split out the A83t bindings in its separate patch

Changes from v1:
  - Added a fix for the error path handling in the TCON
  - Enable the TCON by default
  - Removed the patch that changes the channels offset but kept most of the
    modifications as a cleanup
  - Deal with the LVDS clock being able to have another PLL parent on some
    SoCs
  - Renamed the TCON compatible to TCON-TV, following the convention used
    on newer SoCs
  - Removed the hardcoded timings
  - Moved LVDS enable quirks to a separate function
  - Used clock indices define in the DT
  - Removed the hardcoded clock rate in the DT and moved it to the driver
  - Changed sun8i_mixer_planes to sun8i_mixer_ui_planes to be consistent
  - Added the various tags collected
  - Rebased on top of 4.15

Maxime Ripard (12):
  dt-bindings: panel: lvds: Document power-supply property
  drm/panel: lvds: Add support for the power-supply property
  dt-bindings: display: sun4i-drm: Add LVDS properties
  dt-bindings: display: sun4i-drm: Add A83T pipeline
  drm/sun4i: Force the mixer rate at 150MHz
  drm/sun4i: Create minimal multipliers and dividers
  drm/sun4i: Add LVDS support
  drm/sun4i: Add A83T support
  ARM: dts: sun8i: a83t: Add display pipeline
  ARM: dts: sun8i: a83t: Enable the PWM
  ARM: dts: sun8i: a83t: Add LVDS pins group
  ARM: dts: sun8i: a711: Enable the LCD

 Documentation/devicetree/bindings/display/panel/panel-common.txt |   6 ++-
 Documentation/devicetree/bindings/display/panel/panel-lvds.txt   |   1 +-
 Documentation/devicetree/bindings/display/panel/simple-panel.txt |   2 +-
 Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt    |  12 ++++-
 arch/arm/boot/dts/sun8i-a83t-tbs-a711.dts                        |  61 ++++++++++++++++++-
 arch/arm/boot/dts/sun8i-a83t.dtsi                                |  99 +++++++++++++++++++++++++++++-
 drivers/gpu/drm/panel/panel-lvds.c                               |  23 +++++++-
 drivers/gpu/drm/sun4i/Makefile                                   |   1 +-
 drivers/gpu/drm/sun4i/sun4i_dotclock.c                           |  10 ++-
 drivers/gpu/drm/sun4i/sun4i_drv.c                                |   1 +-
 drivers/gpu/drm/sun4i/sun4i_lvds.c                               | 177 ++++++++++++++++++++++++++++++++++++++++++++++++++++-
 drivers/gpu/drm/sun4i/sun4i_lvds.h                               |  12 ++++-
 drivers/gpu/drm/sun4i/sun4i_tcon.c                               | 244 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 drivers/gpu/drm/sun4i/sun4i_tcon.h                               |  31 +++++++++-
 drivers/gpu/drm/sun4i/sun8i_mixer.c                              |  21 ++++++-
 drivers/gpu/drm/sun4i/sun8i_mixer.h                              |   3 +-
 16 files changed, 699 insertions(+), 5 deletions(-)
 create mode 100644 drivers/gpu/drm/sun4i/sun4i_lvds.c
 create mode 100644 drivers/gpu/drm/sun4i/sun4i_lvds.h

base-commit: 99239c7ba0214ec99011378a6ca1bcd589c3dc98
-- 
git-series 0.9.1
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Jernej Škrabec Dec. 30, 2017, 11:45 a.m. UTC | #1
Hi Maxime,

Dne četrtek, 21. december 2017 ob 12:02:29 CET je Maxime Ripard napisal(a):
> Some clocks and resets supposed to drive the LVDS logic in the display

> engine have been overlooked when the driver was first introduced.

> 

> Add those additional resources to the binding, and we'll deal with the ABI

> stability in the code.

> 

> Reviewed-by: Chen-Yu Tsai <wens@csie.org>

> Reviewed-by: Rob Herring <robh@kernel.org>

> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>

> ---

>  Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt |  9 +++++++-

> 1 file changed, 9 insertions(+)

> 

> diff --git a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt

> b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt index

> 50cc72ee1168..1e21cfaac9e2 100644

> --- a/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt

> +++ b/Documentation/devicetree/bindings/display/sunxi/sun4i-drm.txt

> @@ -121,6 +121,15 @@ Required properties:

>  On SoCs other than the A33 and V3s, there is one more clock required:

>     - 'tcon-ch1': The clock driving the TCON channel 1

> 

> +On SoCs that support LVDS (all SoCs but the A13, H3, H5 and V3s), you

> +need one more reset line:

> +   - 'lvds': The reset line driving the LVDS logic

> +

> +And on the SoCs newer than the A31 (sun6i and sun8i families), you

> +need one more clock line:

> +   - 'lvds-alt': An alternative clock source, separate from the TCON

> channel 0 +                 clock, that can be used to drive the LVDS clock


I think this wording is imprecise, since A83T is part of the sun8i family, but 
from the code (patch 7) and DT changes (patch 9) you do, it doesn't need this 
property.

Maybe it would be just easier to enumerate all compatibles which needs this 
property? 

Best regards,
Jernej


--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Laurent Pinchart Jan. 4, 2018, 8:05 p.m. UTC | #2
Hi Maxime,

On Thursday, 4 January 2018 21:44:36 EET Maxime Ripard wrote:
> On Fri, Dec 22, 2017 at 02:08:20PM +0200, Laurent Pinchart wrote:

> > On Thursday, 21 December 2017 13:02:27 EET Maxime Ripard wrote:

> >> The power-supply property is used by a vast majority of panels,

> >> including panel-simple. Let's document it as a common property

> >> 

> >> Reviewed-by: Rob Herring <robh@kernel.org>

> >> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>

> >> ---

> >> 

> >> Documentation/devicetree/bindings/display/panel/panel-common.txt | 6 ++++

> >> Documentation/devicetree/bindings/display/panel/panel-lvds.txt   | 1 +

> >> Documentation/devicetree/bindings/display/panel/simple-panel.txt | 2 +-

> >> 3 files changed, 8 insertions(+), 1 deletion(-)

> >> 

> >> diff --git

> >> a/Documentation/devicetree/bindings/display/panel/panel-common.txt

> >> b/Documentation/devicetree/bindings/display/panel/panel-common.txt index

> >> ec52c472c845..125ea68052af 100644

> >> --- a/Documentation/devicetree/bindings/display/panel/panel-common.txt

> >> +++ b/Documentation/devicetree/bindings/display/panel/panel-common.txt

> >> @@ -78,6 +78,12 @@ used for panels that implement compatible control

> >> signals. while active. Active high reset signals can be supported by

> >> inverting the GPIO specifier polarity flag.

> >> 

> >> +Power

> >> +-----

> >> +

> >> +- power-supply: many display panels need an additional power supply in

> >> +  order to be fully powered-up. For such panels, power-supply contains

> >> +  a phandle to the regulator powering the panel.

> > 

> > I think we should give more details here about the limitations of this

> > property. How about the following explanation ?

> > 

> > - power-supply: display panels require power to be supplied. While several

> > panels need more than one power supply with panel-specific constraints

> > governing the order and timings of the power supplies, in many cases a

> > single power supply is sufficient, either because the panel has a single

> > power rail, or because all its power rails can be driven by the same

> > supply. In that case the power-supply property specifies the supply

> > powering the panel as a phandle to a regulator.

> 

> That works for me. Do you want me to resend it with that text, or

> should I merge it (and if so, with your Reviewed-by or Acked-by?)?


No need to resend if it's just for me. With the above text,

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>


(on a side note, I wonder if it's more efficient to ask whether to resend 
instead of just resending :-))

-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html