Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'qcom/drivers' into next/drivers

* qcom/drivers:
tty: serial: Limit msm_serial_hs driver to platforms that use it
mmc: msm_sdcc: Limit driver to platforms that use it
usb: phy: msm: Move mach dependent code to platform data

Signed-off-by: Olof Johansson <olof@lixom.net>

+226 -31
+2 -1
arch/arm/boot/dts/Makefile
··· 106 106 kirkwood-ts219-6282.dtb 107 107 dtb-$(CONFIG_ARCH_MARCO) += marco-evb.dtb 108 108 dtb-$(CONFIG_ARCH_MSM) += qcom-msm8660-surf.dtb \ 109 - qcom-msm8960-cdp.dtb 109 + qcom-msm8960-cdp.dtb \ 110 + qcom-apq8074-dragonboard.dtb 110 111 dtb-$(CONFIG_ARCH_MVEBU) += armada-370-db.dtb \ 111 112 armada-370-mirabox.dtb \ 112 113 armada-370-netgear-rn102.dtb \
+6
arch/arm/boot/dts/qcom-apq8074-dragonboard.dts
··· 1 + #include "qcom-msm8974.dtsi" 2 + 3 + / { 4 + model = "Qualcomm APQ8074 Dragonboard"; 5 + compatible = "qcom,apq8074-dragonboard", "qcom,apq8074"; 6 + };
+97
arch/arm/boot/dts/qcom-msm8974.dtsi
··· 1 + /dts-v1/; 2 + 3 + #include "skeleton.dtsi" 4 + 5 + / { 6 + model = "Qualcomm MSM8974"; 7 + compatible = "qcom,msm8974"; 8 + interrupt-parent = <&intc>; 9 + 10 + soc: soc { 11 + #address-cells = <1>; 12 + #size-cells = <1>; 13 + ranges; 14 + compatible = "simple-bus"; 15 + 16 + intc: interrupt-controller@f9000000 { 17 + compatible = "qcom,msm-qgic2"; 18 + interrupt-controller; 19 + #interrupt-cells = <3>; 20 + reg = <0xf9000000 0x1000>, 21 + <0xf9002000 0x1000>; 22 + }; 23 + 24 + timer { 25 + compatible = "arm,armv7-timer"; 26 + interrupts = <1 2 0xf08>, 27 + <1 3 0xf08>, 28 + <1 4 0xf08>, 29 + <1 1 0xf08>; 30 + clock-frequency = <19200000>; 31 + }; 32 + 33 + timer@f9020000 { 34 + #address-cells = <1>; 35 + #size-cells = <1>; 36 + ranges; 37 + compatible = "arm,armv7-timer-mem"; 38 + reg = <0xf9020000 0x1000>; 39 + clock-frequency = <19200000>; 40 + 41 + frame@f9021000 { 42 + frame-number = <0>; 43 + interrupts = <0 8 0x4>, 44 + <0 7 0x4>; 45 + reg = <0xf9021000 0x1000>, 46 + <0xf9022000 0x1000>; 47 + }; 48 + 49 + frame@f9023000 { 50 + frame-number = <1>; 51 + interrupts = <0 9 0x4>; 52 + reg = <0xf9023000 0x1000>; 53 + status = "disabled"; 54 + }; 55 + 56 + frame@f9024000 { 57 + frame-number = <2>; 58 + interrupts = <0 10 0x4>; 59 + reg = <0xf9024000 0x1000>; 60 + status = "disabled"; 61 + }; 62 + 63 + frame@f9025000 { 64 + frame-number = <3>; 65 + interrupts = <0 11 0x4>; 66 + reg = <0xf9025000 0x1000>; 67 + status = "disabled"; 68 + }; 69 + 70 + frame@f9026000 { 71 + frame-number = <4>; 72 + interrupts = <0 12 0x4>; 73 + reg = <0xf9026000 0x1000>; 74 + status = "disabled"; 75 + }; 76 + 77 + frame@f9027000 { 78 + frame-number = <5>; 79 + interrupts = <0 13 0x4>; 80 + reg = <0xf9027000 0x1000>; 81 + status = "disabled"; 82 + }; 83 + 84 + frame@f9028000 { 85 + frame-number = <6>; 86 + interrupts = <0 14 0x4>; 87 + reg = <0xf9028000 0x1000>; 88 + status = "disabled"; 89 + }; 90 + }; 91 + 92 + restart@fc4ab000 { 93 + compatible = "qcom,pshold"; 94 + reg = <0xfc4ab000 0x4>; 95 + }; 96 + }; 97 + };
+3
arch/arm/configs/msm_defconfig
··· 20 20 CONFIG_ARCH_MSM=y 21 21 CONFIG_ARCH_MSM8X60=y 22 22 CONFIG_ARCH_MSM8960=y 23 + CONFIG_ARCH_MSM8974=y 23 24 CONFIG_SMP=y 24 25 CONFIG_PREEMPT=y 25 26 CONFIG_AEABI=y ··· 89 88 CONFIG_DEBUG_GPIO=y 90 89 CONFIG_GPIO_SYSFS=y 91 90 CONFIG_POWER_SUPPLY=y 91 + CONFIG_POWER_RESET=y 92 + CONFIG_POWER_RESET_MSM=y 92 93 CONFIG_THERMAL=y 93 94 CONFIG_REGULATOR=y 94 95 CONFIG_MEDIA_SUPPORT=y
+13 -2
arch/arm/mach-msm/Kconfig
··· 44 44 45 45 config ARCH_MSM8X60 46 46 bool "MSM8X60" 47 + select ARCH_MSM_DT 47 48 select ARM_GIC 48 49 select CPU_V7 49 50 select GPIO_MSM_V2 ··· 53 52 54 53 config ARCH_MSM8960 55 54 bool "MSM8960" 55 + select ARCH_MSM_DT 56 56 select ARM_GIC 57 57 select CPU_V7 58 58 select HAVE_SMP 59 59 select GPIO_MSM_V2 60 60 select MSM_SCM if SMP 61 61 62 + config ARCH_MSM8974 63 + bool "MSM8974" 64 + select ARCH_MSM_DT 65 + select ARM_GIC 66 + select CPU_V7 67 + select HAVE_ARM_ARCH_TIMER 68 + select HAVE_SMP 69 + select MSM_SCM if SMP 70 + select USE_OF 71 + 62 72 config ARCH_MSM_DT 63 - def_bool y 64 - depends on (ARCH_MSM8X60 || ARCH_MSM8960) 73 + bool 65 74 select SPARSE_IRQ 66 75 select USE_OF 67 76
+9
arch/arm/mach-msm/board-dt.c
··· 26 26 NULL 27 27 }; 28 28 29 + static const char * const apq8074_dt_match[] __initconst = { 30 + "qcom,apq8074-dragonboard", 31 + NULL 32 + }; 33 + 29 34 DT_MACHINE_START(MSM_DT, "Qualcomm MSM (Flattened Device Tree)") 30 35 .smp = smp_ops(msm_smp_ops), 31 36 .dt_compat = msm_dt_match, 37 + MACHINE_END 38 + 39 + DT_MACHINE_START(APQ_DT, "Qualcomm MSM (Flattened Device Tree)") 40 + .dt_compat = apq8074_dt_match, 32 41 MACHINE_END
+35
arch/arm/mach-msm/board-msm7x30.c
··· 30 30 #include <asm/memory.h> 31 31 #include <asm/setup.h> 32 32 33 + #include <mach/clk.h> 33 34 #include <mach/msm_iomap.h> 34 35 #include <mach/dma.h> 35 36 ··· 61 60 -1 62 61 }; 63 62 63 + static int hsusb_link_clk_reset(struct clk *link_clk, bool assert) 64 + { 65 + int ret; 66 + 67 + if (assert) { 68 + ret = clk_reset(link_clk, CLK_RESET_ASSERT); 69 + if (ret) 70 + pr_err("usb hs_clk assert failed\n"); 71 + } else { 72 + ret = clk_reset(link_clk, CLK_RESET_DEASSERT); 73 + if (ret) 74 + pr_err("usb hs_clk deassert failed\n"); 75 + } 76 + return ret; 77 + } 78 + 79 + static int hsusb_phy_clk_reset(struct clk *phy_clk) 80 + { 81 + int ret; 82 + 83 + ret = clk_reset(phy_clk, CLK_RESET_ASSERT); 84 + if (ret) { 85 + pr_err("usb phy clk assert failed\n"); 86 + return ret; 87 + } 88 + usleep_range(10000, 12000); 89 + ret = clk_reset(phy_clk, CLK_RESET_DEASSERT); 90 + if (ret) 91 + pr_err("usb phy clk deassert failed\n"); 92 + return ret; 93 + } 94 + 64 95 static struct msm_otg_platform_data msm_otg_pdata = { 65 96 .phy_init_seq = hsusb_phy_init_seq, 66 97 .mode = USB_PERIPHERAL, 67 98 .otg_control = OTG_PHY_CONTROL, 99 + .link_clk_reset = hsusb_link_clk_reset, 100 + .phy_clk_reset = hsusb_phy_clk_reset, 68 101 }; 69 102 70 103 struct msm_gpiomux_config msm_gpiomux_configs[GPIOMUX_NGPIOS] = {
+35
arch/arm/mach-msm/board-qsd8x50.c
··· 31 31 #include <mach/irqs.h> 32 32 #include <mach/sirc.h> 33 33 #include <mach/vreg.h> 34 + #include <mach/clk.h> 34 35 #include <linux/platform_data/mmc-msm_sdcc.h> 35 36 36 37 #include "devices.h" ··· 82 81 -1 83 82 }; 84 83 84 + static int hsusb_link_clk_reset(struct clk *link_clk, bool assert) 85 + { 86 + int ret; 87 + 88 + if (assert) { 89 + ret = clk_reset(link_clk, CLK_RESET_ASSERT); 90 + if (ret) 91 + pr_err("usb hs_clk assert failed\n"); 92 + } else { 93 + ret = clk_reset(link_clk, CLK_RESET_DEASSERT); 94 + if (ret) 95 + pr_err("usb hs_clk deassert failed\n"); 96 + } 97 + return ret; 98 + } 99 + 100 + static int hsusb_phy_clk_reset(struct clk *phy_clk) 101 + { 102 + int ret; 103 + 104 + ret = clk_reset(phy_clk, CLK_RESET_ASSERT); 105 + if (ret) { 106 + pr_err("usb phy clk assert failed\n"); 107 + return ret; 108 + } 109 + usleep_range(10000, 12000); 110 + ret = clk_reset(phy_clk, CLK_RESET_DEASSERT); 111 + if (ret) 112 + pr_err("usb phy clk deassert failed\n"); 113 + return ret; 114 + } 115 + 85 116 static struct msm_otg_platform_data msm_otg_pdata = { 86 117 .phy_init_seq = hsusb_phy_init_seq, 87 118 .mode = USB_PERIPHERAL, 88 119 .otg_control = OTG_PHY_CONTROL, 120 + .link_clk_reset = hsusb_link_clk_reset, 121 + .phy_clk_reset = hsusb_phy_clk_reset, 89 122 }; 90 123 91 124 static struct platform_device *devices[] __initdata = {
+6 -6
arch/arm/mach-msm/board-trout.c
··· 13 13 * GNU General Public License for more details. 14 14 * 15 15 */ 16 + #define pr_fmt(fmt) "%s: " fmt, __func__ 16 17 17 18 #include <linux/kernel.h> 18 19 #include <linux/init.h> ··· 69 68 70 69 platform_add_devices(devices, ARRAY_SIZE(devices)); 71 70 72 - #ifdef CONFIG_MMC 73 - rc = trout_init_mmc(system_rev); 74 - if (rc) 75 - printk(KERN_CRIT "%s: MMC init failure (%d)\n", __func__, rc); 76 - #endif 77 - 71 + if (IS_ENABLED(CONFIG_MMC)) { 72 + rc = trout_init_mmc(system_rev); 73 + if (rc) 74 + pr_crit("MMC init failure (%d)\n", rc); 75 + } 78 76 } 79 77 80 78 static struct map_desc trout_io_desc[] __initdata = {
+1 -1
drivers/mmc/host/Kconfig
··· 324 324 325 325 config MMC_MSM 326 326 tristate "Qualcomm SDCC Controller Support" 327 - depends on MMC && ARCH_MSM 327 + depends on MMC && (ARCH_MSM7X00A || ARCH_MSM7X30 || ARCH_QSD8X50) 328 328 help 329 329 This provides support for the SD/MMC cell found in the 330 330 MSM and QSD SOCs from Qualcomm. The controller also has
+1 -1
drivers/tty/serial/Kconfig
··· 1035 1035 1036 1036 config SERIAL_MSM_HS 1037 1037 tristate "MSM UART High Speed: Serial Driver" 1038 - depends on ARCH_MSM 1038 + depends on ARCH_MSM7X00A || ARCH_MSM7X30 || ARCH_QSD8X50 1039 1039 select SERIAL_CORE 1040 1040 help 1041 1041 If you have a machine based on MSM family of SoCs, you
+15 -20
drivers/usb/phy/phy-msm-usb.c
··· 40 40 #include <linux/usb/msm_hsusb_hw.h> 41 41 #include <linux/regulator/consumer.h> 42 42 43 - #include <mach/clk.h> 44 - 45 43 #define MSM_USB_BASE (motg->regs) 46 44 #define DRIVER_NAME "msm_otg" 47 45 ··· 306 308 307 309 static int msm_otg_link_clk_reset(struct msm_otg *motg, bool assert) 308 310 { 309 - int ret; 311 + int ret = 0; 310 312 311 - if (assert) { 312 - ret = clk_reset(motg->clk, CLK_RESET_ASSERT); 313 - if (ret) 314 - dev_err(motg->phy.dev, "usb hs_clk assert failed\n"); 315 - } else { 316 - ret = clk_reset(motg->clk, CLK_RESET_DEASSERT); 317 - if (ret) 318 - dev_err(motg->phy.dev, "usb hs_clk deassert failed\n"); 319 - } 313 + if (!motg->pdata->link_clk_reset) 314 + return ret; 315 + 316 + ret = motg->pdata->link_clk_reset(motg->clk, assert); 317 + if (ret) 318 + dev_err(motg->phy.dev, "usb link clk reset %s failed\n", 319 + assert ? "assert" : "deassert"); 320 + 320 321 return ret; 321 322 } 322 323 323 324 static int msm_otg_phy_clk_reset(struct msm_otg *motg) 324 325 { 325 - int ret; 326 + int ret = 0; 326 327 327 - ret = clk_reset(motg->phy_reset_clk, CLK_RESET_ASSERT); 328 - if (ret) { 329 - dev_err(motg->phy.dev, "usb phy clk assert failed\n"); 328 + if (!motg->pdata->phy_clk_reset) 330 329 return ret; 331 - } 332 - usleep_range(10000, 12000); 333 - ret = clk_reset(motg->phy_reset_clk, CLK_RESET_DEASSERT); 330 + 331 + ret = motg->pdata->phy_clk_reset(motg->phy_reset_clk); 334 332 if (ret) 335 - dev_err(motg->phy.dev, "usb phy clk deassert failed\n"); 333 + dev_err(motg->phy.dev, "usb phy clk reset failed\n"); 334 + 336 335 return ret; 337 336 } 338 337
+3
include/linux/usb/msm_hsusb.h
··· 20 20 21 21 #include <linux/types.h> 22 22 #include <linux/usb/otg.h> 23 + #include <linux/clk.h> 23 24 24 25 /** 25 26 * Supported USB modes ··· 136 135 enum msm_usb_phy_type phy_type; 137 136 void (*setup_gpio)(enum usb_otg_state state); 138 137 char *pclk_src_name; 138 + int (*link_clk_reset)(struct clk *link_clk, bool assert); 139 + int (*phy_clk_reset)(struct clk *phy_clk); 139 140 }; 140 141 141 142 /**