You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge tag 'clk-for-linus-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux
Pull clk updates from Michael Turquette:
"The bulk of the changes are updates and fixes to existing clk provider
drivers, along with a pretty standard number of new drivers. The core
recieved a small number of updates as well.
Core changes of note:
- removed CLK_IS_ROOT flag
New clk provider drivers:
- Renesas r8a7796 clock pulse generator / module standby and
software reset
- Allwinner sun8i H3 clock controller unit
- AmLogic meson8b clock controller (rewritten)
- AmLogic gxbb clock controller
- support for some new ICs was added by simple changes to static
data tables for chips sharing the same family
Driver updates of note:
- the Allwinner sunxi clock driver infrastucture was rewritten to
comform to the state of the art at drivers/clk/sunxi-ng. The old
implementation is still supported for backwards compatibility with
the DT ABI"
* tag 'clk-for-linus-4.8' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: (162 commits)
clk: Makefile: re-sort and clean up
Revert "clk: gxbb: expose CLKID_MMC_PCLK"
clk: samsung: Allow modular build of the Audio Subsystem CLKCON driver
clk: samsung: make clk-s5pv210-audss explicitly non-modular
clk: exynos5433: remove CLK_IGNORE_UNUSED flag from SPI clocks
clk: oxnas: Add hardware dependencies
clk: imx7d: do not set parent of ethernet time/ref clocks
ARM: dt: sun8i: switch the H3 to the new CCU driver
clk: sunxi-ng: h3: Fix Kconfig symbol typo
clk: sunxi-ng: h3: Fix audio clock divider offset
clk: sunxi-ng: Add H3 clocks
clk: sunxi-ng: Add N-K-M-P factor clock
clk: sunxi-ng: Add N-K-M Factor clock
clk: sunxi-ng: Add N-M-factor clock support
clk: sunxi-ng: Add N-K-factor clock support
clk: sunxi-ng: Add M-P factor clock support
clk: sunxi-ng: Add divider
clk: sunxi-ng: Add phase clock support
clk: sunxi-ng: Add mux clock support
clk: sunxi-ng: Add gate clock support
...
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
* Amlogic GXBB Clock and Reset Unit
|
||||
|
||||
The Amlogic GXBB clock controller generates and supplies clock to various
|
||||
controllers within the SoC.
|
||||
|
||||
Required Properties:
|
||||
|
||||
- compatible: should be "amlogic,gxbb-clkc"
|
||||
- reg: physical base address of the clock controller and length of memory
|
||||
mapped region.
|
||||
|
||||
- #clock-cells: should be 1.
|
||||
|
||||
Each clock is assigned an identifier and client nodes can use this identifier
|
||||
to specify the clock which they consume. All available clocks are defined as
|
||||
preprocessor macros in the dt-bindings/clock/gxbb-clkc.h header and can be
|
||||
used in device tree sources.
|
||||
|
||||
Example: Clock controller node:
|
||||
|
||||
clkc: clock-controller@c883c000 {
|
||||
#clock-cells = <1>;
|
||||
compatible = "amlogic,gxbb-clkc";
|
||||
reg = <0x0 0xc883c000 0x0 0x3db>;
|
||||
};
|
||||
|
||||
Example: UART controller node that consumes the clock generated by the clock
|
||||
controller:
|
||||
|
||||
uart_AO: serial@c81004c0 {
|
||||
compatible = "amlogic,meson-uart";
|
||||
reg = <0xc81004c0 0x14>;
|
||||
interrupts = <0 90 1>;
|
||||
clocks = <&clkc CLKID_CLK81>;
|
||||
status = "disabled";
|
||||
};
|
||||
@@ -14,6 +14,10 @@ Required properties:
|
||||
Optional properties:
|
||||
- clock-output-names : From common clock binding.
|
||||
|
||||
Some clocks that require special treatments are also handled by that
|
||||
driver, with the compatibles:
|
||||
- allwinner,sun4i-a10-pll3-2x-clk
|
||||
|
||||
Example:
|
||||
clock {
|
||||
compatible = "fixed-factor-clock";
|
||||
|
||||
@@ -13,7 +13,8 @@ They provide the following functionalities:
|
||||
|
||||
Required Properties:
|
||||
- compatible: Must be one of:
|
||||
- "renesas,r8a7795-cpg-mssr" for the r8a7795 SoC
|
||||
- "renesas,r8a7795-cpg-mssr" for the r8a7795 SoC (R-Car H3)
|
||||
- "renesas,r8a7796-cpg-mssr" for the r8a7796 SoC (R-Car M3-W)
|
||||
|
||||
- reg: Base address and length of the memory resource used by the CPG/MSSR
|
||||
block
|
||||
@@ -21,8 +22,8 @@ Required Properties:
|
||||
- clocks: References to external parent clocks, one entry for each entry in
|
||||
clock-names
|
||||
- clock-names: List of external parent clock names. Valid names are:
|
||||
- "extal" (r8a7795)
|
||||
- "extalr" (r8a7795)
|
||||
- "extal" (r8a7795, r8a7796)
|
||||
- "extalr" (r8a7795, r8a7796)
|
||||
|
||||
- #clock-cells: Must be 2
|
||||
- For CPG core clocks, the two clock specifier cells must be "CPG_CORE"
|
||||
|
||||
@@ -17,6 +17,7 @@ Required Properties:
|
||||
- "renesas,r8a7779-mstp-clocks" for R8A7779 (R-Car H1) MSTP gate clocks
|
||||
- "renesas,r8a7790-mstp-clocks" for R8A7790 (R-Car H2) MSTP gate clocks
|
||||
- "renesas,r8a7791-mstp-clocks" for R8A7791 (R-Car M2-W) MSTP gate clocks
|
||||
- "renesas,r8a7792-mstp-clocks" for R8A7792 (R-Car V2H) MSTP gate clocks
|
||||
- "renesas,r8a7793-mstp-clocks" for R8A7793 (R-Car M2-N) MSTP gate clocks
|
||||
- "renesas,r8a7794-mstp-clocks" for R8A7794 (R-Car E2) MSTP gate clocks
|
||||
- "renesas,sh73a0-mstp-clocks" for SH73A0 (SH-MobileAG5) MSTP gate clocks
|
||||
|
||||
@@ -10,6 +10,7 @@ Required Properties:
|
||||
- compatible: Must be one of
|
||||
- "renesas,r8a7790-cpg-clocks" for the r8a7790 CPG
|
||||
- "renesas,r8a7791-cpg-clocks" for the r8a7791 CPG
|
||||
- "renesas,r8a7792-cpg-clocks" for the r8a7792 CPG
|
||||
- "renesas,r8a7793-cpg-clocks" for the r8a7793 CPG
|
||||
- "renesas,r8a7794-cpg-clocks" for the r8a7794 CPG
|
||||
and "renesas,rcar-gen2-cpg-clocks" as a fallback.
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
Allwinner Clock Control Unit Binding
|
||||
------------------------------------
|
||||
|
||||
Required properties :
|
||||
- compatible: must contain one of the following compatible:
|
||||
- "allwinner,sun8i-h3-ccu"
|
||||
|
||||
- reg: Must contain the registers base address and length
|
||||
- clocks: phandle to the oscillators feeding the CCU. Two are needed:
|
||||
- "hosc": the high frequency oscillator (usually at 24MHz)
|
||||
- "losc": the low frequency oscillator (usually at 32kHz)
|
||||
- clock-names: Must contain the clock names described just above
|
||||
- #clock-cells : must contain 1
|
||||
- #reset-cells : must contain 1
|
||||
|
||||
Example:
|
||||
ccu: clock@01c20000 {
|
||||
compatible = "allwinner,sun8i-h3-ccu";
|
||||
reg = <0x01c20000 0x400>;
|
||||
clocks = <&osc24M>, <&osc32k>;
|
||||
clock-names = "hosc", "losc";
|
||||
#clock-cells = <1>;
|
||||
#reset-cells = <1>;
|
||||
};
|
||||
+60
-252
@@ -42,8 +42,10 @@
|
||||
|
||||
#include "skeleton.dtsi"
|
||||
|
||||
#include <dt-bindings/clock/sun8i-h3-ccu.h>
|
||||
#include <dt-bindings/interrupt-controller/arm-gic.h>
|
||||
#include <dt-bindings/pinctrl/sun4i-a10.h>
|
||||
#include <dt-bindings/reset/sun8i-h3-ccu.h>
|
||||
|
||||
/ {
|
||||
interrupt-parent = <&gic>;
|
||||
@@ -104,191 +106,6 @@
|
||||
clock-output-names = "osc32k";
|
||||
};
|
||||
|
||||
pll1: clk@01c20000 {
|
||||
#clock-cells = <0>;
|
||||
compatible = "allwinner,sun8i-a23-pll1-clk";
|
||||
reg = <0x01c20000 0x4>;
|
||||
clocks = <&osc24M>;
|
||||
clock-output-names = "pll1";
|
||||
};
|
||||
|
||||
/* dummy clock until actually implemented */
|
||||
pll5: pll5_clk {
|
||||
#clock-cells = <0>;
|
||||
compatible = "fixed-clock";
|
||||
clock-frequency = <0>;
|
||||
clock-output-names = "pll5";
|
||||
};
|
||||
|
||||
pll6: clk@01c20028 {
|
||||
#clock-cells = <1>;
|
||||
compatible = "allwinner,sun6i-a31-pll6-clk";
|
||||
reg = <0x01c20028 0x4>;
|
||||
clocks = <&osc24M>;
|
||||
clock-output-names = "pll6", "pll6x2";
|
||||
};
|
||||
|
||||
pll6d2: pll6d2_clk {
|
||||
#clock-cells = <0>;
|
||||
compatible = "fixed-factor-clock";
|
||||
clock-div = <2>;
|
||||
clock-mult = <1>;
|
||||
clocks = <&pll6 0>;
|
||||
clock-output-names = "pll6d2";
|
||||
};
|
||||
|
||||
/* dummy clock until pll6 can be reused */
|
||||
pll8: pll8_clk {
|
||||
#clock-cells = <0>;
|
||||
compatible = "fixed-clock";
|
||||
clock-frequency = <1>;
|
||||
clock-output-names = "pll8";
|
||||
};
|
||||
|
||||
cpu: cpu_clk@01c20050 {
|
||||
#clock-cells = <0>;
|
||||
compatible = "allwinner,sun4i-a10-cpu-clk";
|
||||
reg = <0x01c20050 0x4>;
|
||||
clocks = <&osc32k>, <&osc24M>, <&pll1>, <&pll1>;
|
||||
clock-output-names = "cpu";
|
||||
};
|
||||
|
||||
axi: axi_clk@01c20050 {
|
||||
#clock-cells = <0>;
|
||||
compatible = "allwinner,sun4i-a10-axi-clk";
|
||||
reg = <0x01c20050 0x4>;
|
||||
clocks = <&cpu>;
|
||||
clock-output-names = "axi";
|
||||
};
|
||||
|
||||
ahb1: ahb1_clk@01c20054 {
|
||||
#clock-cells = <0>;
|
||||
compatible = "allwinner,sun6i-a31-ahb1-clk";
|
||||
reg = <0x01c20054 0x4>;
|
||||
clocks = <&osc32k>, <&osc24M>, <&axi>, <&pll6 0>;
|
||||
clock-output-names = "ahb1";
|
||||
};
|
||||
|
||||
ahb2: ahb2_clk@01c2005c {
|
||||
#clock-cells = <0>;
|
||||
compatible = "allwinner,sun8i-h3-ahb2-clk";
|
||||
reg = <0x01c2005c 0x4>;
|
||||
clocks = <&ahb1>, <&pll6d2>;
|
||||
clock-output-names = "ahb2";
|
||||
};
|
||||
|
||||
apb1: apb1_clk@01c20054 {
|
||||
#clock-cells = <0>;
|
||||
compatible = "allwinner,sun4i-a10-apb0-clk";
|
||||
reg = <0x01c20054 0x4>;
|
||||
clocks = <&ahb1>;
|
||||
clock-output-names = "apb1";
|
||||
};
|
||||
|
||||
apb2: apb2_clk@01c20058 {
|
||||
#clock-cells = <0>;
|
||||
compatible = "allwinner,sun4i-a10-apb1-clk";
|
||||
reg = <0x01c20058 0x4>;
|
||||
clocks = <&osc32k>, <&osc24M>, <&pll6 0>, <&pll6 0>;
|
||||
clock-output-names = "apb2";
|
||||
};
|
||||
|
||||
bus_gates: clk@01c20060 {
|
||||
#clock-cells = <1>;
|
||||
compatible = "allwinner,sun8i-h3-bus-gates-clk";
|
||||
reg = <0x01c20060 0x14>;
|
||||
clocks = <&ahb1>, <&ahb2>, <&apb1>, <&apb2>;
|
||||
clock-names = "ahb1", "ahb2", "apb1", "apb2";
|
||||
clock-indices = <5>, <6>, <8>,
|
||||
<9>, <10>, <13>,
|
||||
<14>, <17>, <18>,
|
||||
<19>, <20>,
|
||||
<21>, <23>,
|
||||
<24>, <25>,
|
||||
<26>, <27>,
|
||||
<28>, <29>,
|
||||
<30>, <31>, <32>,
|
||||
<35>, <36>, <37>,
|
||||
<40>, <41>, <43>,
|
||||
<44>, <52>, <53>,
|
||||
<54>, <64>,
|
||||
<65>, <69>, <72>,
|
||||
<76>, <77>, <78>,
|
||||
<96>, <97>, <98>,
|
||||
<112>, <113>,
|
||||
<114>, <115>,
|
||||
<116>, <128>, <135>;
|
||||
clock-output-names = "bus_ce", "bus_dma", "bus_mmc0",
|
||||
"bus_mmc1", "bus_mmc2", "bus_nand",
|
||||
"bus_sdram", "bus_gmac", "bus_ts",
|
||||
"bus_hstimer", "bus_spi0",
|
||||
"bus_spi1", "bus_otg",
|
||||
"bus_otg_ehci0", "bus_ehci1",
|
||||
"bus_ehci2", "bus_ehci3",
|
||||
"bus_otg_ohci0", "bus_ohci1",
|
||||
"bus_ohci2", "bus_ohci3", "bus_ve",
|
||||
"bus_lcd0", "bus_lcd1", "bus_deint",
|
||||
"bus_csi", "bus_tve", "bus_hdmi",
|
||||
"bus_de", "bus_gpu", "bus_msgbox",
|
||||
"bus_spinlock", "bus_codec",
|
||||
"bus_spdif", "bus_pio", "bus_ths",
|
||||
"bus_i2s0", "bus_i2s1", "bus_i2s2",
|
||||
"bus_i2c0", "bus_i2c1", "bus_i2c2",
|
||||
"bus_uart0", "bus_uart1",
|
||||
"bus_uart2", "bus_uart3",
|
||||
"bus_scr", "bus_ephy", "bus_dbg";
|
||||
};
|
||||
|
||||
mmc0_clk: clk@01c20088 {
|
||||
#clock-cells = <1>;
|
||||
compatible = "allwinner,sun4i-a10-mmc-clk";
|
||||
reg = <0x01c20088 0x4>;
|
||||
clocks = <&osc24M>, <&pll6 0>, <&pll8>;
|
||||
clock-output-names = "mmc0",
|
||||
"mmc0_output",
|
||||
"mmc0_sample";
|
||||
};
|
||||
|
||||
mmc1_clk: clk@01c2008c {
|
||||
#clock-cells = <1>;
|
||||
compatible = "allwinner,sun4i-a10-mmc-clk";
|
||||
reg = <0x01c2008c 0x4>;
|
||||
clocks = <&osc24M>, <&pll6 0>, <&pll8>;
|
||||
clock-output-names = "mmc1",
|
||||
"mmc1_output",
|
||||
"mmc1_sample";
|
||||
};
|
||||
|
||||
mmc2_clk: clk@01c20090 {
|
||||
#clock-cells = <1>;
|
||||
compatible = "allwinner,sun4i-a10-mmc-clk";
|
||||
reg = <0x01c20090 0x4>;
|
||||
clocks = <&osc24M>, <&pll6 0>, <&pll8>;
|
||||
clock-output-names = "mmc2",
|
||||
"mmc2_output",
|
||||
"mmc2_sample";
|
||||
};
|
||||
|
||||
usb_clk: clk@01c200cc {
|
||||
#clock-cells = <1>;
|
||||
#reset-cells = <1>;
|
||||
compatible = "allwinner,sun8i-h3-usb-clk";
|
||||
reg = <0x01c200cc 0x4>;
|
||||
clocks = <&osc24M>;
|
||||
clock-output-names = "usb_phy0", "usb_phy1",
|
||||
"usb_phy2", "usb_phy3",
|
||||
"usb_ohci0", "usb_ohci1",
|
||||
"usb_ohci2", "usb_ohci3";
|
||||
};
|
||||
|
||||
mbus_clk: clk@01c2015c {
|
||||
#clock-cells = <0>;
|
||||
compatible = "allwinner,sun8i-a23-mbus-clk";
|
||||
reg = <0x01c2015c 0x4>;
|
||||
clocks = <&osc24M>, <&pll6 1>, <&pll5>;
|
||||
clock-output-names = "mbus";
|
||||
};
|
||||
|
||||
apb0: apb0_clk {
|
||||
compatible = "fixed-factor-clock";
|
||||
#clock-cells = <0>;
|
||||
@@ -327,23 +144,23 @@
|
||||
compatible = "allwinner,sun8i-h3-dma";
|
||||
reg = <0x01c02000 0x1000>;
|
||||
interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&bus_gates 6>;
|
||||
resets = <&ahb_rst 6>;
|
||||
clocks = <&ccu CLK_BUS_DMA>;
|
||||
resets = <&ccu RST_BUS_DMA>;
|
||||
#dma-cells = <1>;
|
||||
};
|
||||
|
||||
mmc0: mmc@01c0f000 {
|
||||
compatible = "allwinner,sun5i-a13-mmc";
|
||||
reg = <0x01c0f000 0x1000>;
|
||||
clocks = <&bus_gates 8>,
|
||||
<&mmc0_clk 0>,
|
||||
<&mmc0_clk 1>,
|
||||
<&mmc0_clk 2>;
|
||||
clocks = <&ccu CLK_BUS_MMC0>,
|
||||
<&ccu CLK_MMC0>,
|
||||
<&ccu CLK_MMC0_OUTPUT>,
|
||||
<&ccu CLK_MMC0_SAMPLE>;
|
||||
clock-names = "ahb",
|
||||
"mmc",
|
||||
"output",
|
||||
"sample";
|
||||
resets = <&ahb_rst 8>;
|
||||
resets = <&ccu RST_BUS_MMC0>;
|
||||
reset-names = "ahb";
|
||||
interrupts = <GIC_SPI 60 IRQ_TYPE_LEVEL_HIGH>;
|
||||
status = "disabled";
|
||||
@@ -354,15 +171,15 @@
|
||||
mmc1: mmc@01c10000 {
|
||||
compatible = "allwinner,sun5i-a13-mmc";
|
||||
reg = <0x01c10000 0x1000>;
|
||||
clocks = <&bus_gates 9>,
|
||||
<&mmc1_clk 0>,
|
||||
<&mmc1_clk 1>,
|
||||
<&mmc1_clk 2>;
|
||||
clocks = <&ccu CLK_BUS_MMC1>,
|
||||
<&ccu CLK_MMC1>,
|
||||
<&ccu CLK_MMC1_OUTPUT>,
|
||||
<&ccu CLK_MMC1_SAMPLE>;
|
||||
clock-names = "ahb",
|
||||
"mmc",
|
||||
"output",
|
||||
"sample";
|
||||
resets = <&ahb_rst 9>;
|
||||
resets = <&ccu RST_BUS_MMC1>;
|
||||
reset-names = "ahb";
|
||||
interrupts = <GIC_SPI 61 IRQ_TYPE_LEVEL_HIGH>;
|
||||
status = "disabled";
|
||||
@@ -373,15 +190,15 @@
|
||||
mmc2: mmc@01c11000 {
|
||||
compatible = "allwinner,sun5i-a13-mmc";
|
||||
reg = <0x01c11000 0x1000>;
|
||||
clocks = <&bus_gates 10>,
|
||||
<&mmc2_clk 0>,
|
||||
<&mmc2_clk 1>,
|
||||
<&mmc2_clk 2>;
|
||||
clocks = <&ccu CLK_BUS_MMC2>,
|
||||
<&ccu CLK_MMC2>,
|
||||
<&ccu CLK_MMC2_OUTPUT>,
|
||||
<&ccu CLK_MMC2_SAMPLE>;
|
||||
clock-names = "ahb",
|
||||
"mmc",
|
||||
"output",
|
||||
"sample";
|
||||
resets = <&ahb_rst 10>;
|
||||
resets = <&ccu RST_BUS_MMC2>;
|
||||
reset-names = "ahb";
|
||||
interrupts = <GIC_SPI 62 IRQ_TYPE_LEVEL_HIGH>;
|
||||
status = "disabled";
|
||||
@@ -401,18 +218,18 @@
|
||||
"pmu1",
|
||||
"pmu2",
|
||||
"pmu3";
|
||||
clocks = <&usb_clk 8>,
|
||||
<&usb_clk 9>,
|
||||
<&usb_clk 10>,
|
||||
<&usb_clk 11>;
|
||||
clocks = <&ccu CLK_USB_PHY0>,
|
||||
<&ccu CLK_USB_PHY1>,
|
||||
<&ccu CLK_USB_PHY2>,
|
||||
<&ccu CLK_USB_PHY3>;
|
||||
clock-names = "usb0_phy",
|
||||
"usb1_phy",
|
||||
"usb2_phy",
|
||||
"usb3_phy";
|
||||
resets = <&usb_clk 0>,
|
||||
<&usb_clk 1>,
|
||||
<&usb_clk 2>,
|
||||
<&usb_clk 3>;
|
||||
resets = <&ccu RST_USB_PHY0>,
|
||||
<&ccu RST_USB_PHY1>,
|
||||
<&ccu RST_USB_PHY2>,
|
||||
<&ccu RST_USB_PHY3>;
|
||||
reset-names = "usb0_reset",
|
||||
"usb1_reset",
|
||||
"usb2_reset",
|
||||
@@ -425,8 +242,8 @@
|
||||
compatible = "allwinner,sun8i-h3-ehci", "generic-ehci";
|
||||
reg = <0x01c1b000 0x100>;
|
||||
interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&bus_gates 25>, <&bus_gates 29>;
|
||||
resets = <&ahb_rst 25>, <&ahb_rst 29>;
|
||||
clocks = <&ccu CLK_BUS_EHCI1>, <&ccu CLK_BUS_OHCI1>;
|
||||
resets = <&ccu RST_BUS_EHCI1>, <&ccu RST_BUS_OHCI1>;
|
||||
phys = <&usbphy 1>;
|
||||
phy-names = "usb";
|
||||
status = "disabled";
|
||||
@@ -436,9 +253,9 @@
|
||||
compatible = "allwinner,sun8i-h3-ohci", "generic-ohci";
|
||||
reg = <0x01c1b400 0x100>;
|
||||
interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&bus_gates 29>, <&bus_gates 25>,
|
||||
<&usb_clk 17>;
|
||||
resets = <&ahb_rst 29>, <&ahb_rst 25>;
|
||||
clocks = <&ccu CLK_BUS_EHCI1>, <&ccu CLK_BUS_OHCI1>,
|
||||
<&ccu CLK_USB_OHCI1>;
|
||||
resets = <&ccu RST_BUS_EHCI1>, <&ccu RST_BUS_OHCI1>;
|
||||
phys = <&usbphy 1>;
|
||||
phy-names = "usb";
|
||||
status = "disabled";
|
||||
@@ -448,8 +265,8 @@
|
||||
compatible = "allwinner,sun8i-h3-ehci", "generic-ehci";
|
||||
reg = <0x01c1c000 0x100>;
|
||||
interrupts = <GIC_SPI 76 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&bus_gates 26>, <&bus_gates 30>;
|
||||
resets = <&ahb_rst 26>, <&ahb_rst 30>;
|
||||
clocks = <&ccu CLK_BUS_EHCI2>, <&ccu CLK_BUS_OHCI2>;
|
||||
resets = <&ccu RST_BUS_EHCI2>, <&ccu RST_BUS_OHCI2>;
|
||||
phys = <&usbphy 2>;
|
||||
phy-names = "usb";
|
||||
status = "disabled";
|
||||
@@ -459,9 +276,9 @@
|
||||
compatible = "allwinner,sun8i-h3-ohci", "generic-ohci";
|
||||
reg = <0x01c1c400 0x100>;
|
||||
interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&bus_gates 30>, <&bus_gates 26>,
|
||||
<&usb_clk 18>;
|
||||
resets = <&ahb_rst 30>, <&ahb_rst 26>;
|
||||
clocks = <&ccu CLK_BUS_EHCI2>, <&ccu CLK_BUS_OHCI2>,
|
||||
<&ccu CLK_USB_OHCI2>;
|
||||
resets = <&ccu RST_BUS_EHCI2>, <&ccu RST_BUS_OHCI2>;
|
||||
phys = <&usbphy 2>;
|
||||
phy-names = "usb";
|
||||
status = "disabled";
|
||||
@@ -471,8 +288,8 @@
|
||||
compatible = "allwinner,sun8i-h3-ehci", "generic-ehci";
|
||||
reg = <0x01c1d000 0x100>;
|
||||
interrupts = <GIC_SPI 78 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&bus_gates 27>, <&bus_gates 31>;
|
||||
resets = <&ahb_rst 27>, <&ahb_rst 31>;
|
||||
clocks = <&ccu CLK_BUS_EHCI3>, <&ccu CLK_BUS_OHCI3>;
|
||||
resets = <&ccu RST_BUS_EHCI3>, <&ccu RST_BUS_OHCI3>;
|
||||
phys = <&usbphy 3>;
|
||||
phy-names = "usb";
|
||||
status = "disabled";
|
||||
@@ -482,20 +299,29 @@
|
||||
compatible = "allwinner,sun8i-h3-ohci", "generic-ohci";
|
||||
reg = <0x01c1d400 0x100>;
|
||||
interrupts = <GIC_SPI 79 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&bus_gates 31>, <&bus_gates 27>,
|
||||
<&usb_clk 19>;
|
||||
resets = <&ahb_rst 31>, <&ahb_rst 27>;
|
||||
clocks = <&ccu CLK_BUS_EHCI3>, <&ccu CLK_BUS_OHCI3>,
|
||||
<&ccu CLK_USB_OHCI3>;
|
||||
resets = <&ccu RST_BUS_EHCI3>, <&ccu RST_BUS_OHCI3>;
|
||||
phys = <&usbphy 3>;
|
||||
phy-names = "usb";
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
ccu: clock@01c20000 {
|
||||
compatible = "allwinner,sun8i-h3-ccu";
|
||||
reg = <0x01c20000 0x400>;
|
||||
clocks = <&osc24M>, <&osc32k>;
|
||||
clock-names = "hosc", "losc";
|
||||
#clock-cells = <1>;
|
||||
#reset-cells = <1>;
|
||||
};
|
||||
|
||||
pio: pinctrl@01c20800 {
|
||||
compatible = "allwinner,sun8i-h3-pinctrl";
|
||||
reg = <0x01c20800 0x400>;
|
||||
interrupts = <GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>,
|
||||
<GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>;
|
||||
clocks = <&bus_gates 69>;
|
||||
clocks = <&ccu CLK_BUS_PIO>;
|
||||
gpio-controller;
|
||||
#gpio-cells = <3>;
|
||||
interrupt-controller;
|
||||
@@ -542,24 +368,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
ahb_rst: reset@01c202c0 {
|
||||
#reset-cells = <1>;
|
||||
compatible = "allwinner,sun6i-a31-ahb1-reset";
|
||||
reg = <0x01c202c0 0xc>;
|
||||
};
|
||||
|
||||
apb1_rst: reset@01c202d0 {
|
||||
#reset-cells = <1>;
|
||||
compatible = "allwinner,sun6i-a31-clock-reset";
|
||||
reg = <0x01c202d0 0x4>;
|
||||
};
|
||||
|
||||
apb2_rst: reset@01c202d8 {
|
||||
#reset-cells = <1>;
|
||||
compatible = "allwinner,sun6i-a31-clock-reset";
|
||||
reg = <0x01c202d8 0x4>;
|
||||
};
|
||||
|
||||
timer@01c20c00 {
|
||||
compatible = "allwinner,sun4i-a10-timer";
|
||||
reg = <0x01c20c00 0xa0>;
|
||||
@@ -580,8 +388,8 @@
|
||||
interrupts = <GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>;
|
||||
reg-shift = <2>;
|
||||
reg-io-width = <4>;
|
||||
clocks = <&bus_gates 112>;
|
||||
resets = <&apb2_rst 16>;
|
||||
clocks = <&ccu CLK_BUS_UART0>;
|
||||
resets = <&ccu RST_BUS_UART0>;
|
||||
dmas = <&dma 6>, <&dma 6>;
|
||||
dma-names = "rx", "tx";
|
||||
status = "disabled";
|
||||
@@ -593,8 +401,8 @@
|
||||
interrupts = <GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>;
|
||||
reg-shift = <2>;
|
||||
reg-io-width = <4>;
|
||||
clocks = <&bus_gates 113>;
|
||||
resets = <&apb2_rst 17>;
|
||||
clocks = <&ccu CLK_BUS_UART1>;
|
||||
resets = <&ccu RST_BUS_UART1>;
|
||||
dmas = <&dma 7>, <&dma 7>;
|
||||
dma-names = "rx", "tx";
|
||||
status = "disabled";
|
||||
@@ -606,8 +414,8 @@
|
||||
interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
|
||||
reg-shift = <2>;
|
||||
reg-io-width = <4>;
|
||||
clocks = <&bus_gates 114>;
|
||||
resets = <&apb2_rst 18>;
|
||||
clocks = <&ccu CLK_BUS_UART2>;
|
||||
resets = <&ccu RST_BUS_UART2>;
|
||||
dmas = <&dma 8>, <&dma 8>;
|
||||
dma-names = "rx", "tx";
|
||||
status = "disabled";
|
||||
@@ -619,8 +427,8 @@
|
||||
interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>;
|
||||
reg-shift = <2>;
|
||||
reg-io-width = <4>;
|
||||
clocks = <&bus_gates 115>;
|
||||
resets = <&apb2_rst 19>;
|
||||
clocks = <&ccu CLK_BUS_UART3>;
|
||||
resets = <&ccu RST_BUS_UART3>;
|
||||
dmas = <&dma 9>, <&dma 9>;
|
||||
dma-names = "rx", "tx";
|
||||
status = "disabled";
|
||||
|
||||
+5
-2
@@ -49,10 +49,10 @@ config COMMON_CLK_MAX77802
|
||||
This driver supports Maxim 77802 crystal oscillator clock.
|
||||
|
||||
config COMMON_CLK_RK808
|
||||
tristate "Clock driver for RK808"
|
||||
tristate "Clock driver for RK808/RK818"
|
||||
depends on MFD_RK808
|
||||
---help---
|
||||
This driver supports RK808 crystal oscillator clock. These
|
||||
This driver supports RK808 and RK818 crystal oscillator clock. These
|
||||
multi-function devices have two fixed-rate oscillators,
|
||||
clocked at 32KHz each. Clkout1 is always on, Clkout2 can off
|
||||
by control register.
|
||||
@@ -203,16 +203,19 @@ config COMMON_CLK_PIC32
|
||||
|
||||
config COMMON_CLK_OXNAS
|
||||
bool "Clock driver for the OXNAS SoC Family"
|
||||
depends on ARCH_OXNAS || COMPILE_TEST
|
||||
select MFD_SYSCON
|
||||
---help---
|
||||
Support for the OXNAS SoC Family clocks.
|
||||
|
||||
source "drivers/clk/bcm/Kconfig"
|
||||
source "drivers/clk/hisilicon/Kconfig"
|
||||
source "drivers/clk/meson/Kconfig"
|
||||
source "drivers/clk/mvebu/Kconfig"
|
||||
source "drivers/clk/qcom/Kconfig"
|
||||
source "drivers/clk/renesas/Kconfig"
|
||||
source "drivers/clk/samsung/Kconfig"
|
||||
source "drivers/clk/sunxi-ng/Kconfig"
|
||||
source "drivers/clk/tegra/Kconfig"
|
||||
source "drivers/clk/ti/Kconfig"
|
||||
|
||||
|
||||
+12
-9
@@ -16,13 +16,14 @@ obj-$(CONFIG_COMMON_CLK) += clk-conf.o
|
||||
endif
|
||||
|
||||
# hardware specific clock types
|
||||
# please keep this section sorted lexicographically by file/directory path name
|
||||
# please keep this section sorted lexicographically by file path name
|
||||
obj-$(CONFIG_MACH_ASM9260) += clk-asm9260.o
|
||||
obj-$(CONFIG_COMMON_CLK_AXI_CLKGEN) += clk-axi-clkgen.o
|
||||
obj-$(CONFIG_ARCH_AXXIA) += clk-axm5516.o
|
||||
obj-$(CONFIG_COMMON_CLK_CDCE706) += clk-cdce706.o
|
||||
obj-$(CONFIG_COMMON_CLK_CS2000_CP) += clk-cs2000-cp.o
|
||||
obj-$(CONFIG_COMMON_CLK_CDCE925) += clk-cdce925.o
|
||||
obj-$(CONFIG_ARCH_CLPS711X) += clk-clps711x.o
|
||||
obj-$(CONFIG_COMMON_CLK_CS2000_CP) += clk-cs2000-cp.o
|
||||
obj-$(CONFIG_ARCH_EFM32) += clk-efm32gg.o
|
||||
obj-$(CONFIG_ARCH_HIGHBANK) += clk-highbank.o
|
||||
obj-$(CONFIG_MACH_LOONGSON32) += clk-ls1x.o
|
||||
@@ -35,6 +36,7 @@ obj-$(CONFIG_ARCH_NOMADIK) += clk-nomadik.o
|
||||
obj-$(CONFIG_ARCH_NSPIRE) += clk-nspire.o
|
||||
obj-$(CONFIG_COMMON_CLK_OXNAS) += clk-oxnas.o
|
||||
obj-$(CONFIG_COMMON_CLK_PALMAS) += clk-palmas.o
|
||||
obj-$(CONFIG_COMMON_CLK_PWM) += clk-pwm.o
|
||||
obj-$(CONFIG_CLK_QORIQ) += clk-qoriq.o
|
||||
obj-$(CONFIG_COMMON_CLK_RK808) += clk-rk808.o
|
||||
obj-$(CONFIG_COMMON_CLK_S2MPS11) += clk-s2mps11.o
|
||||
@@ -42,7 +44,6 @@ obj-$(CONFIG_COMMON_CLK_SCPI) += clk-scpi.o
|
||||
obj-$(CONFIG_COMMON_CLK_SI5351) += clk-si5351.o
|
||||
obj-$(CONFIG_COMMON_CLK_SI514) += clk-si514.o
|
||||
obj-$(CONFIG_COMMON_CLK_SI570) += clk-si570.o
|
||||
obj-$(CONFIG_COMMON_CLK_CDCE925) += clk-cdce925.o
|
||||
obj-$(CONFIG_ARCH_STM32) += clk-stm32f4.o
|
||||
obj-$(CONFIG_ARCH_TANGO) += clk-tango4.o
|
||||
obj-$(CONFIG_CLK_TWL6040) += clk-twl6040.o
|
||||
@@ -50,35 +51,39 @@ obj-$(CONFIG_ARCH_U300) += clk-u300.o
|
||||
obj-$(CONFIG_ARCH_VT8500) += clk-vt8500.o
|
||||
obj-$(CONFIG_COMMON_CLK_WM831X) += clk-wm831x.o
|
||||
obj-$(CONFIG_COMMON_CLK_XGENE) += clk-xgene.o
|
||||
obj-$(CONFIG_COMMON_CLK_PWM) += clk-pwm.o
|
||||
|
||||
# please keep this section sorted lexicographically by directory path name
|
||||
obj-$(CONFIG_COMMON_CLK_AT91) += at91/
|
||||
obj-$(CONFIG_ARCH_ARTPEC) += axis/
|
||||
obj-$(CONFIG_ARC_PLAT_AXS10X) += axs10x/
|
||||
obj-y += bcm/
|
||||
obj-$(CONFIG_ARCH_BERLIN) += berlin/
|
||||
obj-$(CONFIG_H8300) += h8300/
|
||||
obj-$(CONFIG_ARCH_HISI) += hisilicon/
|
||||
obj-$(CONFIG_ARCH_MXC) += imx/
|
||||
obj-$(CONFIG_MACH_INGENIC) += ingenic/
|
||||
obj-$(CONFIG_COMMON_CLK_KEYSTONE) += keystone/
|
||||
obj-$(CONFIG_ARCH_MEDIATEK) += mediatek/
|
||||
obj-$(CONFIG_COMMON_CLK_AMLOGIC) += meson/
|
||||
obj-$(CONFIG_MACH_PIC32) += microchip/
|
||||
ifeq ($(CONFIG_COMMON_CLK), y)
|
||||
obj-$(CONFIG_ARCH_MMP) += mmp/
|
||||
endif
|
||||
obj-y += mvebu/
|
||||
obj-$(CONFIG_ARCH_MESON) += meson/
|
||||
obj-$(CONFIG_ARCH_MXS) += mxs/
|
||||
obj-$(CONFIG_MACH_PISTACHIO) += pistachio/
|
||||
obj-$(CONFIG_COMMON_CLK_NXP) += nxp/
|
||||
obj-$(CONFIG_MACH_PISTACHIO) += pistachio/
|
||||
obj-$(CONFIG_COMMON_CLK_PXA) += pxa/
|
||||
obj-$(CONFIG_COMMON_CLK_QCOM) += qcom/
|
||||
obj-$(CONFIG_ARCH_RENESAS) += renesas/
|
||||
obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip/
|
||||
obj-$(CONFIG_COMMON_CLK_SAMSUNG) += samsung/
|
||||
obj-$(CONFIG_ARCH_RENESAS) += renesas/
|
||||
obj-$(CONFIG_ARCH_SIRF) += sirf/
|
||||
obj-$(CONFIG_ARCH_SOCFPGA) += socfpga/
|
||||
obj-$(CONFIG_PLAT_SPEAR) += spear/
|
||||
obj-$(CONFIG_ARCH_STI) += st/
|
||||
obj-$(CONFIG_ARCH_SUNXI) += sunxi/
|
||||
obj-$(CONFIG_ARCH_SUNXI) += sunxi-ng/
|
||||
obj-$(CONFIG_ARCH_TEGRA) += tegra/
|
||||
obj-y += ti/
|
||||
obj-$(CONFIG_ARCH_U8500) += ux500/
|
||||
@@ -86,5 +91,3 @@ obj-$(CONFIG_COMMON_CLK_VERSATILE) += versatile/
|
||||
obj-$(CONFIG_X86) += x86/
|
||||
obj-$(CONFIG_ARCH_ZX) += zte/
|
||||
obj-$(CONFIG_ARCH_ZYNQ) += zynq/
|
||||
obj-$(CONFIG_H8300) += h8300/
|
||||
obj-$(CONFIG_ARC_PLAT_AXS10X) += axs10x/
|
||||
|
||||
@@ -267,7 +267,7 @@ at91_clk_register_generated(struct regmap *regmap, spinlock_t *lock, const char
|
||||
return clk;
|
||||
}
|
||||
|
||||
void __init of_sama5d2_clk_generated_setup(struct device_node *np)
|
||||
static void __init of_sama5d2_clk_generated_setup(struct device_node *np)
|
||||
{
|
||||
int num;
|
||||
u32 id;
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#include <linux/clkdev.h>
|
||||
#include <linux/of_address.h>
|
||||
|
||||
#include "clk-iproc.h"
|
||||
|
||||
#define IPROC_CLK_MAX_FREQ_POLICY 0x3
|
||||
#define IPROC_CLK_POLICY_FREQ_OFFSET 0x008
|
||||
#define IPROC_CLK_POLICY_FREQ_POLICY_FREQ_SHIFT 8
|
||||
@@ -242,7 +244,6 @@ static const struct clk_ops iproc_arm_pll_ops = {
|
||||
void __init iproc_armpll_setup(struct device_node *node)
|
||||
{
|
||||
int ret;
|
||||
struct clk *clk;
|
||||
struct iproc_arm_pll *pll;
|
||||
struct clk_init_data init;
|
||||
const char *parent_name;
|
||||
@@ -263,18 +264,18 @@ void __init iproc_armpll_setup(struct device_node *node)
|
||||
init.num_parents = (parent_name ? 1 : 0);
|
||||
pll->hw.init = &init;
|
||||
|
||||
clk = clk_register(NULL, &pll->hw);
|
||||
if (WARN_ON(IS_ERR(clk)))
|
||||
ret = clk_hw_register(NULL, &pll->hw);
|
||||
if (WARN_ON(ret))
|
||||
goto err_iounmap;
|
||||
|
||||
ret = of_clk_add_provider(node, of_clk_src_simple_get, clk);
|
||||
ret = of_clk_add_hw_provider(node, of_clk_hw_simple_get, &pll->hw);
|
||||
if (WARN_ON(ret))
|
||||
goto err_clk_unregister;
|
||||
|
||||
return;
|
||||
|
||||
err_clk_unregister:
|
||||
clk_unregister(clk);
|
||||
clk_hw_unregister(&pll->hw);
|
||||
err_iounmap:
|
||||
iounmap(pll->base);
|
||||
err_free_pll:
|
||||
|
||||
@@ -37,7 +37,7 @@ struct iproc_asiu {
|
||||
void __iomem *div_base;
|
||||
void __iomem *gate_base;
|
||||
|
||||
struct clk_onecell_data clk_data;
|
||||
struct clk_hw_onecell_data *clk_data;
|
||||
struct iproc_asiu_clk *clks;
|
||||
};
|
||||
|
||||
@@ -197,11 +197,11 @@ void __init iproc_asiu_setup(struct device_node *node,
|
||||
if (WARN_ON(!asiu))
|
||||
return;
|
||||
|
||||
asiu->clk_data.clk_num = num_clks;
|
||||
asiu->clk_data.clks = kcalloc(num_clks, sizeof(*asiu->clk_data.clks),
|
||||
GFP_KERNEL);
|
||||
if (WARN_ON(!asiu->clk_data.clks))
|
||||
asiu->clk_data = kzalloc(sizeof(*asiu->clk_data->hws) * num_clks +
|
||||
sizeof(*asiu->clk_data), GFP_KERNEL);
|
||||
if (WARN_ON(!asiu->clk_data))
|
||||
goto err_clks;
|
||||
asiu->clk_data->num = num_clks;
|
||||
|
||||
asiu->clks = kcalloc(num_clks, sizeof(*asiu->clks), GFP_KERNEL);
|
||||
if (WARN_ON(!asiu->clks))
|
||||
@@ -217,7 +217,6 @@ void __init iproc_asiu_setup(struct device_node *node,
|
||||
|
||||
for (i = 0; i < num_clks; i++) {
|
||||
struct clk_init_data init;
|
||||
struct clk *clk;
|
||||
const char *parent_name;
|
||||
struct iproc_asiu_clk *asiu_clk;
|
||||
const char *clk_name;
|
||||
@@ -240,22 +239,22 @@ void __init iproc_asiu_setup(struct device_node *node,
|
||||
init.num_parents = (parent_name ? 1 : 0);
|
||||
asiu_clk->hw.init = &init;
|
||||
|
||||
clk = clk_register(NULL, &asiu_clk->hw);
|
||||
if (WARN_ON(IS_ERR(clk)))
|
||||
ret = clk_hw_register(NULL, &asiu_clk->hw);
|
||||
if (WARN_ON(ret))
|
||||
goto err_clk_register;
|
||||
asiu->clk_data.clks[i] = clk;
|
||||
asiu->clk_data->hws[i] = &asiu_clk->hw;
|
||||
}
|
||||
|
||||
ret = of_clk_add_provider(node, of_clk_src_onecell_get,
|
||||
&asiu->clk_data);
|
||||
ret = of_clk_add_hw_provider(node, of_clk_hw_onecell_get,
|
||||
asiu->clk_data);
|
||||
if (WARN_ON(ret))
|
||||
goto err_clk_register;
|
||||
|
||||
return;
|
||||
|
||||
err_clk_register:
|
||||
for (i = 0; i < num_clks; i++)
|
||||
clk_unregister(asiu->clk_data.clks[i]);
|
||||
while (--i >= 0)
|
||||
clk_hw_unregister(asiu->clk_data->hws[i]);
|
||||
iounmap(asiu->gate_base);
|
||||
|
||||
err_iomap_gate:
|
||||
@@ -265,7 +264,7 @@ err_iomap_div:
|
||||
kfree(asiu->clks);
|
||||
|
||||
err_asiu_clks:
|
||||
kfree(asiu->clk_data.clks);
|
||||
kfree(asiu->clk_data);
|
||||
|
||||
err_clks:
|
||||
kfree(asiu);
|
||||
|
||||
@@ -89,7 +89,7 @@ struct iproc_pll {
|
||||
const struct iproc_pll_vco_param *vco_param;
|
||||
unsigned int num_vco_entries;
|
||||
|
||||
struct clk_onecell_data clk_data;
|
||||
struct clk_hw_onecell_data *clk_data;
|
||||
struct iproc_clk *clks;
|
||||
};
|
||||
|
||||
@@ -625,7 +625,6 @@ void __init iproc_pll_clk_setup(struct device_node *node,
|
||||
unsigned int num_clks)
|
||||
{
|
||||
int i, ret;
|
||||
struct clk *clk;
|
||||
struct iproc_pll *pll;
|
||||
struct iproc_clk *iclk;
|
||||
struct clk_init_data init;
|
||||
@@ -638,11 +637,11 @@ void __init iproc_pll_clk_setup(struct device_node *node,
|
||||
if (WARN_ON(!pll))
|
||||
return;
|
||||
|
||||
pll->clk_data.clk_num = num_clks;
|
||||
pll->clk_data.clks = kcalloc(num_clks, sizeof(*pll->clk_data.clks),
|
||||
GFP_KERNEL);
|
||||
if (WARN_ON(!pll->clk_data.clks))
|
||||
pll->clk_data = kzalloc(sizeof(*pll->clk_data->hws) * num_clks +
|
||||
sizeof(*pll->clk_data), GFP_KERNEL);
|
||||
if (WARN_ON(!pll->clk_data))
|
||||
goto err_clk_data;
|
||||
pll->clk_data->num = num_clks;
|
||||
|
||||
pll->clks = kcalloc(num_clks, sizeof(*pll->clks), GFP_KERNEL);
|
||||
if (WARN_ON(!pll->clks))
|
||||
@@ -694,11 +693,11 @@ void __init iproc_pll_clk_setup(struct device_node *node,
|
||||
|
||||
iproc_pll_sw_cfg(pll);
|
||||
|
||||
clk = clk_register(NULL, &iclk->hw);
|
||||
if (WARN_ON(IS_ERR(clk)))
|
||||
ret = clk_hw_register(NULL, &iclk->hw);
|
||||
if (WARN_ON(ret))
|
||||
goto err_pll_register;
|
||||
|
||||
pll->clk_data.clks[0] = clk;
|
||||
pll->clk_data->hws[0] = &iclk->hw;
|
||||
|
||||
/* now initialize and register all leaf clocks */
|
||||
for (i = 1; i < num_clks; i++) {
|
||||
@@ -724,22 +723,23 @@ void __init iproc_pll_clk_setup(struct device_node *node,
|
||||
init.num_parents = (parent_name ? 1 : 0);
|
||||
iclk->hw.init = &init;
|
||||
|
||||
clk = clk_register(NULL, &iclk->hw);
|
||||
if (WARN_ON(IS_ERR(clk)))
|
||||
ret = clk_hw_register(NULL, &iclk->hw);
|
||||
if (WARN_ON(ret))
|
||||
goto err_clk_register;
|
||||
|
||||
pll->clk_data.clks[i] = clk;
|
||||
pll->clk_data->hws[i] = &iclk->hw;
|
||||
}
|
||||
|
||||
ret = of_clk_add_provider(node, of_clk_src_onecell_get, &pll->clk_data);
|
||||
ret = of_clk_add_hw_provider(node, of_clk_hw_onecell_get,
|
||||
pll->clk_data);
|
||||
if (WARN_ON(ret))
|
||||
goto err_clk_register;
|
||||
|
||||
return;
|
||||
|
||||
err_clk_register:
|
||||
for (i = 0; i < num_clks; i++)
|
||||
clk_unregister(pll->clk_data.clks[i]);
|
||||
while (--i >= 0)
|
||||
clk_hw_unregister(pll->clk_data->hws[i]);
|
||||
|
||||
err_pll_register:
|
||||
if (pll->status_base != pll->control_base)
|
||||
@@ -759,7 +759,7 @@ err_pll_iomap:
|
||||
kfree(pll->clks);
|
||||
|
||||
err_clks:
|
||||
kfree(pll->clk_data.clks);
|
||||
kfree(pll->clk_data);
|
||||
|
||||
err_clk_data:
|
||||
kfree(pll);
|
||||
|
||||
@@ -55,7 +55,7 @@ static int __set_clk_parents(struct device_node *node, bool clk_supplier)
|
||||
}
|
||||
clk = of_clk_get_from_provider(&clkspec);
|
||||
if (IS_ERR(clk)) {
|
||||
pr_warn("clk: couldn't get parent clock %d for %s\n",
|
||||
pr_warn("clk: couldn't get assigned clock %d for %s\n",
|
||||
index, node->full_name);
|
||||
rc = PTR_ERR(clk);
|
||||
goto err;
|
||||
|
||||
@@ -142,6 +142,11 @@ void clk_hw_unregister_fixed_factor(struct clk_hw *hw)
|
||||
EXPORT_SYMBOL_GPL(clk_hw_unregister_fixed_factor);
|
||||
|
||||
#ifdef CONFIG_OF
|
||||
static const struct of_device_id set_rate_parent_matches[] = {
|
||||
{ .compatible = "allwinner,sun4i-a10-pll3-2x-clk" },
|
||||
{ /* Sentinel */ },
|
||||
};
|
||||
|
||||
/**
|
||||
* of_fixed_factor_clk_setup() - Setup function for simple fixed factor clock
|
||||
*/
|
||||
@@ -150,6 +155,7 @@ void __init of_fixed_factor_clk_setup(struct device_node *node)
|
||||
struct clk *clk;
|
||||
const char *clk_name = node->name;
|
||||
const char *parent_name;
|
||||
unsigned long flags = 0;
|
||||
u32 div, mult;
|
||||
|
||||
if (of_property_read_u32(node, "clock-div", &div)) {
|
||||
@@ -167,7 +173,10 @@ void __init of_fixed_factor_clk_setup(struct device_node *node)
|
||||
of_property_read_string(node, "clock-output-names", &clk_name);
|
||||
parent_name = of_clk_get_parent_name(node, 0);
|
||||
|
||||
clk = clk_register_fixed_factor(NULL, clk_name, parent_name, 0,
|
||||
if (of_match_node(set_rate_parent_matches, node))
|
||||
flags |= CLK_SET_RATE_PARENT;
|
||||
|
||||
clk = clk_register_fixed_factor(NULL, clk_name, parent_name, flags,
|
||||
mult, div);
|
||||
if (!IS_ERR(clk))
|
||||
of_clk_add_provider(node, of_clk_src_simple_get, clk);
|
||||
|
||||
@@ -145,6 +145,17 @@ void clk_unregister_fixed_rate(struct clk *clk)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(clk_unregister_fixed_rate);
|
||||
|
||||
void clk_hw_unregister_fixed_rate(struct clk_hw *hw)
|
||||
{
|
||||
struct clk_fixed_rate *fixed;
|
||||
|
||||
fixed = to_clk_fixed_rate(hw);
|
||||
|
||||
clk_hw_unregister(hw);
|
||||
kfree(fixed);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(clk_hw_unregister_fixed_rate);
|
||||
|
||||
#ifdef CONFIG_OF
|
||||
/**
|
||||
* of_fixed_clk_setup() - Setup function for simple fixed rate clock
|
||||
|
||||
@@ -275,7 +275,6 @@ static const struct clk_ops periclk_ops = {
|
||||
static __init struct clk *hb_clk_init(struct device_node *node, const struct clk_ops *ops)
|
||||
{
|
||||
u32 reg;
|
||||
struct clk *clk;
|
||||
struct hb_clk *hb_clk;
|
||||
const char *clk_name = node->name;
|
||||
const char *parent_name;
|
||||
@@ -308,13 +307,13 @@ static __init struct clk *hb_clk_init(struct device_node *node, const struct clk
|
||||
|
||||
hb_clk->hw.init = &init;
|
||||
|
||||
clk = clk_register(NULL, &hb_clk->hw);
|
||||
if (WARN_ON(IS_ERR(clk))) {
|
||||
rc = clk_hw_register(NULL, &hb_clk->hw);
|
||||
if (WARN_ON(rc)) {
|
||||
kfree(hb_clk);
|
||||
return NULL;
|
||||
}
|
||||
rc = of_clk_add_provider(node, of_clk_src_simple_get, clk);
|
||||
return clk;
|
||||
rc = of_clk_add_hw_provider(node, of_clk_hw_simple_get, &hb_clk->hw);
|
||||
return hb_clk->hw.clk;
|
||||
}
|
||||
|
||||
static void __init hb_pll_init(struct device_node *node)
|
||||
|
||||
@@ -52,14 +52,28 @@ static unsigned long __bestmult(struct clk_hw *hw, unsigned long rate,
|
||||
unsigned long *best_parent_rate,
|
||||
u8 width, unsigned long flags)
|
||||
{
|
||||
struct clk_multiplier *mult = to_clk_multiplier(hw);
|
||||
unsigned long orig_parent_rate = *best_parent_rate;
|
||||
unsigned long parent_rate, current_rate, best_rate = ~0;
|
||||
unsigned int i, bestmult = 0;
|
||||
unsigned int maxmult = (1 << width) - 1;
|
||||
|
||||
if (!(clk_hw_get_flags(hw) & CLK_SET_RATE_PARENT))
|
||||
return rate / *best_parent_rate;
|
||||
if (!(clk_hw_get_flags(hw) & CLK_SET_RATE_PARENT)) {
|
||||
bestmult = rate / orig_parent_rate;
|
||||
|
||||
for (i = 1; i < ((1 << width) - 1); i++) {
|
||||
/* Make sure we don't end up with a 0 multiplier */
|
||||
if ((bestmult == 0) &&
|
||||
!(mult->flags & CLK_MULTIPLIER_ZERO_BYPASS))
|
||||
bestmult = 1;
|
||||
|
||||
/* Make sure we don't overflow the multiplier */
|
||||
if (bestmult > maxmult)
|
||||
bestmult = maxmult;
|
||||
|
||||
return bestmult;
|
||||
}
|
||||
|
||||
for (i = 1; i < maxmult; i++) {
|
||||
if (rate == orig_parent_rate * i) {
|
||||
/*
|
||||
* This is the best case for us if we have a
|
||||
|
||||
+26
-22
@@ -253,11 +253,11 @@ static const struct clk_ops pll_clk_ops = {
|
||||
.recalc_rate = pll_clk_recalc_rate,
|
||||
};
|
||||
|
||||
static struct clk * __init
|
||||
static struct clk_hw * __init
|
||||
pll_clk_register(struct device *dev, const char *name,
|
||||
const char *parent_name, u32 id)
|
||||
{
|
||||
struct clk *clk;
|
||||
int ret;
|
||||
struct clk_pll *pll;
|
||||
struct clk_init_data init;
|
||||
|
||||
@@ -281,11 +281,13 @@ pll_clk_register(struct device *dev, const char *name,
|
||||
|
||||
pr_debug("register PLL1 clock \"%s\"\n", name);
|
||||
|
||||
clk = clk_register(dev, &pll->hw);
|
||||
if (IS_ERR(clk))
|
||||
ret = clk_hw_register(dev, &pll->hw);
|
||||
if (ret) {
|
||||
kfree(pll);
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
|
||||
return clk;
|
||||
return &pll->hw;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -345,11 +347,11 @@ static const struct clk_ops src_clk_ops = {
|
||||
.recalc_rate = src_clk_recalc_rate,
|
||||
};
|
||||
|
||||
static struct clk * __init
|
||||
static struct clk_hw * __init
|
||||
src_clk_register(struct device *dev, const char *name,
|
||||
const char *parent_name, u8 id)
|
||||
{
|
||||
struct clk *clk;
|
||||
int ret;
|
||||
struct clk_src *sclk;
|
||||
struct clk_init_data init;
|
||||
|
||||
@@ -376,11 +378,13 @@ src_clk_register(struct device *dev, const char *name,
|
||||
pr_debug("register clock \"%s\" ID: %d group: %d bits: %08x\n",
|
||||
name, id, sclk->group1, sclk->clkbit);
|
||||
|
||||
clk = clk_register(dev, &sclk->hw);
|
||||
if (IS_ERR(clk))
|
||||
ret = clk_hw_register(dev, &sclk->hw);
|
||||
if (ret) {
|
||||
kfree(sclk);
|
||||
return ERR_PTR(ret);
|
||||
}
|
||||
|
||||
return clk;
|
||||
return &sclk->hw;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_DEBUG_FS
|
||||
@@ -508,7 +512,7 @@ device_initcall(nomadik_src_clk_init_debugfs);
|
||||
|
||||
static void __init of_nomadik_pll_setup(struct device_node *np)
|
||||
{
|
||||
struct clk *clk = ERR_PTR(-EINVAL);
|
||||
struct clk_hw *hw;
|
||||
const char *clk_name = np->name;
|
||||
const char *parent_name;
|
||||
u32 pll_id;
|
||||
@@ -522,16 +526,16 @@ static void __init of_nomadik_pll_setup(struct device_node *np)
|
||||
return;
|
||||
}
|
||||
parent_name = of_clk_get_parent_name(np, 0);
|
||||
clk = pll_clk_register(NULL, clk_name, parent_name, pll_id);
|
||||
if (!IS_ERR(clk))
|
||||
of_clk_add_provider(np, of_clk_src_simple_get, clk);
|
||||
hw = pll_clk_register(NULL, clk_name, parent_name, pll_id);
|
||||
if (!IS_ERR(hw))
|
||||
of_clk_add_hw_provider(np, of_clk_hw_simple_get, hw);
|
||||
}
|
||||
CLK_OF_DECLARE(nomadik_pll_clk,
|
||||
"st,nomadik-pll-clock", of_nomadik_pll_setup);
|
||||
|
||||
static void __init of_nomadik_hclk_setup(struct device_node *np)
|
||||
{
|
||||
struct clk *clk = ERR_PTR(-EINVAL);
|
||||
struct clk_hw *hw;
|
||||
const char *clk_name = np->name;
|
||||
const char *parent_name;
|
||||
|
||||
@@ -542,20 +546,20 @@ static void __init of_nomadik_hclk_setup(struct device_node *np)
|
||||
/*
|
||||
* The HCLK divides PLL1 with 1 (passthru), 2, 3 or 4.
|
||||
*/
|
||||
clk = clk_register_divider(NULL, clk_name, parent_name,
|
||||
hw = clk_hw_register_divider(NULL, clk_name, parent_name,
|
||||
0, src_base + SRC_CR,
|
||||
13, 2,
|
||||
CLK_DIVIDER_ONE_BASED | CLK_DIVIDER_ALLOW_ZERO,
|
||||
&src_lock);
|
||||
if (!IS_ERR(clk))
|
||||
of_clk_add_provider(np, of_clk_src_simple_get, clk);
|
||||
if (!IS_ERR(hw))
|
||||
of_clk_add_hw_provider(np, of_clk_hw_simple_get, hw);
|
||||
}
|
||||
CLK_OF_DECLARE(nomadik_hclk_clk,
|
||||
"st,nomadik-hclk-clock", of_nomadik_hclk_setup);
|
||||
|
||||
static void __init of_nomadik_src_clk_setup(struct device_node *np)
|
||||
{
|
||||
struct clk *clk = ERR_PTR(-EINVAL);
|
||||
struct clk_hw *hw;
|
||||
const char *clk_name = np->name;
|
||||
const char *parent_name;
|
||||
u32 clk_id;
|
||||
@@ -569,9 +573,9 @@ static void __init of_nomadik_src_clk_setup(struct device_node *np)
|
||||
return;
|
||||
}
|
||||
parent_name = of_clk_get_parent_name(np, 0);
|
||||
clk = src_clk_register(NULL, clk_name, parent_name, clk_id);
|
||||
if (!IS_ERR(clk))
|
||||
of_clk_add_provider(np, of_clk_src_simple_get, clk);
|
||||
hw = src_clk_register(NULL, clk_name, parent_name, clk_id);
|
||||
if (!IS_ERR(hw))
|
||||
of_clk_add_hw_provider(np, of_clk_hw_simple_get, hw);
|
||||
}
|
||||
CLK_OF_DECLARE(nomadik_src_clk,
|
||||
"st,nomadik-src-clock", of_nomadik_src_clk_setup);
|
||||
|
||||
+3
-12
@@ -18,7 +18,7 @@
|
||||
|
||||
#include <linux/clk-provider.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/stringify.h>
|
||||
@@ -170,26 +170,17 @@ static int oxnas_stdclk_probe(struct platform_device *pdev)
|
||||
clk_oxnas->onecell_data);
|
||||
}
|
||||
|
||||
static int oxnas_stdclk_remove(struct platform_device *pdev)
|
||||
{
|
||||
of_clk_del_provider(pdev->dev.of_node);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct of_device_id oxnas_stdclk_dt_ids[] = {
|
||||
{ .compatible = "oxsemi,ox810se-stdclk" },
|
||||
{ }
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, oxnas_stdclk_dt_ids);
|
||||
|
||||
static struct platform_driver oxnas_stdclk_driver = {
|
||||
.probe = oxnas_stdclk_probe,
|
||||
.remove = oxnas_stdclk_remove,
|
||||
.driver = {
|
||||
.name = "oxnas-stdclk",
|
||||
.suppress_bind_attrs = true,
|
||||
.of_match_table = oxnas_stdclk_dt_ids,
|
||||
},
|
||||
};
|
||||
|
||||
module_platform_driver(oxnas_stdclk_driver);
|
||||
builtin_platform_driver(oxnas_stdclk_driver);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user