diff options
author | Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> | 2009-05-26 05:24:34 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-06-16 00:44:46 -0400 |
commit | 5effabbe9e6e0089f7afdde35cb51e8c8b4cf6bc (patch) | |
tree | d70e441a981a850a2df1bef79a75b8bad27bccf7 /drivers/usb/host/r8a66597.h | |
parent | 32ebbe7b6ad44ae9c276419710b56de6ba705303 (diff) |
USB: r8a66597-hcd: use platform_data instead of module_param
CPU/board specific parameters (PLL clock, vif etc...) can be set
by platform_data instead of module_param.
v2: remove irq_sense member in platform_data because it can OR in
IRQF_TRIGGER_LOW or IRQF_TRIGGER_FALLING against IORESOURCE_IRQ in
the struct resource.
Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Reviewed-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/host/r8a66597.h')
-rw-r--r-- | drivers/usb/host/r8a66597.h | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/drivers/usb/host/r8a66597.h b/drivers/usb/host/r8a66597.h index f49208f1bb74..d72680b433f9 100644 --- a/drivers/usb/host/r8a66597.h +++ b/drivers/usb/host/r8a66597.h | |||
@@ -30,6 +30,8 @@ | |||
30 | #include <linux/clk.h> | 30 | #include <linux/clk.h> |
31 | #endif | 31 | #endif |
32 | 32 | ||
33 | #include <linux/usb/r8a66597.h> | ||
34 | |||
33 | #define SYSCFG0 0x00 | 35 | #define SYSCFG0 0x00 |
34 | #define SYSCFG1 0x02 | 36 | #define SYSCFG1 0x02 |
35 | #define SYSSTS0 0x04 | 37 | #define SYSSTS0 0x04 |
@@ -488,6 +490,7 @@ struct r8a66597 { | |||
488 | #if defined(CONFIG_SUPERH_ON_CHIP_R8A66597) && defined(CONFIG_HAVE_CLK) | 490 | #if defined(CONFIG_SUPERH_ON_CHIP_R8A66597) && defined(CONFIG_HAVE_CLK) |
489 | struct clk *clk; | 491 | struct clk *clk; |
490 | #endif | 492 | #endif |
493 | struct r8a66597_platdata *pdata; | ||
491 | struct r8a66597_device device0; | 494 | struct r8a66597_device device0; |
492 | struct r8a66597_root_hub root_hub[R8A66597_MAX_ROOT_HUB]; | 495 | struct r8a66597_root_hub root_hub[R8A66597_MAX_ROOT_HUB]; |
493 | struct list_head pipe_queue[R8A66597_MAX_NUM_PIPE]; | 496 | struct list_head pipe_queue[R8A66597_MAX_NUM_PIPE]; |
@@ -506,6 +509,7 @@ struct r8a66597 { | |||
506 | unsigned long child_connect_map[4]; | 509 | unsigned long child_connect_map[4]; |
507 | 510 | ||
508 | unsigned bus_suspended:1; | 511 | unsigned bus_suspended:1; |
512 | unsigned irq_sense_low:1; | ||
509 | }; | 513 | }; |
510 | 514 | ||
511 | static inline struct r8a66597 *hcd_to_r8a66597(struct usb_hcd *hcd) | 515 | static inline struct r8a66597 *hcd_to_r8a66597(struct usb_hcd *hcd) |
@@ -660,10 +664,36 @@ static inline void r8a66597_port_power(struct r8a66597 *r8a66597, int port, | |||
660 | { | 664 | { |
661 | unsigned long dvstctr_reg = get_dvstctr_reg(port); | 665 | unsigned long dvstctr_reg = get_dvstctr_reg(port); |
662 | 666 | ||
663 | if (power) | 667 | if (r8a66597->pdata->port_power) { |
664 | r8a66597_bset(r8a66597, VBOUT, dvstctr_reg); | 668 | r8a66597->pdata->port_power(port, power); |
665 | else | 669 | } else { |
666 | r8a66597_bclr(r8a66597, VBOUT, dvstctr_reg); | 670 | if (power) |
671 | r8a66597_bset(r8a66597, VBOUT, dvstctr_reg); | ||
672 | else | ||
673 | r8a66597_bclr(r8a66597, VBOUT, dvstctr_reg); | ||
674 | } | ||
675 | } | ||
676 | |||
677 | static inline u16 get_xtal_from_pdata(struct r8a66597_platdata *pdata) | ||
678 | { | ||
679 | u16 clock = 0; | ||
680 | |||
681 | switch (pdata->xtal) { | ||
682 | case R8A66597_PLATDATA_XTAL_12MHZ: | ||
683 | clock = XTAL12; | ||
684 | break; | ||
685 | case R8A66597_PLATDATA_XTAL_24MHZ: | ||
686 | clock = XTAL24; | ||
687 | break; | ||
688 | case R8A66597_PLATDATA_XTAL_48MHZ: | ||
689 | clock = XTAL48; | ||
690 | break; | ||
691 | default: | ||
692 | printk(KERN_ERR "r8a66597: platdata clock is wrong.\n"); | ||
693 | break; | ||
694 | } | ||
695 | |||
696 | return clock; | ||
667 | } | 697 | } |
668 | 698 | ||
669 | #define get_pipectr_addr(pipenum) (PIPE1CTR + (pipenum - 1) * 2) | 699 | #define get_pipectr_addr(pipenum) (PIPE1CTR + (pipenum - 1) * 2) |