[linux-sunxi] [PATCH v4 4/9] pwm: sunxi: Customizable control and period register position.

2017-02-23 Thread lis8215
From: Siarhei Volkau sun6i has same registers as sun4i compatible chips, but its position in register map are different. This patch make register's position selectable for support sun6i in next patches. Signed-off-by: Siarhei Volkau --- drivers/pwm/pwm-sun4i.c | 57 +++

[linux-sunxi] [PATCH v4 5/9] pwm: sunxi: Customizable regmap fields and enable bit mask.

2017-02-23 Thread lis8215
From: Siarhei Volkau sun6i has similar control registers bit map in comparison to sun4i channel 0, but each channel has its own control register. This patch make: - regmap fields declarations selectable, - enable/disable bitmask selectable. These things needed for support sun6i in next patches

[linux-sunxi] [PATCH v4 0/9] Add the Allwinner A31/A31s PWM driver.

2017-02-23 Thread lis8215
From: Siarhei Volkau This is the 4-th version of the sun6i PWM patchset. Difference between v3 and v4: - patchset split on many small patches for easier bisect. - avoid unsafe macros usage. - some minor cleanups. First two patches moves register access operations from custom iomem read-modify

[linux-sunxi] [PATCH v4 8/9] pwm: sunxi: Code cleanup.

2017-02-23 Thread lis8215
From: Siarhei Volkau This patch removes macros, which are not use anymore and fixes two extra -Wsign-compare warnings. Signed-off-by: Siarhei Volkau --- drivers/pwm/pwm-sun4i.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/pwm/pwm-sun4i.c b/drivers/p

[linux-sunxi] [PATCH v4 1/9] pwm: sunxi: Use regmap API for register access.

2017-02-23 Thread lis8215
From: Siarhei Volkau The patch replaces iomem register access routines to regmap equivalents. Signed-off-by: Siarhei Volkau --- drivers/pwm/Kconfig | 2 +- drivers/pwm/pwm-sun4i.c | 143 2 files changed, 110 insertions(+), 35 deletions(-)

[linux-sunxi] [PATCH v4 9/9] ARM: dts: sun6i: Add the PWM block to the A31/A31s.

2017-02-23 Thread lis8215
From: Siarhei Volkau Signed-off-by: Siarhei Volkau --- arch/arm/boot/dts/sun6i-a31.dtsi | 8 1 file changed, 8 insertions(+) diff --git a/arch/arm/boot/dts/sun6i-a31.dtsi b/arch/arm/boot/dts/sun6i-a31.dtsi index ee1eb6d..fcba129 100644 --- a/arch/arm/boot/dts/sun6i-a31.dtsi +++ b/arch

[linux-sunxi] [PATCH v4 2/9] pwm: sunxi: Use regmap fields for bit operations.

2017-02-23 Thread lis8215
From: Siarhei Volkau This patch replaces a bunch of custom read-modify-write operations by regmap fields. Signed-off-by: Siarhei Volkau --- drivers/pwm/pwm-sun4i.c | 197 ++-- 1 file changed, 108 insertions(+), 89 deletions(-) diff --git a/drivers/p

[linux-sunxi] [PATCH v4 6/9] pwm: sunxi: Increase max number of pwm channels.

2017-02-23 Thread lis8215
From: Siarhei Volkau sun6i have 4 pwm channels onboard. This patch increase maximal possible count of channels. Signed-off-by: Siarhei Volkau --- drivers/pwm/pwm-sun4i.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/pwm/pwm-sun4i.c b/drivers/pwm/pwm-sun4i.

[linux-sunxi] [PATCH v4 3/9] pwm: sunxi: Selectable prescaler table.

2017-02-23 Thread lis8215
From: Siarhei Volkau A31 SoC have a different set of prescalers than sun4i compatible ASoCs, but its position and count in the control register are the same. This patch make the table of prescalers customizable. Signed-off-by: Siarhei Volkau --- drivers/pwm/pwm-sun4i.c | 9 - 1 file c

