* [PATCH] [2.6] Clean up SL811 headers
@ 2005-01-06 1:30 Kyle Moffett
2005-01-06 9:12 ` Russell King
0 siblings, 1 reply; 3+ messages in thread
From: Kyle Moffett @ 2005-01-06 1:30 UTC (permalink / raw)
To: Linux Kernel Mailing List
[-- Attachment #1: Type: text/plain, Size: 278 bytes --]
The USB SL811 host has a structure stuck in linux/usb_sl811.h As this
structure is kernel private and only used by a single piece of code,
this
patch moves it to the header file from which it is used, deleting the
old one.
Signed-off-by: Kyle Moffett <mrmacman_g4@mac.com>
[-- Attachment #2: cleanup-sl811-headers.patch --]
[-- Type: application/octet-stream, Size: 2275 bytes --]
Index: drivers/usb/host/sl811.h
===================================================================
RCS file: /home/kyle/bklinux/cvs/linux-2.5/drivers/usb/host/sl811.h,v
retrieving revision 1.2
diff -u -r1.2 sl811.h
--- drivers/usb/host/sl811.h 9 Dec 2004 20:35:50 -0000 1.2
+++ drivers/usb/host/sl811.h 6 Jan 2005 01:13:59 -0000
@@ -117,6 +117,30 @@
#define LOG2_PERIODIC_SIZE 5 /* arbitrary; this matches OHCI */
#define PERIODIC_SIZE (1 << LOG2_PERIODIC_SIZE)
+/*
+ * board initialization should put one of these into dev->platform_data
+ * and place the sl811hs onto platform_bus named "sl811-hcd".
+ */
+struct sl811_platform_data {
+ unsigned can_wakeup:1;
+
+ /* given port_power, msec/2 after power on till power good */
+ u8 potpg;
+
+ /* mA/2 power supplied on this port (max = default = 250) */
+ u8 power;
+
+ /* sl811 relies on an external source of VBUS current */
+ void (*port_power)(struct device *dev, int is_on);
+
+ /* pulse sl811 nRST (probably with a GPIO) */
+ void (*reset)(struct device *dev);
+
+ // some boards need something like these:
+ // int (*check_overcurrent)(struct device *dev);
+ // void (*clock_enable)(struct device *dev, int is_on);
+};
+
struct sl811 {
struct usb_hcd hcd;
spinlock_t lock;
Index: include/linux/usb_sl811.h
===================================================================
RCS file: include/linux/usb_sl811.h
diff -N include/linux/usb_sl811.h
--- include/linux/usb_sl811.h 9 Dec 2004 20:35:50 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,26 +0,0 @@
-
-/*
- * board initialization should put one of these into dev->platform_data
- * and place the sl811hs onto platform_bus named "sl811-hcd".
- */
-
-struct sl811_platform_data {
- unsigned can_wakeup:1;
-
- /* given port_power, msec/2 after power on till power good */
- u8 potpg;
-
- /* mA/2 power supplied on this port (max = default = 250) */
- u8 power;
-
- /* sl811 relies on an external source of VBUS current */
- void (*port_power)(struct device *dev, int is_on);
-
- /* pulse sl811 nRST (probably with a GPIO) */
- void (*reset)(struct device *dev);
-
- // some boards need something like these:
- // int (*check_overcurrent)(struct device *dev);
- // void (*clock_enable)(struct device *dev, int is_on);
-};
-
[-- Attachment #3: Type: text/plain, Size: 311 bytes --]
Cheers,
Kyle Moffett
-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCM/CS/IT/U d- s++: a18 C++++>$ UB/L/X/*++++(+)>$ P+++(++++)>$
L++++(+++) E W++(+) N+++(++) o? K? w--- O? M++ V? PS+() PE+(-) Y+
PGP+++ t+(+++) 5 X R? tv-(--) b++++(++) DI+ D+ G e->++++$ h!*()>++$ r
!y?(-)
------END GEEK CODE BLOCK------
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] [2.6] Clean up SL811 headers
2005-01-06 1:30 Kyle Moffett
@ 2005-01-06 9:12 ` Russell King
0 siblings, 0 replies; 3+ messages in thread
From: Russell King @ 2005-01-06 9:12 UTC (permalink / raw)
To: Kyle Moffett; +Cc: Linux Kernel Mailing List
On Wed, Jan 05, 2005 at 08:30:25PM -0500, Kyle Moffett wrote:
> The USB SL811 host has a structure stuck in linux/usb_sl811.h As this
> structure is kernel private and only used by a single piece of code,
> this
> patch moves it to the header file from which it is used, deleting the
> old one.
>
> Signed-off-by: Kyle Moffett <mrmacman_g4@mac.com>
No. It's platform data. That means that platforms, (eg, arch/arm/mach-pxa)
are expected to supply it to the SL811 driver.
linux/usb_sl811.h is the correct location for it. The platforms which
use it are not merged just yet, but the SL811 driver is a recent merge
in preparation of this happening.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 PCMCIA - http://pcmcia.arm.linux.org.uk/
2.6 Serial core
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] [2.6] Clean up SL811 headers
@ 2005-01-06 9:31 David Brownell
0 siblings, 0 replies; 3+ messages in thread
From: David Brownell @ 2005-01-06 9:31 UTC (permalink / raw)
To: Linux Kernel list; +Cc: kyle moffett
Kyle Moffett said:
> The USB SL811 host has a structure stuck in linux/usb_sl811.h As this
> structure is kernel private and only used by a single piece of code,
That's very wrong ... the structure in question is the interface between
the board-specific setup and the driver (as it says in the comment). A
better way to put the situation is that www.kernel.org doesn't currently
bundle support for a board that wires that chip into its platform_bus.
> this patch moves it to the header file from which it is used, deleting the
> old one.
Here's a thought experiment for you ... do that for EVERY driver
on the platform_bus, and see how quickly you get a big mess.
Board support packages on 2.4 tended to take that approach;
good riddance, IMO.
When you take that approach, then adding support for a new
board means ** CHANGING EVERY DRIVER USED WITH THAT BOARD **
to know how the chip is set up on that particular board.
IRQs, addressing, CPU and GPIO pin multiplexing, support
logic ... yeech!
Better to have a single arch/XYZ/mach-ZYX/board-ABC.c file that
just sets up the relevant platform devices, and the platform_data
those drivers use. The board support packages should be small,
mostly using standard drivers ... not be invasive monsters.
- Dave
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-01-06 9:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-06 9:31 [PATCH] [2.6] Clean up SL811 headers David Brownell
-- strict thread matches above, loose matches on Subject: below --
2005-01-06 1:30 Kyle Moffett
2005-01-06 9:12 ` Russell King
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.