aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2016-02-24 20:16:01 -0500
committerOlof Johansson <olof@lixom.net>2016-02-24 20:17:01 -0500
commitf628c64fc0ffdcd08f39d74ec23ed7706cb8653b (patch)
tree91c6355e506b09691418c01bed69271c08e057c1 /drivers/usb
parent962f08f8596bfbb54f3978d9c7e649bedf92c7f0 (diff)
parent0002ca168f16e5b6ac67415a4e0198cc39af2b7f (diff)
Merge tag 'at91-ab-4.6-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux into next/drivers
From Alexandre Belloni: "This is a rework of the PMC driver. It touches multiple subsystems so the easiest path is through arm-soc." drivers update for 4.6: - Big PMC rework that touches clk, PM, usb * tag 'at91-ab-4.6-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: clk: at91: remove useless includes clk: at91: pmc: remove useless capacities handling clk: at91: pmc: drop at91_pmc_base usb: gadget: atmel: access the PMC using regmap ARM: at91: remove useless includes and function prototypes ARM: at91: pm: move idle functions to pm.c ARM: at91: pm: find and remap the pmc ARM: at91: pm: simply call at91_pm_init clk: at91: pmc: move pmc structures to C file clk: at91: pmc: merge at91_pmc_init in atmel_pmc_probe clk: at91: remove IRQ handling and use polling clk: at91: make use of syscon/regmap internally clk: at91: make use of syscon to share PMC registers in several drivers Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/udc/atmel_usba_udc.c20
-rw-r--r--drivers/usb/gadget/udc/atmel_usba_udc.h2
2 files changed, 12 insertions, 10 deletions
diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b/drivers/usb/gadget/udc/atmel_usba_udc.c
index 8755b2c2aada..04265de885a9 100644
--- a/drivers/usb/gadget/udc/atmel_usba_udc.c
+++ b/drivers/usb/gadget/udc/atmel_usba_udc.c
@@ -17,7 +17,9 @@
17#include <linux/device.h> 17#include <linux/device.h>
18#include <linux/dma-mapping.h> 18#include <linux/dma-mapping.h>
19#include <linux/list.h> 19#include <linux/list.h>
20#include <linux/mfd/syscon.h>
20#include <linux/platform_device.h> 21#include <linux/platform_device.h>
22#include <linux/regmap.h>
21#include <linux/usb/ch9.h> 23#include <linux/usb/ch9.h>
22#include <linux/usb/gadget.h> 24#include <linux/usb/gadget.h>
23#include <linux/usb/atmel_usba_udc.h> 25#include <linux/usb/atmel_usba_udc.h>
@@ -1888,20 +1890,15 @@ static int atmel_usba_stop(struct usb_gadget *gadget)
1888#ifdef CONFIG_OF 1890#ifdef CONFIG_OF
1889static void at91sam9rl_toggle_bias(struct usba_udc *udc, int is_on) 1891static void at91sam9rl_toggle_bias(struct usba_udc *udc, int is_on)
1890{ 1892{
1891 unsigned int uckr = at91_pmc_read(AT91_CKGR_UCKR); 1893 regmap_update_bits(udc->pmc, AT91_CKGR_UCKR, AT91_PMC_BIASEN,
1892 1894 is_on ? AT91_PMC_BIASEN : 0);
1893 if (is_on)
1894 at91_pmc_write(AT91_CKGR_UCKR, uckr | AT91_PMC_BIASEN);
1895 else
1896 at91_pmc_write(AT91_CKGR_UCKR, uckr & ~(AT91_PMC_BIASEN));
1897} 1895}
1898 1896
1899static void at91sam9g45_pulse_bias(struct usba_udc *udc) 1897static void at91sam9g45_pulse_bias(struct usba_udc *udc)
1900{ 1898{
1901 unsigned int uckr = at91_pmc_read(AT91_CKGR_UCKR); 1899 regmap_update_bits(udc->pmc, AT91_CKGR_UCKR, AT91_PMC_BIASEN, 0);
1902 1900 regmap_update_bits(udc->pmc, AT91_CKGR_UCKR, AT91_PMC_BIASEN,
1903 at91_pmc_write(AT91_CKGR_UCKR, uckr & ~(AT91_PMC_BIASEN)); 1901 AT91_PMC_BIASEN);
1904 at91_pmc_write(AT91_CKGR_UCKR, uckr | AT91_PMC_BIASEN);
1905} 1902}
1906 1903
1907static const struct usba_udc_errata at91sam9rl_errata = { 1904static const struct usba_udc_errata at91sam9rl_errata = {
@@ -1938,6 +1935,9 @@ static struct usba_ep * atmel_udc_of_init(struct platform_device *pdev,
1938 return ERR_PTR(-EINVAL); 1935 return ERR_PTR(-EINVAL);
1939 1936
1940 udc->errata = match->data; 1937 udc->errata = match->data;
1938 udc->pmc = syscon_regmap_lookup_by_compatible("atmel,at91sam9g45-pmc");
1939 if (udc->errata && IS_ERR(udc->pmc))
1940 return ERR_CAST(udc->pmc);
1941 1941
1942 udc->num_ep = 0; 1942 udc->num_ep = 0;
1943 1943
diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.h b/drivers/usb/gadget/udc/atmel_usba_udc.h
index ea448a344767..3e1c9d589dfa 100644
--- a/drivers/usb/gadget/udc/atmel_usba_udc.h
+++ b/drivers/usb/gadget/udc/atmel_usba_udc.h
@@ -354,6 +354,8 @@ struct usba_udc {
354 struct dentry *debugfs_root; 354 struct dentry *debugfs_root;
355 struct dentry *debugfs_regs; 355 struct dentry *debugfs_regs;
356#endif 356#endif
357
358 struct regmap *pmc;
357}; 359};
358 360
359static inline struct usba_ep *to_usba_ep(struct usb_ep *ep) 361static inline struct usba_ep *to_usba_ep(struct usb_ep *ep)