[linux-sunxi] [PATCH v4 7/9] pwm: sunxi: Add support the Allwinner A31 PWM.

2017-02-23 Thread lis8215
From: Siarhei Volkau This patch introduce the sun6i PWM driver itself: - sun6i channels register and field map, - sun6i prescaler table, - DT bindings for A31 SoC, - documentation update. Signed-off-by: Siarhei Volkau --- .../devicetree/bindings/pwm/pwm-sun4i.txt | 3 +- drivers/

[linux-sunxi] Re: [PATCH 4/8] drm/sun4i: add support for sun8i DE2 mixers and display engines

2017-02-23 Thread Maxime Ripard
Hi Emil, On Thu, Feb 23, 2017 at 05:44:54PM +, Emil Velikov wrote: > On 22 February 2017 at 15:18, Icenowy Zheng wrote: > > Allwinner have a new "Display Engine 2.0" in there new SoCs, which comes > > in a new "Display Engine" (mixers instead of old backends and > > frontends). > > > > Add su

Re: [linux-sunxi] Re: [RFC PATCH 4/9] clk: sunxi-ng: support R40 SoC

2017-02-23 Thread Maxime Ripard
On Wed, Feb 22, 2017 at 01:54:58PM +0800, Icenowy Zheng wrote: > > 2017年2月22日 07:03于 Maxime Ripard 写道: > > > > Hi, > > > > On Sat, Feb 18, 2017 at 01:37:17AM +0800, Icenowy Zheng wrote: > > > Allwinner R40 SoC have a clock controller module in the style of the > > > SoCs beyond sun6i, however,

[linux-sunxi] Re: [PATCH 11/11] drm/sun4i: Add backend and tcon pointers to sun4i_crtc

2017-02-23 Thread Maxime Ripard
On Thu, Feb 23, 2017 at 04:05:43PM +0800, Chen-Yu Tsai wrote: > sun4i_crtc controls the backend and tcon hardware blocks of the display > pipeline. Instead of doing so through the master drm structure, leave > pointers to the corresponding backend and tcon in itself. > > Also drop the drm_device p

[linux-sunxi] Re: [PATCH 06/11] drm/sun4i: Drop primary layer pointer from sun4i_drv

2017-02-23 Thread Maxime Ripard
On Thu, Feb 23, 2017 at 04:05:38PM +0800, Chen-Yu Tsai wrote: > The current layer init code keeps a pointer to the primary plane layer > in sun4i_drv. When we eventually support multiple display pipelines, > this would force us to keep track of primary planes for all crtcs. And > these pointers onl

[linux-sunxi] Re: [PATCH 05/11] drm/sun4i: Initialize crtc from tcon bind function

2017-02-23 Thread Maxime Ripard
On Thu, Feb 23, 2017 at 04:05:37PM +0800, Chen-Yu Tsai wrote: > The tcon provides part of the functionality of the crtc, and also > provides the device node for the output port of the crtc. To be able > to use drm_of_find_possible_crtcs(), all crtc must be initialized before > any downstream encode

[linux-sunxi] Re: [PATCH 04/11] drm/sun4i: Move layers from sun4i_drv to sun4i_crtc

2017-02-23 Thread Maxime Ripard
On Thu, Feb 23, 2017 at 04:05:36PM +0800, Chen-Yu Tsai wrote: > This patch moves the sun4i_layers_init call from sun4i_drv_bind to > sun4i_crtc_init, and the layers pointer from struct sun4i_drv to > struct sun4i_crtc. > > The layers are bound to a specific crtc, and they are not directly > used o

[linux-sunxi] Re: [PATCH 03/11] drm/sun4i: Add end of list element for sun4i_layers_init's returned list

2017-02-23 Thread Maxime Ripard
On Thu, Feb 23, 2017 at 04:05:35PM +0800, Chen-Yu Tsai wrote: > The number of defined planes in sun4i_layer is unknown to other parts > of the sun4i drm driver. Since the return value of sun4i_layers_init > is a list of layers, make it return 1 more empty layer as an end of > list guard value. > >

