patch usb-r8a66597-hcd-use-platform_data-instead-of-module_param.patch added to gregkh-2.6 tree
[email protected]
AppliedThis is a note to let you know that I've just added the patch titled
Subject: USB: r8a66597-hcd: use platform_data instead of module_param
to my gregkh-2.6 tree. Its filename is
usb-r8a66597-hcd-use-platform_data-instead-of-module_param.patch
This tree can be found at
http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/
From [email protected] Tue Jun 2 12:27:45 2009
From: Yoshihiro Shimoda <[email protected]>
Date: Tue, 26 May 2009 18:24:34 +0900
Subject: USB: r8a66597-hcd: use platform_data instead of module_param
To: Greg Kroah-Hartman <[email protected]>
Cc: Paul Mundt <[email protected]>, SH-Linux <[email protected]>
Message-ID: <[email protected]>
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.
--- drivers/usb/host/r8a66597-hcd.c | 60 +++++++++------------------------------- drivers/usb/host/r8a66597.h | 38 ++++++++++++++++++++++--- include/linux/usb/r8a66597.h | 44 +++++++++++++++++++++++++++++ 3 files changed, 92 insertions(+), 50 deletions(-)
drivers/usb/host/r8a66597.h +34 -4
@@ -30,6 +30,8 @@#include <linux/clk.h> #endif +#include <linux/usb/r8a66597.h> +#define SYSCFG0 0x00#define SYSCFG1 0x02#define SYSSTS0 0x04
@@ -488,6 +490,7 @@ struct r8a66597 {#if defined(CONFIG_SUPERH_ON_CHIP_R8A66597 ) && defined(CONFIG_HAVE_CLK )struct clk *clk;#endif +struct r8a66597_platdata *pdata;struct r8a66597_device device0;struct r8a66597_root_hub root_hub[R8A66597_MAX_ROOT_HUB ];struct list_head pipe_queue[R8A66597_MAX_NUM_PIPE ];
@@ -506,6 +509,7 @@ struct r8a66597 {unsigned long child_connect_map[4 ]; unsigned bus_suspended:1; + unsigned irq_sense_low:1; };static inline struct r8a66597 *hcd_to_r8a66597 (struct usb_hcd *hcd)
@@ -660,10 +664,36 @@ static inline void r8a66597_port_power(s {unsigned long dvstctr_reg =get_dvstctr_reg (port); -if (power) -r8a66597_bset (r8a66597,VBOUT , dvstctr_reg); -else -r8a66597_bclr (r8a66597,VBOUT , dvstctr_reg); +if (r8a66597->pdata->port_power) { + r8a66597->pdata->port_power (port, power); + }else { +if (power) +r8a66597_bset (r8a66597,VBOUT , dvstctr_reg); +else +r8a66597_bclr (r8a66597,VBOUT , dvstctr_reg); + } +} + +static inline u16 get_xtal_from_pdata (struct r8a66597_platdata *pdata) +{ +u16 clock =0 ; + +switch (pdata->xtal) { +case R8A66597_PLATDATA_XTAL_12MHZ : + clock =XTAL12 ; +break ; +case R8A66597_PLATDATA_XTAL_24MHZ : + clock =XTAL24 ; +break ; +case R8A66597_PLATDATA_XTAL_48MHZ : + clock =XTAL48 ; +break ; +default : +printk (KERN_ERR "r8a66597: platdata clock is wrong.\n" ); +break ; + } + +return clock; }#define get_pipectr_addr (pipenum) (PIPE1CTR + (pipenum - 1) * 2)
drivers/usb/host/r8a66597-hcd.c +14 -46
99 lines not on this page · raw message
include/linux/usb/r8a66597.h new file +44 -0
44 lines not on this page · raw message