diff options
author | Hong Xu <hong.xu@atmel.com> | 2009-09-25 06:24:12 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-12-11 14:55:15 -0500 |
commit | 23f6d914c338626a7216c46ed35b653f4070accf (patch) | |
tree | fcb3e9249560427744f87d1fb11d75db66205a61 /drivers/usb | |
parent | 0ad72524ef623f32f6899e656951bb5646caead1 (diff) |
USB: modifications for at91sam9g10
Modify both host and gadget USB drivers for at91sam9g10.
This add a clock management equivalent to at91sam9261 on usb drivers.
It also add the way of handling gadget pull-ups (like the at91sam9261).
Signed-off-by: Hong Xu <hong.xu@atmel.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/gadget/at91_udc.c | 6 | ||||
-rw-r--r-- | drivers/usb/host/ohci-at91.c | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/drivers/usb/gadget/at91_udc.c b/drivers/usb/gadget/at91_udc.c index 66450a1abc22..043e04db2a05 100644 --- a/drivers/usb/gadget/at91_udc.c +++ b/drivers/usb/gadget/at91_udc.c | |||
@@ -892,7 +892,7 @@ static void pullup(struct at91_udc *udc, int is_on) | |||
892 | 892 | ||
893 | txvc |= AT91_UDP_TXVC_PUON; | 893 | txvc |= AT91_UDP_TXVC_PUON; |
894 | at91_udp_write(udc, AT91_UDP_TXVC, txvc); | 894 | at91_udp_write(udc, AT91_UDP_TXVC, txvc); |
895 | } else if (cpu_is_at91sam9261()) { | 895 | } else if (cpu_is_at91sam9261() || cpu_is_at91sam9g10()) { |
896 | u32 usbpucr; | 896 | u32 usbpucr; |
897 | 897 | ||
898 | usbpucr = at91_sys_read(AT91_MATRIX_USBPUCR); | 898 | usbpucr = at91_sys_read(AT91_MATRIX_USBPUCR); |
@@ -910,7 +910,7 @@ static void pullup(struct at91_udc *udc, int is_on) | |||
910 | 910 | ||
911 | txvc &= ~AT91_UDP_TXVC_PUON; | 911 | txvc &= ~AT91_UDP_TXVC_PUON; |
912 | at91_udp_write(udc, AT91_UDP_TXVC, txvc); | 912 | at91_udp_write(udc, AT91_UDP_TXVC, txvc); |
913 | } else if (cpu_is_at91sam9261()) { | 913 | } else if (cpu_is_at91sam9261() || cpu_is_at91sam9g10()) { |
914 | u32 usbpucr; | 914 | u32 usbpucr; |
915 | 915 | ||
916 | usbpucr = at91_sys_read(AT91_MATRIX_USBPUCR); | 916 | usbpucr = at91_sys_read(AT91_MATRIX_USBPUCR); |
@@ -1692,7 +1692,7 @@ static int __init at91udc_probe(struct platform_device *pdev) | |||
1692 | udc->ep[3].maxpacket = 64; | 1692 | udc->ep[3].maxpacket = 64; |
1693 | udc->ep[4].maxpacket = 512; | 1693 | udc->ep[4].maxpacket = 512; |
1694 | udc->ep[5].maxpacket = 512; | 1694 | udc->ep[5].maxpacket = 512; |
1695 | } else if (cpu_is_at91sam9261()) { | 1695 | } else if (cpu_is_at91sam9261() || cpu_is_at91sam9g10()) { |
1696 | udc->ep[3].maxpacket = 64; | 1696 | udc->ep[3].maxpacket = 64; |
1697 | } else if (cpu_is_at91sam9263()) { | 1697 | } else if (cpu_is_at91sam9263()) { |
1698 | udc->ep[0].maxpacket = 64; | 1698 | udc->ep[0].maxpacket = 64; |
diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index 7ccffcbe7b6f..68b83ab70719 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c | |||
@@ -35,7 +35,7 @@ extern int usb_disabled(void); | |||
35 | 35 | ||
36 | static void at91_start_clock(void) | 36 | static void at91_start_clock(void) |
37 | { | 37 | { |
38 | if (cpu_is_at91sam9261()) | 38 | if (cpu_is_at91sam9261() || cpu_is_at91sam9g10()) |
39 | clk_enable(hclk); | 39 | clk_enable(hclk); |
40 | clk_enable(iclk); | 40 | clk_enable(iclk); |
41 | clk_enable(fclk); | 41 | clk_enable(fclk); |
@@ -46,7 +46,7 @@ static void at91_stop_clock(void) | |||
46 | { | 46 | { |
47 | clk_disable(fclk); | 47 | clk_disable(fclk); |
48 | clk_disable(iclk); | 48 | clk_disable(iclk); |
49 | if (cpu_is_at91sam9261()) | 49 | if (cpu_is_at91sam9261() || cpu_is_at91sam9g10()) |
50 | clk_disable(hclk); | 50 | clk_disable(hclk); |
51 | clocked = 0; | 51 | clocked = 0; |
52 | } | 52 | } |
@@ -142,7 +142,7 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver, | |||
142 | 142 | ||
143 | iclk = clk_get(&pdev->dev, "ohci_clk"); | 143 | iclk = clk_get(&pdev->dev, "ohci_clk"); |
144 | fclk = clk_get(&pdev->dev, "uhpck"); | 144 | fclk = clk_get(&pdev->dev, "uhpck"); |
145 | if (cpu_is_at91sam9261()) | 145 | if (cpu_is_at91sam9261() || cpu_is_at91sam9g10()) |
146 | hclk = clk_get(&pdev->dev, "hck0"); | 146 | hclk = clk_get(&pdev->dev, "hck0"); |
147 | 147 | ||
148 | at91_start_hc(pdev); | 148 | at91_start_hc(pdev); |
@@ -155,7 +155,7 @@ static int usb_hcd_at91_probe(const struct hc_driver *driver, | |||
155 | /* Error handling */ | 155 | /* Error handling */ |
156 | at91_stop_hc(pdev); | 156 | at91_stop_hc(pdev); |
157 | 157 | ||
158 | if (cpu_is_at91sam9261()) | 158 | if (cpu_is_at91sam9261() || cpu_is_at91sam9g10()) |
159 | clk_put(hclk); | 159 | clk_put(hclk); |
160 | clk_put(fclk); | 160 | clk_put(fclk); |
161 | clk_put(iclk); | 161 | clk_put(iclk); |
@@ -192,7 +192,7 @@ static void usb_hcd_at91_remove(struct usb_hcd *hcd, | |||
192 | release_mem_region(hcd->rsrc_start, hcd->rsrc_len); | 192 | release_mem_region(hcd->rsrc_start, hcd->rsrc_len); |
193 | usb_put_hcd(hcd); | 193 | usb_put_hcd(hcd); |
194 | 194 | ||
195 | if (cpu_is_at91sam9261()) | 195 | if (cpu_is_at91sam9261() || cpu_is_at91sam9g10()) |
196 | clk_put(hclk); | 196 | clk_put(hclk); |
197 | clk_put(fclk); | 197 | clk_put(fclk); |
198 | clk_put(iclk); | 198 | clk_put(iclk); |