[linux-sunxi] Re: [PATCH 02/11] drm/sun4i: Set drm_crtc.port to the underlying TCON's output port node

2017-02-23 Thread Maxime Ripard
On Thu, Feb 23, 2017 at 04:05:34PM +0800, Chen-Yu Tsai wrote: > The way drm_of_find_possible_crtcs is it tries to match the Aren't you missing "works" here ^ > remote-endpoint of the given node's various endpoints to all the > crtc's .port field. Thus we need to set drm_crtc.port to the outpu

[linux-sunxi] Re: [PATCH 01/11] drm/sun4i: Make sunxi_rgb2yuv_coef constant

2017-02-23 Thread Maxime Ripard
On Thu, Feb 23, 2017 at 04:05:33PM +0800, Chen-Yu Tsai wrote: > sunxi_rgb2yuv_coef is a table of RGB-to-YUV conversion coefficients. > They are programmed into the hardware, and can be declared constant. > > Reported-by: Priit Laes > Signed-off-by: Chen-Yu Tsai Applied, thanks! Maxime -- Maxi

[linux-sunxi] Re: [PATCH 4/8] drm/sun4i: add support for sun8i DE2 mixers and display engines

2017-02-23 Thread Emil Velikov
On 22 February 2017 at 15:18, Icenowy Zheng wrote: > Allwinner have a new "Display Engine 2.0" in there new SoCs, which comes > in a new "Display Engine" (mixers instead of old backends and > frontends). > > Add support for the mixer on Allwinner V3s SoC; it's the simplest one. > > Signed-off-by:

[linux-sunxi] Re: [RFC PATCH 0/9] Add support for Allwinner R40 SoC

2017-02-23 Thread Linus Walleij
On Fri, Feb 17, 2017 at 6:37 PM, Icenowy Zheng wrote: > This patchset is an experiment to add R40 support to mainline Linux. > > As we have still no user manual for R40, the patchset is developed > by reading the BSP source code and device tree, educated guess and > try and error. Out of curiosi

[linux-sunxi] Re: [PATCH 4/8] drm/sun4i: add support for sun8i DE2 mixers and display engines

2017-02-23 Thread Stefan Monnier
> drivers/gpu/drm/sun4i/Kconfig | 8 + > drivers/gpu/drm/sun4i/Makefile | 1 + > drivers/gpu/drm/sun4i/sun4i_crtc.c | 6 +- > drivers/gpu/drm/sun4i/sun4i_drv.c | 38 +++- > drivers/gpu/drm/sun4i/sun4i_drv.h | 1 + > drivers/gpu/drm/sun4i/sun4i_layer.c | 92 ++-- > dri

[linux-sunxi] [PATCH 07/11] drm/sun4i: Drop hardcoded .possible_crtcs values from layers

2017-02-23 Thread Chen-Yu Tsai
To support multiple display pipelines, we would have multiple crtcs, with one or more planes bound to them. Obviously having hardcoded values for the drm_plane .possible_crtcs field is not going to work. For primary and cursor planes, the value is set by drm_crtc_init_with_planes. We just need to

[linux-sunxi] [PATCH 05/11] drm/sun4i: Initialize crtc from tcon bind function

2017-02-23 Thread Chen-Yu Tsai
The tcon provides part of the functionality of the crtc, and also provides the device node for the output port of the crtc. To be able to use drm_of_find_possible_crtcs(), all crtc must be initialized before any downstream encoders. The other part of the crtc is the display backend. The Rockchip D

[linux-sunxi] [PATCH 01/11] drm/sun4i: Make sunxi_rgb2yuv_coef constant

2017-02-23 Thread Chen-Yu Tsai
sunxi_rgb2yuv_coef is a table of RGB-to-YUV conversion coefficients. They are programmed into the hardware, and can be declared constant. Reported-by: Priit Laes Signed-off-by: Chen-Yu Tsai --- drivers/gpu/drm/sun4i/sun4i_backend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --g

