* [RESEND PATCH 0/6] Rockchip Type-C and DispplayPort driver
@ 2016-05-27 10:45 Chris Zhong
[not found] ` <1464345942-4795-1-git-send-email-zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Chris Zhong @ 2016-05-27 10:45 UTC (permalink / raw)
To: dianders, tfiga, heiko, yzq
Cc: linux-rockchip, Chris Zhong, Charles Keepax, alsa-devel,
Kumar Gala, dri-devel, Ian Campbell, Rob Herring, David Airlie,
Richard Fitzgerald, Jacob Siverskog, Oder Chiou, Adam Thomson,
Pawel Moll, Damien.Horsley, devicetree, Michael Trimarchi,
Takashi Iwai, Vinod Koul, Liam Girdwood, anish kumar,
linux-arm-kernel
Sorry, forgot a head file in patch 1, so resend.
Hi all
This series patch is for rockchip Type-C phy and DisplayPort controller
driver.
The USB Type-C PHY is designed to support the USB3 and DP applications.
The PHY basically has two main components: USB3 and DisplyPort. USB3
operates in SuperSpeed mode and the DP can operate at RBR, HBR and HBR2
data rates. The Type-C cable orientation detection and Power Delivery
(PD) is accomplished using a PD PHY or a exernal PD chip.
The DP controller is compliant with DisplayPort Specification,
Version 1.3, This IP is compatible with the rockchip type-c PHY IP.
There is a uCPU in DP controller, it need a firmware to work, please
put the firmware file to /lib/firmware/cdn/dptx.bin. The uCPU in charge
of aux communication and link training, the host use mailbox to
communicate with the ucpu.
The PHY driver has register a notification, to get the alt mode from PD,
the PD driver need call the tcphy_notifier_call_chain to notify PHY and
DP controller.
This series is based on Mark Yao's branch:
https://github.com/markyzq/kernel-drm-rockchip/tree/drm-rockchip-next-2016-05-23
I test this patches on the rk3399-evb board, with a fusb302 driver,
this branch has no rk3399.dtsi, so the patch about dts is not included
in this series.
Chris Zhong (6):
phy: Add USB Type-C PHY driver for rk3399
Documentation: bindings: add dt doc for Rockchip USB Type-C PHY
drm/rockchip: vop: add cdn DP support for rk3399
Documentation: bindings: add dt documentation for cdn DP controller
ASoC: cdn-dp: Add cdn DP codec driver
ASoC: rockchip: Add machine driver for cdn dp codec
.../bindings/display/rockchip/cdn-dp-rockchip.txt | 57 ++
.../devicetree/bindings/phy/phy-rockchip-typec.txt | 55 ++
.../bindings/sound/rockchip-cdn-dp-audio.txt | 12 +
drivers/gpu/drm/rockchip/Kconfig | 9 +
drivers/gpu/drm/rockchip/Makefile | 1 +
drivers/gpu/drm/rockchip/cdn-dp-core.c | 620 ++++++++++++++++
drivers/gpu/drm/rockchip/cdn-dp-core.h | 95 +++
drivers/gpu/drm/rockchip/cdn-dp-reg.c | 730 ++++++++++++++++++
drivers/gpu/drm/rockchip/cdn-dp-reg.h | 404 ++++++++++
drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 9 +-
drivers/gpu/drm/rockchip/rockchip_drm_vop.h | 2 +
drivers/gpu/drm/rockchip/rockchip_vop_reg.c | 2 +
drivers/phy/Kconfig | 7 +
drivers/phy/Makefile | 1 +
drivers/phy/phy-rockchip-typec.c | 823 +++++++++++++++++++++
include/linux/phy/phy-rockchip-typec.h | 72 ++
include/sound/cdn-dp-audio.h | 51 ++
sound/soc/codecs/Kconfig | 3 +
sound/soc/codecs/Makefile | 2 +
sound/soc/codecs/cdn-dp-audio.c | 246 ++++++
sound/soc/rockchip/Kconfig | 9 +
sound/soc/rockchip/Makefile | 2 +
sound/soc/rockchip/rockchip-cdn-dp-audio.c | 167 +++++
23 files changed, 3378 insertions(+), 1 deletion(-)
create mode 100644 Documentation/devicetree/bindings/display/rockchip/cdn-dp-rockchip.txt
create mode 100644 Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt
create mode 100644 Documentation/devicetree/bindings/sound/rockchip-cdn-dp-audio.txt
create mode 100644 drivers/gpu/drm/rockchip/cdn-dp-core.c
create mode 100644 drivers/gpu/drm/rockchip/cdn-dp-core.h
create mode 100644 drivers/gpu/drm/rockchip/cdn-dp-reg.c
create mode 100644 drivers/gpu/drm/rockchip/cdn-dp-reg.h
create mode 100644 drivers/phy/phy-rockchip-typec.c
create mode 100644 include/linux/phy/phy-rockchip-typec.h
create mode 100644 include/sound/cdn-dp-audio.h
create mode 100644 sound/soc/codecs/cdn-dp-audio.c
create mode 100644 sound/soc/rockchip/rockchip-cdn-dp-audio.c
--
2.6.3
^ permalink raw reply [flat|nested] 8+ messages in thread[parent not found: <1464345942-4795-1-git-send-email-zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org>]
* [RESEND PATCH 2/6] Documentation: bindings: add dt doc for Rockchip USB Type-C PHY [not found] ` <1464345942-4795-1-git-send-email-zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org> @ 2016-05-27 10:45 ` Chris Zhong 2016-06-01 14:54 ` Rob Herring 0 siblings, 1 reply; 8+ messages in thread From: Chris Zhong @ 2016-05-27 10:45 UTC (permalink / raw) To: dianders-F7+t8E8rja9g9hUCZPvPmw, tfiga-F7+t8E8rja9g9hUCZPvPmw, heiko-4mtYJXux2i+zQB+pC5nmwQ, yzq-TNX95d0MmH7DzftRWevZcw Cc: Mark Rutland, devicetree-u79uwXL29TY76Z2rM5mHXA, Pawel Moll, Ian Campbell, linux-kernel-u79uwXL29TY76Z2rM5mHXA, linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, Rob Herring, Kumar Gala, Chris Zhong, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r This patch adds a binding that describes the Rockchip USB Type-C PHY for rk3399. Signed-off-by: Chris Zhong <zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org> --- .../devicetree/bindings/phy/phy-rockchip-typec.txt | 55 ++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt diff --git a/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt b/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt new file mode 100644 index 0000000..402f667 --- /dev/null +++ b/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt @@ -0,0 +1,55 @@ +ROCKCHIP type-c PHY + +Required properties: + - compatible: should be "rockchip,rk3399-typec-phy" + - reg : Address and length of the usb phy control register set + - rockchip,grf : phandle to the syscon managing the "general + register files" + - clocks : phandle + clock specifier for the phy clocks + - clock-names: string, clock name, must be "tcpdcore", "tcpdphy_ref"; + - resets : a list of phandle + reset specifier pairs + - reset-names : string reset name, must be: + "tcphy_rst", "tcphy_pipe_rst", "uphy_tcphy_rst" + - #phy-cells: Must be 0. See ./phy-bindings.txt for details. + - rockchip,usb3phy*: phy registers embed in grf + +Example: + tcphy0: phy@ff7c0000 { + compatible = "rockchip,rk3399-typec-phy"; + reg = <0x0 0xff7c0000 0x0 0x40000>; + #phy-cells = <0>; + rockchip,grf = <&grf>; + clocks = <&cru SCLK_UPHY0_TCPDCORE>, + <&cru SCLK_UPHY0_TCPDPHY_REF>; + clock-names = "tcpdcore", "tcpdphy_ref"; + resets = <&cru SRST_UPHY0>, + <&cru SRST_UPHY0_PIPE_L00>, + <&cru SRST_P_UPHY0_TCPHY>; + reset-names = "tcphy_rst", "tcphy_pipe_rst", "uphy_tcphy_rst"; + rockchip,usb3phy_con0 = <0x0e580 0 16>; + rockchip,usb3phy_con1 = <0x0e584 0 16>; + rockchip,usb3phy_con2 = <0x0e588 0 16>; + rockchip,usb3phy_status0 = <0x0e5c0 0 13>; + rockchip,usb3phy_status1 = <0x0e5c4 0 12>; + status = "disabled"; + }; + + tcphy1: phy@ff800000 { + compatible = "rockchip,rk3399-typec-phy"; + reg = <0x0 0xff800000 0x0 0x40000>; + #phy-cells = <0>; + rockchip,grf = <&grf>; + clocks = <&cru SCLK_UPHY1_TCPDCORE>, + <&cru SCLK_UPHY1_TCPDPHY_REF>; + clock-names = "tcpdcore", "tcpdphy_ref"; + resets = <&cru SRST_UPHY1>, + <&cru SRST_UPHY1_PIPE_L00>, + <&cru SRST_P_UPHY1_TCPHY>; + reset-names = "tcphy_rst", "tcphy_pipe_rst", "uphy_tcphy_rst"; + rockchip,usb3phy_con0 = <0x0e58c 0 16>; + rockchip,usb3phy_con1 = <0x0e590 0 16>; + rockchip,usb3phy_con2 = <0x0e594 0 16>; + rockchip,usb3phy_status0 = <0x0e5c0 16 13>; + rockchip,usb3phy_status1 = <0x0e5c4 16 12>; + status = "disabled"; + }; -- 2.6.3 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [RESEND PATCH 2/6] Documentation: bindings: add dt doc for Rockchip USB Type-C PHY 2016-05-27 10:45 ` [RESEND PATCH 2/6] Documentation: bindings: add dt doc for Rockchip USB Type-C PHY Chris Zhong @ 2016-06-01 14:54 ` Rob Herring 2016-06-01 15:35 ` Chris Zhong 0 siblings, 1 reply; 8+ messages in thread From: Rob Herring @ 2016-06-01 14:54 UTC (permalink / raw) To: Chris Zhong Cc: dianders, tfiga, heiko, yzq, linux-rockchip, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, devicetree, linux-arm-kernel, linux-kernel On Fri, May 27, 2016 at 06:45:38PM +0800, Chris Zhong wrote: > This patch adds a binding that describes the Rockchip USB Type-C PHY > for rk3399. > > Signed-off-by: Chris Zhong <zyw@rock-chips.com> > --- > > .../devicetree/bindings/phy/phy-rockchip-typec.txt | 55 ++++++++++++++++++++++ > 1 file changed, 55 insertions(+) > create mode 100644 Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt > > diff --git a/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt b/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt > new file mode 100644 > index 0000000..402f667 > --- /dev/null > +++ b/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt > @@ -0,0 +1,55 @@ > +ROCKCHIP type-c PHY > + > +Required properties: > + - compatible: should be "rockchip,rk3399-typec-phy" > + - reg : Address and length of the usb phy control register set > + - rockchip,grf : phandle to the syscon managing the "general > + register files" > + - clocks : phandle + clock specifier for the phy clocks > + - clock-names: string, clock name, must be "tcpdcore", "tcpdphy_ref"; > + - resets : a list of phandle + reset specifier pairs > + - reset-names : string reset name, must be: > + "tcphy_rst", "tcphy_pipe_rst", "uphy_tcphy_rst" > + - #phy-cells: Must be 0. See ./phy-bindings.txt for details. > + - rockchip,usb3phy*: phy registers embed in grf You need to document each one and state the number of cells and what the contain. Also, don't use '_' in the names. > + > +Example: > + tcphy0: phy@ff7c0000 { > + compatible = "rockchip,rk3399-typec-phy"; > + reg = <0x0 0xff7c0000 0x0 0x40000>; > + #phy-cells = <0>; > + rockchip,grf = <&grf>; > + clocks = <&cru SCLK_UPHY0_TCPDCORE>, > + <&cru SCLK_UPHY0_TCPDPHY_REF>; > + clock-names = "tcpdcore", "tcpdphy_ref"; > + resets = <&cru SRST_UPHY0>, > + <&cru SRST_UPHY0_PIPE_L00>, > + <&cru SRST_P_UPHY0_TCPHY>; > + reset-names = "tcphy_rst", "tcphy_pipe_rst", "uphy_tcphy_rst"; > + rockchip,usb3phy_con0 = <0x0e580 0 16>; > + rockchip,usb3phy_con1 = <0x0e584 0 16>; > + rockchip,usb3phy_con2 = <0x0e588 0 16>; > + rockchip,usb3phy_status0 = <0x0e5c0 0 13>; > + rockchip,usb3phy_status1 = <0x0e5c4 0 12>; > + status = "disabled"; > + }; > + > + tcphy1: phy@ff800000 { > + compatible = "rockchip,rk3399-typec-phy"; > + reg = <0x0 0xff800000 0x0 0x40000>; > + #phy-cells = <0>; > + rockchip,grf = <&grf>; > + clocks = <&cru SCLK_UPHY1_TCPDCORE>, > + <&cru SCLK_UPHY1_TCPDPHY_REF>; > + clock-names = "tcpdcore", "tcpdphy_ref"; > + resets = <&cru SRST_UPHY1>, > + <&cru SRST_UPHY1_PIPE_L00>, > + <&cru SRST_P_UPHY1_TCPHY>; > + reset-names = "tcphy_rst", "tcphy_pipe_rst", "uphy_tcphy_rst"; > + rockchip,usb3phy_con0 = <0x0e58c 0 16>; > + rockchip,usb3phy_con1 = <0x0e590 0 16>; > + rockchip,usb3phy_con2 = <0x0e594 0 16>; > + rockchip,usb3phy_status0 = <0x0e5c0 16 13>; > + rockchip,usb3phy_status1 = <0x0e5c4 16 12>; > + status = "disabled"; > + }; > -- > 2.6.3 > ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [RESEND PATCH 2/6] Documentation: bindings: add dt doc for Rockchip USB Type-C PHY 2016-06-01 14:54 ` Rob Herring @ 2016-06-01 15:35 ` Chris Zhong 0 siblings, 0 replies; 8+ messages in thread From: Chris Zhong @ 2016-06-01 15:35 UTC (permalink / raw) To: Rob Herring Cc: dianders, tfiga, heiko, yzq, linux-rockchip, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, devicetree, linux-arm-kernel, linux-kernel Hi Rob On 06/01/2016 10:54 PM, Rob Herring wrote: > On Fri, May 27, 2016 at 06:45:38PM +0800, Chris Zhong wrote: >> This patch adds a binding that describes the Rockchip USB Type-C PHY >> for rk3399. >> >> Signed-off-by: Chris Zhong <zyw@rock-chips.com> >> --- >> >> .../devicetree/bindings/phy/phy-rockchip-typec.txt | 55 ++++++++++++++++++++++ >> 1 file changed, 55 insertions(+) >> create mode 100644 Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt >> >> diff --git a/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt b/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt >> new file mode 100644 >> index 0000000..402f667 >> --- /dev/null >> +++ b/Documentation/devicetree/bindings/phy/phy-rockchip-typec.txt >> @@ -0,0 +1,55 @@ >> +ROCKCHIP type-c PHY >> + >> +Required properties: >> + - compatible: should be "rockchip,rk3399-typec-phy" >> + - reg : Address and length of the usb phy control register set >> + - rockchip,grf : phandle to the syscon managing the "general >> + register files" >> + - clocks : phandle + clock specifier for the phy clocks >> + - clock-names: string, clock name, must be "tcpdcore", "tcpdphy_ref"; >> + - resets : a list of phandle + reset specifier pairs >> + - reset-names : string reset name, must be: >> + "tcphy_rst", "tcphy_pipe_rst", "uphy_tcphy_rst" >> + - #phy-cells: Must be 0. See ./phy-bindings.txt for details. >> + - rockchip,usb3phy*: phy registers embed in grf > You need to document each one and state the number of cells and what the > contain. Also, don't use '_' in the names. I am going to move these registers to phy driver, Thanks for your comment. > >> + >> +Example: >> + tcphy0: phy@ff7c0000 { >> + compatible = "rockchip,rk3399-typec-phy"; >> + reg = <0x0 0xff7c0000 0x0 0x40000>; >> + #phy-cells = <0>; >> + rockchip,grf = <&grf>; >> + clocks = <&cru SCLK_UPHY0_TCPDCORE>, >> + <&cru SCLK_UPHY0_TCPDPHY_REF>; >> + clock-names = "tcpdcore", "tcpdphy_ref"; >> + resets = <&cru SRST_UPHY0>, >> + <&cru SRST_UPHY0_PIPE_L00>, >> + <&cru SRST_P_UPHY0_TCPHY>; >> + reset-names = "tcphy_rst", "tcphy_pipe_rst", "uphy_tcphy_rst"; >> + rockchip,usb3phy_con0 = <0x0e580 0 16>; >> + rockchip,usb3phy_con1 = <0x0e584 0 16>; >> + rockchip,usb3phy_con2 = <0x0e588 0 16>; >> + rockchip,usb3phy_status0 = <0x0e5c0 0 13>; >> + rockchip,usb3phy_status1 = <0x0e5c4 0 12>; >> + status = "disabled"; >> + }; >> + >> + tcphy1: phy@ff800000 { >> + compatible = "rockchip,rk3399-typec-phy"; >> + reg = <0x0 0xff800000 0x0 0x40000>; >> + #phy-cells = <0>; >> + rockchip,grf = <&grf>; >> + clocks = <&cru SCLK_UPHY1_TCPDCORE>, >> + <&cru SCLK_UPHY1_TCPDPHY_REF>; >> + clock-names = "tcpdcore", "tcpdphy_ref"; >> + resets = <&cru SRST_UPHY1>, >> + <&cru SRST_UPHY1_PIPE_L00>, >> + <&cru SRST_P_UPHY1_TCPHY>; >> + reset-names = "tcphy_rst", "tcphy_pipe_rst", "uphy_tcphy_rst"; >> + rockchip,usb3phy_con0 = <0x0e58c 0 16>; >> + rockchip,usb3phy_con1 = <0x0e590 0 16>; >> + rockchip,usb3phy_con2 = <0x0e594 0 16>; >> + rockchip,usb3phy_status0 = <0x0e5c0 16 13>; >> + rockchip,usb3phy_status1 = <0x0e5c4 16 12>; >> + status = "disabled"; >> + }; >> -- >> 2.6.3 >> > > ^ permalink raw reply [flat|nested] 8+ messages in thread
* [RESEND PATCH 4/6] Documentation: bindings: add dt documentation for cdn DP controller 2016-05-27 10:45 [RESEND PATCH 0/6] Rockchip Type-C and DispplayPort driver Chris Zhong [not found] ` <1464345942-4795-1-git-send-email-zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org> @ 2016-05-27 10:45 ` Chris Zhong 2016-06-01 14:56 ` Rob Herring 2016-05-27 10:45 ` [RESEND PATCH 6/6] ASoC: rockchip: Add machine driver for cdn dp codec Chris Zhong 2 siblings, 1 reply; 8+ messages in thread From: Chris Zhong @ 2016-05-27 10:45 UTC (permalink / raw) To: dianders, tfiga, heiko, yzq Cc: Mark Rutland, devicetree, Pawel Moll, Ian Campbell, linux-kernel, dri-devel, linux-rockchip, Rob Herring, Kumar Gala, Chris Zhong, linux-arm-kernel This patch adds a binding that describes the cdn DP controller for rk3399. Signed-off-by: Chris Zhong <zyw@rock-chips.com> --- .../bindings/display/rockchip/cdn-dp-rockchip.txt | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/rockchip/cdn-dp-rockchip.txt diff --git a/Documentation/devicetree/bindings/display/rockchip/cdn-dp-rockchip.txt b/Documentation/devicetree/bindings/display/rockchip/cdn-dp-rockchip.txt new file mode 100644 index 0000000..60795c2 --- /dev/null +++ b/Documentation/devicetree/bindings/display/rockchip/cdn-dp-rockchip.txt @@ -0,0 +1,57 @@ +Rockchip RK3399 specific extensions to the cdn Display Port +================================ + +Required properties: +- compatible: "rockchip,cdn-dp" + +- reg: physical base address of the controller and length + +- clocks: from common clock binding: handle to dp clock. + +- clock-names: from common clock binding: + Required elements: "core_clk" "pclk" "spdif" + +- rockchip,grf: this soc should set GRF regs, so need get grf here. + +- ports: contain a port nodes with endpoint definitions as defined in + Documentation/devicetree/bindings/media/video-interfaces.txt. + contained 2 endpoints, connecting to the output of vop. + +- phys: from general PHY binding: the phandle for the PHY device. + +------------------------------------------------------------------------------- + +Example: + cdn_dp: dp@fec00000 { + compatible = "rockchip,cdn-dp"; + reg = <0x0 0xfec00000 0x0 0x100000>; + interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&cru SCLK_DP_CORE>, <&cru PCLK_DP_CTRL>, + <&cru SCLK_SPDIF_REC_DPTX>; + clock-names = "core_clk", "pclk", "spdif"; + phys = <&tcphy0>; + rockchip,grf = <&grf>; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + + ports { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + dp_in: port { + #address-cells = <1>; + #size-cells = <0>; + dp_in_vopb: endpoint@0 { + reg = <0>; + remote-endpoint = <&vopb_out_dp>; + }; + + dp_in_vopl: endpoint@1 { + reg = <1>; + remote-endpoint = <&vopl_out_dp>; + }; + }; + }; + }; -- 2.6.3 _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [RESEND PATCH 4/6] Documentation: bindings: add dt documentation for cdn DP controller 2016-05-27 10:45 ` [RESEND PATCH 4/6] Documentation: bindings: add dt documentation for cdn DP controller Chris Zhong @ 2016-06-01 14:56 ` Rob Herring 0 siblings, 0 replies; 8+ messages in thread From: Rob Herring @ 2016-06-01 14:56 UTC (permalink / raw) To: Chris Zhong Cc: Mark Rutland, devicetree, Pawel Moll, Ian Campbell, yzq, linux-kernel, dianders, dri-devel, tfiga, linux-rockchip, Kumar Gala, linux-arm-kernel On Fri, May 27, 2016 at 06:45:40PM +0800, Chris Zhong wrote: > This patch adds a binding that describes the cdn DP controller for > rk3399. > > Signed-off-by: Chris Zhong <zyw@rock-chips.com> > --- > > .../bindings/display/rockchip/cdn-dp-rockchip.txt | 57 ++++++++++++++++++++++ > 1 file changed, 57 insertions(+) > create mode 100644 Documentation/devicetree/bindings/display/rockchip/cdn-dp-rockchip.txt > > diff --git a/Documentation/devicetree/bindings/display/rockchip/cdn-dp-rockchip.txt b/Documentation/devicetree/bindings/display/rockchip/cdn-dp-rockchip.txt > new file mode 100644 > index 0000000..60795c2 > --- /dev/null > +++ b/Documentation/devicetree/bindings/display/rockchip/cdn-dp-rockchip.txt > @@ -0,0 +1,57 @@ > +Rockchip RK3399 specific extensions to the cdn Display Port > +================================ > + > +Required properties: > +- compatible: "rockchip,cdn-dp" Needs to be more specific. > + > +- reg: physical base address of the controller and length > + > +- clocks: from common clock binding: handle to dp clock. > + > +- clock-names: from common clock binding: > + Required elements: "core_clk" "pclk" "spdif" > + > +- rockchip,grf: this soc should set GRF regs, so need get grf here. > + > +- ports: contain a port nodes with endpoint definitions as defined in > + Documentation/devicetree/bindings/media/video-interfaces.txt. > + contained 2 endpoints, connecting to the output of vop. > + > +- phys: from general PHY binding: the phandle for the PHY device. > + > +------------------------------------------------------------------------------- > + > +Example: > + cdn_dp: dp@fec00000 { > + compatible = "rockchip,cdn-dp"; > + reg = <0x0 0xfec00000 0x0 0x100000>; > + interrupts = <GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>; > + clocks = <&cru SCLK_DP_CORE>, <&cru PCLK_DP_CTRL>, > + <&cru SCLK_SPDIF_REC_DPTX>; > + clock-names = "core_clk", "pclk", "spdif"; > + phys = <&tcphy0>; > + rockchip,grf = <&grf>; > + #address-cells = <1>; > + #size-cells = <0>; > + status = "disabled"; > + > + ports { > + #address-cells = <1>; > + #size-cells = <0>; > + reg = <1>; > + > + dp_in: port { > + #address-cells = <1>; > + #size-cells = <0>; > + dp_in_vopb: endpoint@0 { > + reg = <0>; > + remote-endpoint = <&vopb_out_dp>; > + }; > + > + dp_in_vopl: endpoint@1 { > + reg = <1>; > + remote-endpoint = <&vopl_out_dp>; > + }; > + }; > + }; > + }; > -- > 2.6.3 > _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ^ permalink raw reply [flat|nested] 8+ messages in thread
* [RESEND PATCH 6/6] ASoC: rockchip: Add machine driver for cdn dp codec 2016-05-27 10:45 [RESEND PATCH 0/6] Rockchip Type-C and DispplayPort driver Chris Zhong [not found] ` <1464345942-4795-1-git-send-email-zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org> 2016-05-27 10:45 ` [RESEND PATCH 4/6] Documentation: bindings: add dt documentation for cdn DP controller Chris Zhong @ 2016-05-27 10:45 ` Chris Zhong 2016-06-01 14:57 ` Rob Herring 2 siblings, 1 reply; 8+ messages in thread From: Chris Zhong @ 2016-05-27 10:45 UTC (permalink / raw) To: dianders, tfiga, heiko, yzq Cc: linux-rockchip, Chris Zhong, Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai, devicetree, linux-arm-kernel, linux-kernel, alsa-devel The driver is used for cdn dp codec embedded in rk3399 Signed-off-by: Chris Zhong <zyw@rock-chips.com> --- .../bindings/sound/rockchip-cdn-dp-audio.txt | 12 ++ sound/soc/rockchip/Kconfig | 9 ++ sound/soc/rockchip/Makefile | 2 + sound/soc/rockchip/rockchip-cdn-dp-audio.c | 167 +++++++++++++++++++++ 4 files changed, 190 insertions(+) create mode 100644 Documentation/devicetree/bindings/sound/rockchip-cdn-dp-audio.txt create mode 100644 sound/soc/rockchip/rockchip-cdn-dp-audio.c diff --git a/Documentation/devicetree/bindings/sound/rockchip-cdn-dp-audio.txt b/Documentation/devicetree/bindings/sound/rockchip-cdn-dp-audio.txt new file mode 100644 index 0000000..b7b0898 --- /dev/null +++ b/Documentation/devicetree/bindings/sound/rockchip-cdn-dp-audio.txt @@ -0,0 +1,12 @@ +Rockchip cdn dp audio bindings + +Required properties: +- compatible: platform specific, must be "rockchip,cdn-dp-audio" +- i2s-controller: the device of i2s controller + +Example: + + cdn_dp_audio: cdn-dp_audio { + compatible = "rockchip,cdn-dp-audio"; + i2s-controller = <&i2s2>; + }; diff --git a/sound/soc/rockchip/Kconfig b/sound/soc/rockchip/Kconfig index f1e0c70..7e7d905 100644 --- a/sound/soc/rockchip/Kconfig +++ b/sound/soc/rockchip/Kconfig @@ -15,6 +15,15 @@ config SND_SOC_ROCKCHIP_I2S Rockchip I2S device. The device supports upto maximum of 8 channels each for play and record. +config SND_SOC_ROCKCHIP_CDN_DP_AUDIO + tristate "cdn DP audio support" + depends on ROCKCHIP_CDN_DP + select SND_SOC_ROCKCHIP_I2S + select SND_SOC_CDN_DP_AUDIO + help + Say Y or M here if you want to add support for SoC audio on Rockchip + boards using the cdn dp codec, such as RK3399. + config SND_SOC_ROCKCHIP_SPDIF tristate "Rockchip SPDIF Device Driver" depends on CLKDEV_LOOKUP && SND_SOC_ROCKCHIP diff --git a/sound/soc/rockchip/Makefile b/sound/soc/rockchip/Makefile index c0bf560..9367f55 100644 --- a/sound/soc/rockchip/Makefile +++ b/sound/soc/rockchip/Makefile @@ -5,8 +5,10 @@ snd-soc-rockchip-spdif-objs := rockchip_spdif.o obj-$(CONFIG_SND_SOC_ROCKCHIP_I2S) += snd-soc-rockchip-i2s.o obj-$(CONFIG_SND_SOC_ROCKCHIP_SPDIF) += snd-soc-rockchip-spdif.o +snd-soc-rockchip-cdn-dp-objs := rockchip-cdn-dp-audio.o snd-soc-rockchip-max98090-objs := rockchip_max98090.o snd-soc-rockchip-rt5645-objs := rockchip_rt5645.o +obj-$(CONFIG_SND_SOC_ROCKCHIP_CDN_DP_AUDIO) += snd-soc-rockchip-cdn-dp.o obj-$(CONFIG_SND_SOC_ROCKCHIP_MAX98090) += snd-soc-rockchip-max98090.o obj-$(CONFIG_SND_SOC_ROCKCHIP_RT5645) += snd-soc-rockchip-rt5645.o diff --git a/sound/soc/rockchip/rockchip-cdn-dp-audio.c b/sound/soc/rockchip/rockchip-cdn-dp-audio.c new file mode 100644 index 0000000..2bf6649 --- /dev/null +++ b/sound/soc/rockchip/rockchip-cdn-dp-audio.c @@ -0,0 +1,167 @@ +/* + * rockchip-cdn-dp-card.c + * + * ROCKCHIP ALSA SoC DAI driver for cdn dp audio on rockchip processors. + * + * Copyright (C) 2016 Chris Zhong <zyw@rock-chips.com> + * Copyright (C) 2016 ROCKCHIP, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include <linux/module.h> +#include <linux/platform_device.h> + +#include <sound/soc.h> +#include <sound/pcm.h> +#include <sound/core.h> +#include <sound/pcm_params.h> + +#include "rockchip_i2s.h" + +#define DRV_NAME "rockchip-cdn-dp-audio" + +static int cdn_dp_audio_hw_params(struct snd_pcm_substream *substream, + struct snd_pcm_hw_params *params) +{ + struct snd_soc_pcm_runtime *rtd = substream->private_data; + struct snd_soc_dai *cpu_dai = rtd->cpu_dai; + unsigned int dai_fmt = rtd->dai_link->dai_fmt; + int mclk, ret; + + switch (params_rate(params)) { + case 8000: + case 16000: + case 24000: + case 32000: + case 48000: + case 64000: + case 96000: + mclk = 12288000; + break; + case 11025: + case 22050: + case 44100: + case 88200: + mclk = 11289600; + break; + default: + return -EINVAL; + } + + ret = snd_soc_dai_set_fmt(cpu_dai, dai_fmt); + if (ret < 0) { + dev_err(cpu_dai->dev, "failed to set cpu_dai fmt.\n"); + return ret; + } + + ret = snd_soc_dai_set_sysclk(cpu_dai, 0, mclk, SND_SOC_CLOCK_OUT); + if (ret < 0) { + dev_err(cpu_dai->dev, "failed to set cpu_dai sysclk.\n"); + return ret; + } + + return 0; +} + +static struct snd_soc_ops cdn_dp_dai_ops = { + .hw_params = cdn_dp_audio_hw_params, +}; + +static struct snd_soc_dai_link cdn_dp_dai = { + .name = "cdn_dp", + .stream_name = "cdn_dp", + .codec_name = "cdn-dp-audio", + .codec_dai_name = "cdn-dp-hifi", + .ops = &cdn_dp_dai_ops, + .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | + SND_SOC_DAIFMT_CBS_CFS, +}; + +static struct snd_soc_card cdn_dp_audio_card = { + .name = "cdn_dp", + .owner = THIS_MODULE, + .dai_link = &cdn_dp_dai, + .num_links = 1, +}; + +static int cdn_dp_audio_probe(struct platform_device *pdev) +{ + struct snd_soc_card *card = &cdn_dp_audio_card; + struct device_node *np = pdev->dev.of_node; + int ret; + + card->dev = &pdev->dev; + platform_set_drvdata(pdev, card); + + cdn_dp_dai.cpu_of_node = of_parse_phandle(np, "i2s-controller", 0); + if (!cdn_dp_dai.cpu_of_node) { + dev_err(&pdev->dev, "Property 'i2s-controller' missing !\n"); + goto free_priv_data; + } + + cdn_dp_dai.platform_of_node = cdn_dp_dai.cpu_of_node; + + ret = snd_soc_register_card(card); + if (ret) { + dev_err(&pdev->dev, "register card failed (%d)\n", ret); + card->dev = NULL; + goto free_cpu_of_node; + } + + dev_info(&pdev->dev, "rockchip cdn dp audio init success.\n"); + + return 0; + +free_cpu_of_node: + cdn_dp_dai.cpu_of_node = NULL; + cdn_dp_dai.platform_of_node = NULL; +free_priv_data: + snd_soc_card_set_drvdata(card, NULL); + platform_set_drvdata(pdev, NULL); + card->dev = NULL; + + return ret; +} + +static int cdn_dp_audio_remove(struct platform_device *pdev) +{ + struct snd_soc_card *card = platform_get_drvdata(pdev); + + snd_soc_unregister_card(card); + snd_soc_card_set_drvdata(card, NULL); + platform_set_drvdata(pdev, NULL); + card->dev = NULL; + + return 0; +} + +static const struct of_device_id cdn_dp_audio_of_match[] = { + { .compatible = "rockchip,cdn-dp-audio", }, + {}, +}; + +static struct platform_driver cdn_dp_audio_driver = { + .driver = { + .name = DRV_NAME, + .owner = THIS_MODULE, + .pm = &snd_soc_pm_ops, + .of_match_table = cdn_dp_audio_of_match, + }, + .probe = cdn_dp_audio_probe, + .remove = cdn_dp_audio_remove, +}; +module_platform_driver(cdn_dp_audio_driver); + +MODULE_AUTHOR("Chris Zhong <zyw@rock-chips.com>"); +MODULE_DESCRIPTION("CDN DP Audio ASoC Interface"); +MODULE_LICENSE("GPL"); +MODULE_ALIAS("platform:" DRV_NAME); +MODULE_DEVICE_TABLE(of, cdn_dp_audio_of_match); -- 2.6.3 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [RESEND PATCH 6/6] ASoC: rockchip: Add machine driver for cdn dp codec 2016-05-27 10:45 ` [RESEND PATCH 6/6] ASoC: rockchip: Add machine driver for cdn dp codec Chris Zhong @ 2016-06-01 14:57 ` Rob Herring 0 siblings, 0 replies; 8+ messages in thread From: Rob Herring @ 2016-06-01 14:57 UTC (permalink / raw) To: Chris Zhong Cc: dianders, tfiga, heiko, yzq, linux-rockchip, Pawel Moll, Mark Rutland, Ian Campbell, Kumar Gala, Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai, devicetree, linux-arm-kernel, linux-kernel, alsa-devel On Fri, May 27, 2016 at 06:45:42PM +0800, Chris Zhong wrote: > The driver is used for cdn dp codec embedded in rk3399 > > Signed-off-by: Chris Zhong <zyw@rock-chips.com> > > --- > > .../bindings/sound/rockchip-cdn-dp-audio.txt | 12 ++ Acked-by: Rob Herring <robh@kernel.org> > sound/soc/rockchip/Kconfig | 9 ++ > sound/soc/rockchip/Makefile | 2 + > sound/soc/rockchip/rockchip-cdn-dp-audio.c | 167 +++++++++++++++++++++ > 4 files changed, 190 insertions(+) > create mode 100644 Documentation/devicetree/bindings/sound/rockchip-cdn-dp-audio.txt > create mode 100644 sound/soc/rockchip/rockchip-cdn-dp-audio.c ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2016-06-01 15:35 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-27 10:45 [RESEND PATCH 0/6] Rockchip Type-C and DispplayPort driver Chris Zhong
[not found] ` <1464345942-4795-1-git-send-email-zyw-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-05-27 10:45 ` [RESEND PATCH 2/6] Documentation: bindings: add dt doc for Rockchip USB Type-C PHY Chris Zhong
2016-06-01 14:54 ` Rob Herring
2016-06-01 15:35 ` Chris Zhong
2016-05-27 10:45 ` [RESEND PATCH 4/6] Documentation: bindings: add dt documentation for cdn DP controller Chris Zhong
2016-06-01 14:56 ` Rob Herring
2016-05-27 10:45 ` [RESEND PATCH 6/6] ASoC: rockchip: Add machine driver for cdn dp codec Chris Zhong
2016-06-01 14:57 ` Rob Herring
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).