Loading Documentation/devicetree/bindings/usb/msm-hsic-peripheral.txt +2 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ Required properties: - interrupts: IRQ lines used by this controller - <supply-name>-supply: handle to the regulator device tree node Required "supply-name" is either "hsic_vdd_dig" or "HSIC_VDDCX" and optional "GDSC". Optional properties : - qcom,usb-id-core: USB Core Index to be used to bind with gadget driver. Loading @@ -19,4 +20,5 @@ Example USB HSIC device node : interrupts = <0 136 0>; qcom,usb-id-core = <1>; HSIC_VDDCX-supply = <&pmd9635_l2>; GDSC-supply = <&gdsc_usb_hsic>; }; drivers/usb/gadget/ci13xxx_msm_hsic.c +34 −1 Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ struct msm_hsic_per { struct clk *cal_clk; struct regulator *hsic_vddcx; bool async_int; struct regulator *hsic_gdsc; void __iomem *regs; int irq; atomic_t in_lpm; Loading Loading @@ -201,6 +202,30 @@ static int msm_hsic_phy_reset(struct msm_hsic_per *mhsic) return 0; } static int msm_hsic_config_gdsc(struct platform_device *pdev, struct msm_hsic_per *mhsic, bool enable) { int ret = 0; if (!mhsic->hsic_gdsc) { mhsic->hsic_gdsc = devm_regulator_get(&pdev->dev, "GDSC"); if (IS_ERR(mhsic->hsic_gdsc)) return 0; } if (enable) { ret = regulator_enable(mhsic->hsic_gdsc); if (ret) { dev_err(mhsic->dev, "unable to enable hsic gdsc\n"); return ret; } } else { regulator_disable(mhsic->hsic_gdsc); } return 0; } static int msm_hsic_enable_clocks(struct platform_device *pdev, struct msm_hsic_per *mhsic, bool enable) { Loading Loading @@ -728,12 +753,18 @@ static int msm_hsic_probe(struct platform_device *pdev) } dev_info(&pdev->dev, "HSIC Peripheral regs = %p\n", mhsic->regs); ret = msm_hsic_config_gdsc(pdev, mhsic, true); if (ret) { dev_err(&pdev->dev, "unable to configure hsic gdsc\n"); goto unmap; } ret = msm_hsic_enable_clocks(pdev, mhsic, true); if (ret) { dev_err(&pdev->dev, "msm_hsic_enable_clocks failed\n"); ret = -ENODEV; goto unmap; goto unconfig_gdsc; } ret = msm_hsic_init_vddcx(mhsic, 1); if (ret) { Loading Loading @@ -781,6 +812,8 @@ deinit_vddcx: msm_hsic_init_vddcx(mhsic, 0); deinit_clocks: msm_hsic_enable_clocks(pdev, mhsic, 0); unconfig_gdsc: msm_hsic_config_gdsc(pdev, mhsic, false); unmap: iounmap(mhsic->regs); error: Loading Loading
Documentation/devicetree/bindings/usb/msm-hsic-peripheral.txt +2 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ Required properties: - interrupts: IRQ lines used by this controller - <supply-name>-supply: handle to the regulator device tree node Required "supply-name" is either "hsic_vdd_dig" or "HSIC_VDDCX" and optional "GDSC". Optional properties : - qcom,usb-id-core: USB Core Index to be used to bind with gadget driver. Loading @@ -19,4 +20,5 @@ Example USB HSIC device node : interrupts = <0 136 0>; qcom,usb-id-core = <1>; HSIC_VDDCX-supply = <&pmd9635_l2>; GDSC-supply = <&gdsc_usb_hsic>; };
drivers/usb/gadget/ci13xxx_msm_hsic.c +34 −1 Original line number Diff line number Diff line Loading @@ -58,6 +58,7 @@ struct msm_hsic_per { struct clk *cal_clk; struct regulator *hsic_vddcx; bool async_int; struct regulator *hsic_gdsc; void __iomem *regs; int irq; atomic_t in_lpm; Loading Loading @@ -201,6 +202,30 @@ static int msm_hsic_phy_reset(struct msm_hsic_per *mhsic) return 0; } static int msm_hsic_config_gdsc(struct platform_device *pdev, struct msm_hsic_per *mhsic, bool enable) { int ret = 0; if (!mhsic->hsic_gdsc) { mhsic->hsic_gdsc = devm_regulator_get(&pdev->dev, "GDSC"); if (IS_ERR(mhsic->hsic_gdsc)) return 0; } if (enable) { ret = regulator_enable(mhsic->hsic_gdsc); if (ret) { dev_err(mhsic->dev, "unable to enable hsic gdsc\n"); return ret; } } else { regulator_disable(mhsic->hsic_gdsc); } return 0; } static int msm_hsic_enable_clocks(struct platform_device *pdev, struct msm_hsic_per *mhsic, bool enable) { Loading Loading @@ -728,12 +753,18 @@ static int msm_hsic_probe(struct platform_device *pdev) } dev_info(&pdev->dev, "HSIC Peripheral regs = %p\n", mhsic->regs); ret = msm_hsic_config_gdsc(pdev, mhsic, true); if (ret) { dev_err(&pdev->dev, "unable to configure hsic gdsc\n"); goto unmap; } ret = msm_hsic_enable_clocks(pdev, mhsic, true); if (ret) { dev_err(&pdev->dev, "msm_hsic_enable_clocks failed\n"); ret = -ENODEV; goto unmap; goto unconfig_gdsc; } ret = msm_hsic_init_vddcx(mhsic, 1); if (ret) { Loading Loading @@ -781,6 +812,8 @@ deinit_vddcx: msm_hsic_init_vddcx(mhsic, 0); deinit_clocks: msm_hsic_enable_clocks(pdev, mhsic, 0); unconfig_gdsc: msm_hsic_config_gdsc(pdev, mhsic, false); unmap: iounmap(mhsic->regs); error: Loading