[linux-sunxi] [PATCH 02/11] drm/sun4i: Set drm_crtc.port to the underlying TCON's output port node

2017-02-23 Thread Chen-Yu Tsai
The way drm_of_find_possible_crtcs is it tries to match the remote-endpoint of the given node's various endpoints to all the crtc's .port field. Thus we need to set drm_crtc.port to the output port node of the underlying TCON. Signed-off-by: Chen-Yu Tsai --- drivers/gpu/drm/sun4i/sun4i_crtc.c |

[linux-sunxi] [PATCH 06/11] drm/sun4i: Drop primary layer pointer from sun4i_drv

2017-02-23 Thread Chen-Yu Tsai
The current layer init code keeps a pointer to the primary plane layer in sun4i_drv. When we eventually support multiple display pipelines, this would force us to keep track of primary planes for all crtcs. And these pointers only get used at bind time. Instead, have the crtc init code iterate thr

[linux-sunxi] [PATCH 10/11] drm/sun4i: Add backend pointer to sun4i_layer

2017-02-23 Thread Chen-Yu Tsai
sun4i_layer only controls the backend hardware block of the display pipeline. Instead of getting a pointer to the underlying backend through the drm_device structure, leave one in itself. Also drop the drm_device pointer, since it is no longer needed. The next step forward would be to pass the po

[linux-sunxi] [PATCH 09/11] drm/sun4i: rgb: Pass tcon pointer when initializing RGB encoder

2017-02-23 Thread Chen-Yu Tsai
The RGB encoder represents channel 0 of the TCON. Instead of fetching the pointer to its TCON from the main sun4i_drv structure, pass it in as part of the init call, save it, and use it directly in the encoder and connector callbacks. We can also drop the otherwise unused sun4i_drv pointer. Signe

[linux-sunxi] [PATCH 04/11] drm/sun4i: Move layers from sun4i_drv to sun4i_crtc

2017-02-23 Thread Chen-Yu Tsai
This patch moves the sun4i_layers_init call from sun4i_drv_bind to sun4i_crtc_init, and the layers pointer from struct sun4i_drv to struct sun4i_crtc. The layers are bound to a specific crtc, and they are not directly used once initiated. They are used through their included drm_plane structures.

[linux-sunxi] [PATCH 08/11] drm/sun4i: tv: Switch to drm_of_find_possible_crtcs

2017-02-23 Thread Chen-Yu Tsai
Now that the crtcs have their .port field set properly, we can use drm_of_find_possible_crtcs to find the connected crtcs, instead of hardcoding the first crtc as usable. The new code also defers binding when the upstream crtc hasn't been registered yet. This makes it easier to support multiple tc

[linux-sunxi] [PATCH 00/11] drm/sun4i: Various fixes and cleanups part 2

2017-02-23 Thread Chen-Yu Tsai
Hi Maxime, This is the second bunch of fixes for the sun4i drm driver. This is part of the cleanup I am doing towards making the driver support multiple display pipelines. This part mainly aims to get detection of crtcs working with of_graph, and moving data structure pointers around for a more l

[linux-sunxi] [PATCH 03/11] drm/sun4i: Add end of list element for sun4i_layers_init's returned list

2017-02-23 Thread Chen-Yu Tsai
The number of defined planes in sun4i_layer is unknown to other parts of the sun4i drm driver. Since the return value of sun4i_layers_init is a list of layers, make it return 1 more empty layer as an end of list guard value. Signed-off-by: Chen-Yu Tsai --- drivers/gpu/drm/sun4i/sun4i_layer.c | 2

[linux-sunxi] [PATCH 11/11] drm/sun4i: Add backend and tcon pointers to sun4i_crtc

2017-02-23 Thread Chen-Yu Tsai
sun4i_crtc controls the backend and tcon hardware blocks of the display pipeline. Instead of doing so through the master drm structure, leave pointers to the corresponding backend and tcon in itself. Also drop the drm_device pointer, since it is no longer needed. The next step forward would be to