From a570067df9cc1b1821ca5255bbbe8adb67aca199 Mon Sep 17 00:00:00 2001 From: Nicolas Pitre Date: Mon, 19 Dec 2011 03:29:16 -0500 Subject: ARM: big removal of now unused arch_idle() When this is the only content remaining in mach/system.h then the whole file is removed. Signed-off-by: Nicolas Pitre Acked-by: H Hartley Sweeten Acked-and-tested-by: Jamie Iles Acked-by: Tony Lindgren Acked-by: David Brown Acked-by: Stephen Warren Acked-by: Linus Walleij --- arch/arm/mach-pxa/include/mach/system.h | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 arch/arm/mach-pxa/include/mach/system.h (limited to 'arch/arm/mach-pxa') diff --git a/arch/arm/mach-pxa/include/mach/system.h b/arch/arm/mach-pxa/include/mach/system.h deleted file mode 100644 index c5afacd3cc0b..000000000000 --- a/arch/arm/mach-pxa/include/mach/system.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * arch/arm/mach-pxa/include/mach/system.h - * - * Author: Nicolas Pitre - * Created: Jun 15, 2001 - * Copyright: MontaVista Software Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - */ -static inline void arch_idle(void) -{ - cpu_do_idle(); -} -- cgit v1.2.3 From 4e611091f859906c28921cf8d3c75a848fd249bd Mon Sep 17 00:00:00 2001 From: Rob Herring Date: Tue, 3 Jan 2012 16:53:48 -0600 Subject: ARM: pxa: remove NR_IRQS Remove NR_IRQS and add a per machine .nr_irqs setting. Signed-off-by: Rob Herring --- arch/arm/mach-pxa/capc7117.c | 1 + arch/arm/mach-pxa/cm-x300.c | 1 + arch/arm/mach-pxa/colibri-pxa270.c | 2 ++ arch/arm/mach-pxa/colibri-pxa300.c | 1 + arch/arm/mach-pxa/colibri-pxa320.c | 1 + arch/arm/mach-pxa/corgi.c | 3 +++ arch/arm/mach-pxa/csb726.c | 1 + arch/arm/mach-pxa/devices.c | 1 + arch/arm/mach-pxa/em-x270.c | 2 ++ arch/arm/mach-pxa/gumstix.c | 1 + arch/arm/mach-pxa/h5000.c | 1 + arch/arm/mach-pxa/himalaya.c | 1 + arch/arm/mach-pxa/icontrol.c | 1 + arch/arm/mach-pxa/idp.c | 1 + arch/arm/mach-pxa/include/mach/irqs.h | 2 +- arch/arm/mach-pxa/mioa701.c | 1 + arch/arm/mach-pxa/mp900.c | 1 + arch/arm/mach-pxa/palmld.c | 1 + arch/arm/mach-pxa/palmt5.c | 1 + arch/arm/mach-pxa/palmtc.c | 1 + arch/arm/mach-pxa/palmte2.c | 1 + arch/arm/mach-pxa/palmtreo.c | 2 ++ arch/arm/mach-pxa/palmtx.c | 1 + arch/arm/mach-pxa/palmz72.c | 1 + arch/arm/mach-pxa/pxa3xx.c | 1 + arch/arm/mach-pxa/raumfeld.c | 3 +++ arch/arm/mach-pxa/saar.c | 1 + arch/arm/mach-pxa/spitz.c | 3 +++ arch/arm/mach-pxa/stargate2.c | 1 + arch/arm/mach-pxa/tavorevb.c | 1 + arch/arm/mach-pxa/time.c | 1 + arch/arm/mach-pxa/trizeps4.c | 2 ++ arch/arm/mach-pxa/viper.c | 1 + arch/arm/mach-pxa/vpac270.c | 1 + arch/arm/mach-pxa/xcep.c | 1 + arch/arm/mach-pxa/z2.c | 1 + 36 files changed, 46 insertions(+), 1 deletion(-) (limited to 'arch/arm/mach-pxa') diff --git a/arch/arm/mach-pxa/capc7117.c b/arch/arm/mach-pxa/capc7117.c index c91727d1fe09..9a8760b72913 100644 --- a/arch/arm/mach-pxa/capc7117.c +++ b/arch/arm/mach-pxa/capc7117.c @@ -150,6 +150,7 @@ MACHINE_START(CAPC7117, "Embedian CAPC-7117 evaluation kit based on the MXM-8x10 CoM") .atag_offset = 0x100, .map_io = pxa3xx_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa3xx_init_irq, .handle_irq = pxa3xx_handle_irq, .timer = &pxa_timer, diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c index 4b981b82d2a5..133cceefd2a3 100644 --- a/arch/arm/mach-pxa/cm-x300.c +++ b/arch/arm/mach-pxa/cm-x300.c @@ -853,6 +853,7 @@ static void __init cm_x300_fixup(struct tag *tags, char **cmdline, MACHINE_START(CM_X300, "CM-X300 module") .atag_offset = 0x100, .map_io = pxa3xx_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa3xx_init_irq, .handle_irq = pxa3xx_handle_irq, .timer = &pxa_timer, diff --git a/arch/arm/mach-pxa/colibri-pxa270.c b/arch/arm/mach-pxa/colibri-pxa270.c index 29d5d541f602..b2f227d36125 100644 --- a/arch/arm/mach-pxa/colibri-pxa270.c +++ b/arch/arm/mach-pxa/colibri-pxa270.c @@ -310,6 +310,7 @@ MACHINE_START(COLIBRI, "Toradex Colibri PXA270") .atag_offset = 0x100, .init_machine = colibri_pxa270_init, .map_io = pxa27x_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa27x_init_irq, .handle_irq = pxa27x_handle_irq, .timer = &pxa_timer, @@ -320,6 +321,7 @@ MACHINE_START(INCOME, "Income s.r.o. SH-Dmaster PXA270 SBC") .atag_offset = 0x100, .init_machine = colibri_pxa270_income_init, .map_io = pxa27x_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa27x_init_irq, .handle_irq = pxa27x_handle_irq, .timer = &pxa_timer, diff --git a/arch/arm/mach-pxa/colibri-pxa300.c b/arch/arm/mach-pxa/colibri-pxa300.c index 0846d210cb05..bb6def8ec979 100644 --- a/arch/arm/mach-pxa/colibri-pxa300.c +++ b/arch/arm/mach-pxa/colibri-pxa300.c @@ -186,6 +186,7 @@ MACHINE_START(COLIBRI300, "Toradex Colibri PXA300") .atag_offset = 0x100, .init_machine = colibri_pxa300_init, .map_io = pxa3xx_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa3xx_init_irq, .handle_irq = pxa3xx_handle_irq, .timer = &pxa_timer, diff --git a/arch/arm/mach-pxa/colibri-pxa320.c b/arch/arm/mach-pxa/colibri-pxa320.c index 6ad3359063af..d88e7b37f1da 100644 --- a/arch/arm/mach-pxa/colibri-pxa320.c +++ b/arch/arm/mach-pxa/colibri-pxa320.c @@ -256,6 +256,7 @@ MACHINE_START(COLIBRI320, "Toradex Colibri PXA320") .atag_offset = 0x100, .init_machine = colibri_pxa320_init, .map_io = pxa3xx_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa3xx_init_irq, .handle_irq = pxa3xx_handle_irq, .timer = &pxa_timer, diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c index 11f1e735966e..039aafa455c7 100644 --- a/arch/arm/mach-pxa/corgi.c +++ b/arch/arm/mach-pxa/corgi.c @@ -730,6 +730,7 @@ static void __init fixup_corgi(struct tag *tags, char **cmdline, MACHINE_START(CORGI, "SHARP Corgi") .fixup = fixup_corgi, .map_io = pxa25x_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa25x_init_irq, .handle_irq = pxa25x_handle_irq, .init_machine = corgi_init, @@ -742,6 +743,7 @@ MACHINE_END MACHINE_START(SHEPHERD, "SHARP Shepherd") .fixup = fixup_corgi, .map_io = pxa25x_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa25x_init_irq, .handle_irq = pxa25x_handle_irq, .init_machine = corgi_init, @@ -754,6 +756,7 @@ MACHINE_END MACHINE_START(HUSKY, "SHARP Husky") .fixup = fixup_corgi, .map_io = pxa25x_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa25x_init_irq, .handle_irq = pxa25x_handle_irq, .init_machine = corgi_init, diff --git a/arch/arm/mach-pxa/csb726.c b/arch/arm/mach-pxa/csb726.c index fb5a51d834e5..67f0de37f46e 100644 --- a/arch/arm/mach-pxa/csb726.c +++ b/arch/arm/mach-pxa/csb726.c @@ -274,6 +274,7 @@ static void __init csb726_init(void) MACHINE_START(CSB726, "Cogent CSB726") .atag_offset = 0x100, .map_io = pxa27x_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa27x_init_irq, .handle_irq = pxa27x_handle_irq, .init_machine = csb726_init, diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c index 18fd177073f4..72a15a62ab02 100644 --- a/arch/arm/mach-pxa/devices.c +++ b/arch/arm/mach-pxa/devices.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c index d80c0ba9a095..c1b65da26335 100644 --- a/arch/arm/mach-pxa/em-x270.c +++ b/arch/arm/mach-pxa/em-x270.c @@ -1301,6 +1301,7 @@ static void __init em_x270_init(void) MACHINE_START(EM_X270, "Compulab EM-X270") .atag_offset = 0x100, .map_io = pxa27x_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa27x_init_irq, .handle_irq = pxa27x_handle_irq, .timer = &pxa_timer, @@ -1311,6 +1312,7 @@ MACHINE_END MACHINE_START(EXEDA, "Compulab eXeda") .atag_offset = 0x100, .map_io = pxa27x_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa27x_init_irq, .handle_irq = pxa27x_handle_irq, .timer = &pxa_timer, diff --git a/arch/arm/mach-pxa/gumstix.c b/arch/arm/mach-pxa/gumstix.c index ac3b1cef4751..e529a35a44ce 100644 --- a/arch/arm/mach-pxa/gumstix.c +++ b/arch/arm/mach-pxa/gumstix.c @@ -235,6 +235,7 @@ static void __init gumstix_init(void) MACHINE_START(GUMSTIX, "Gumstix") .atag_offset = 0x100, /* match u-boot bi_boot_params */ .map_io = pxa25x_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa25x_init_irq, .handle_irq = pxa25x_handle_irq, .timer = &pxa_timer, diff --git a/arch/arm/mach-pxa/h5000.c b/arch/arm/mach-pxa/h5000.c index fde6b4c873c4..e7dec589f014 100644 --- a/arch/arm/mach-pxa/h5000.c +++ b/arch/arm/mach-pxa/h5000.c @@ -205,6 +205,7 @@ static void __init h5000_init(void) MACHINE_START(H5400, "HP iPAQ H5000") .atag_offset = 0x100, .map_io = pxa25x_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa25x_init_irq, .handle_irq = pxa25x_handle_irq, .timer = &pxa_timer, diff --git a/arch/arm/mach-pxa/himalaya.c b/arch/arm/mach-pxa/himalaya.c index 26d069a9f900..2962de898da9 100644 --- a/arch/arm/mach-pxa/himalaya.c +++ b/arch/arm/mach-pxa/himalaya.c @@ -160,6 +160,7 @@ static void __init himalaya_init(void) MACHINE_START(HIMALAYA, "HTC Himalaya") .atag_offset = 0x100, .map_io = pxa25x_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa25x_init_irq, .handle_irq = pxa25x_handle_irq, .init_machine = himalaya_init, diff --git a/arch/arm/mach-pxa/icontrol.c b/arch/arm/mach-pxa/icontrol.c index 67400192ed3b..1d02eabc9c65 100644 --- a/arch/arm/mach-pxa/icontrol.c +++ b/arch/arm/mach-pxa/icontrol.c @@ -193,6 +193,7 @@ static void __init icontrol_init(void) MACHINE_START(ICONTROL, "iControl/SafeTcam boards using Embedian MXM-8x10 CoM") .atag_offset = 0x100, .map_io = pxa3xx_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa3xx_init_irq, .handle_irq = pxa3xx_handle_irq, .timer = &pxa_timer, diff --git a/arch/arm/mach-pxa/idp.c b/arch/arm/mach-pxa/idp.c index 8af1840e12cc..6ff466bd43e8 100644 --- a/arch/arm/mach-pxa/idp.c +++ b/arch/arm/mach-pxa/idp.c @@ -195,6 +195,7 @@ static void __init idp_map_io(void) MACHINE_START(PXA_IDP, "Vibren PXA255 IDP") /* Maintainer: Vibren Technologies */ .map_io = idp_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa25x_init_irq, .handle_irq = pxa25x_handle_irq, .timer = &pxa_timer, diff --git a/arch/arm/mach-pxa/include/mach/irqs.h b/arch/arm/mach-pxa/include/mach/irqs.h index 32975adf3ca4..8765782dd955 100644 --- a/arch/arm/mach-pxa/include/mach/irqs.h +++ b/arch/arm/mach-pxa/include/mach/irqs.h @@ -100,7 +100,7 @@ */ #define IRQ_BOARD_START (PXA_GPIO_IRQ_BASE + PXA_NR_BUILTIN_GPIO) -#define NR_IRQS (IRQ_BOARD_START) +#define PXA_NR_IRQS (IRQ_BOARD_START) #ifndef __ASSEMBLY__ struct irq_data; diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c index e80a3db735c2..061d57009cee 100644 --- a/arch/arm/mach-pxa/mioa701.c +++ b/arch/arm/mach-pxa/mioa701.c @@ -758,6 +758,7 @@ MACHINE_START(MIOA701, "MIO A701") .atag_offset = 0x100, .restart_mode = 's', .map_io = &pxa27x_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = &pxa27x_init_irq, .handle_irq = &pxa27x_handle_irq, .init_machine = mioa701_machine_init, diff --git a/arch/arm/mach-pxa/mp900.c b/arch/arm/mach-pxa/mp900.c index 169bf8f97af0..152efbf093f6 100644 --- a/arch/arm/mach-pxa/mp900.c +++ b/arch/arm/mach-pxa/mp900.c @@ -95,6 +95,7 @@ MACHINE_START(NEC_MP900, "MobilePro900/C") .atag_offset = 0x220100, .timer = &pxa_timer, .map_io = pxa25x_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa25x_init_irq, .handle_irq = pxa25x_handle_irq, .init_machine = mp900c_init, diff --git a/arch/arm/mach-pxa/palmld.c b/arch/arm/mach-pxa/palmld.c index 1fa80f4f80c8..31e0433d83ba 100644 --- a/arch/arm/mach-pxa/palmld.c +++ b/arch/arm/mach-pxa/palmld.c @@ -344,6 +344,7 @@ static void __init palmld_init(void) MACHINE_START(PALMLD, "Palm LifeDrive") .atag_offset = 0x100, .map_io = palmld_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa27x_init_irq, .handle_irq = pxa27x_handle_irq, .timer = &pxa_timer, diff --git a/arch/arm/mach-pxa/palmt5.c b/arch/arm/mach-pxa/palmt5.c index 5ba14316bd9c..0f6bd4fcfa3b 100644 --- a/arch/arm/mach-pxa/palmt5.c +++ b/arch/arm/mach-pxa/palmt5.c @@ -205,6 +205,7 @@ MACHINE_START(PALMT5, "Palm Tungsten|T5") .atag_offset = 0x100, .map_io = pxa27x_map_io, .reserve = palmt5_reserve, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa27x_init_irq, .handle_irq = pxa27x_handle_irq, .timer = &pxa_timer, diff --git a/arch/arm/mach-pxa/palmtc.c b/arch/arm/mach-pxa/palmtc.c index 29b51b40f09d..e2d97eed07a7 100644 --- a/arch/arm/mach-pxa/palmtc.c +++ b/arch/arm/mach-pxa/palmtc.c @@ -539,6 +539,7 @@ static void __init palmtc_init(void) MACHINE_START(PALMTC, "Palm Tungsten|C") .atag_offset = 0x100, .map_io = pxa25x_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa25x_init_irq, .handle_irq = pxa25x_handle_irq, .timer = &pxa_timer, diff --git a/arch/arm/mach-pxa/palmte2.c b/arch/arm/mach-pxa/palmte2.c index 5ebf49acb827..c054827c567f 100644 --- a/arch/arm/mach-pxa/palmte2.c +++ b/arch/arm/mach-pxa/palmte2.c @@ -358,6 +358,7 @@ static void __init palmte2_init(void) MACHINE_START(PALMTE2, "Palm Tungsten|E2") .atag_offset = 0x100, .map_io = pxa25x_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa25x_init_irq, .handle_irq = pxa25x_handle_irq, .timer = &pxa_timer, diff --git a/arch/arm/mach-pxa/palmtreo.c b/arch/arm/mach-pxa/palmtreo.c index ec8249156c08..fbdebee39a53 100644 --- a/arch/arm/mach-pxa/palmtreo.c +++ b/arch/arm/mach-pxa/palmtreo.c @@ -448,6 +448,7 @@ MACHINE_START(TREO680, "Palm Treo 680") .atag_offset = 0x100, .map_io = pxa27x_map_io, .reserve = treo_reserve, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa27x_init_irq, .handle_irq = pxa27x_handle_irq, .timer = &pxa_timer, @@ -461,6 +462,7 @@ MACHINE_START(CENTRO, "Palm Centro 685") .atag_offset = 0x100, .map_io = pxa27x_map_io, .reserve = treo_reserve, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa27x_init_irq, .handle_irq = pxa27x_handle_irq, .timer = &pxa_timer, diff --git a/arch/arm/mach-pxa/palmtx.c b/arch/arm/mach-pxa/palmtx.c index 6170d76dfba8..9507605ed547 100644 --- a/arch/arm/mach-pxa/palmtx.c +++ b/arch/arm/mach-pxa/palmtx.c @@ -366,6 +366,7 @@ static void __init palmtx_init(void) MACHINE_START(PALMTX, "Palm T|X") .atag_offset = 0x100, .map_io = palmtx_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa27x_init_irq, .handle_irq = pxa27x_handle_irq, .timer = &pxa_timer, diff --git a/arch/arm/mach-pxa/palmz72.c b/arch/arm/mach-pxa/palmz72.c index b2dff9d415eb..a97b59965bb9 100644 --- a/arch/arm/mach-pxa/palmz72.c +++ b/arch/arm/mach-pxa/palmz72.c @@ -401,6 +401,7 @@ static void __init palmz72_init(void) MACHINE_START(PALMZ72, "Palm Zire72") .atag_offset = 0x100, .map_io = pxa27x_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa27x_init_irq, .handle_irq = pxa27x_handle_irq, .timer = &pxa_timer, diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c index f107c71c7589..d2e562d62cf4 100644 --- a/arch/arm/mach-pxa/pxa3xx.c +++ b/arch/arm/mach-pxa/pxa3xx.c @@ -31,6 +31,7 @@ #include #include #include +#include #include "generic.h" #include "devices.h" diff --git a/arch/arm/mach-pxa/raumfeld.c b/arch/arm/mach-pxa/raumfeld.c index 22818c7694a8..7d691e51cb54 100644 --- a/arch/arm/mach-pxa/raumfeld.c +++ b/arch/arm/mach-pxa/raumfeld.c @@ -1090,6 +1090,7 @@ MACHINE_START(RAUMFELD_RC, "Raumfeld Controller") .atag_offset = 0x100, .init_machine = raumfeld_controller_init, .map_io = pxa3xx_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa3xx_init_irq, .handle_irq = pxa3xx_handle_irq, .timer = &pxa_timer, @@ -1102,6 +1103,7 @@ MACHINE_START(RAUMFELD_CONNECTOR, "Raumfeld Connector") .atag_offset = 0x100, .init_machine = raumfeld_connector_init, .map_io = pxa3xx_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa3xx_init_irq, .handle_irq = pxa3xx_handle_irq, .timer = &pxa_timer, @@ -1114,6 +1116,7 @@ MACHINE_START(RAUMFELD_SPEAKER, "Raumfeld Speaker") .atag_offset = 0x100, .init_machine = raumfeld_speaker_init, .map_io = pxa3xx_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa3xx_init_irq, .handle_irq = pxa3xx_handle_irq, .timer = &pxa_timer, diff --git a/arch/arm/mach-pxa/saar.c b/arch/arm/mach-pxa/saar.c index 0fe354efb931..86c95a5d8533 100644 --- a/arch/arm/mach-pxa/saar.c +++ b/arch/arm/mach-pxa/saar.c @@ -598,6 +598,7 @@ MACHINE_START(SAAR, "PXA930 Handheld Platform (aka SAAR)") /* Maintainer: Eric Miao */ .atag_offset = 0x100, .map_io = pxa3xx_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa3xx_init_irq, .handle_irq = pxa3xx_handle_irq, .timer = &pxa_timer, diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c index abf355d0c92f..df2ab0fb2ace 100644 --- a/arch/arm/mach-pxa/spitz.c +++ b/arch/arm/mach-pxa/spitz.c @@ -984,6 +984,7 @@ MACHINE_START(SPITZ, "SHARP Spitz") .restart_mode = 'g', .fixup = spitz_fixup, .map_io = pxa27x_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa27x_init_irq, .handle_irq = pxa27x_handle_irq, .init_machine = spitz_init, @@ -997,6 +998,7 @@ MACHINE_START(BORZOI, "SHARP Borzoi") .restart_mode = 'g', .fixup = spitz_fixup, .map_io = pxa27x_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa27x_init_irq, .handle_irq = pxa27x_handle_irq, .init_machine = spitz_init, @@ -1010,6 +1012,7 @@ MACHINE_START(AKITA, "SHARP Akita") .restart_mode = 'g', .fixup = spitz_fixup, .map_io = pxa27x_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa27x_init_irq, .handle_irq = pxa27x_handle_irq, .init_machine = spitz_init, diff --git a/arch/arm/mach-pxa/stargate2.c b/arch/arm/mach-pxa/stargate2.c index b0656e158d90..adb601a3762f 100644 --- a/arch/arm/mach-pxa/stargate2.c +++ b/arch/arm/mach-pxa/stargate2.c @@ -1006,6 +1006,7 @@ static void __init stargate2_init(void) #ifdef CONFIG_MACH_INTELMOTE2 MACHINE_START(INTELMOTE2, "IMOTE 2") .map_io = pxa27x_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa27x_init_irq, .handle_irq = pxa27x_handle_irq, .timer = &pxa_timer, diff --git a/arch/arm/mach-pxa/tavorevb.c b/arch/arm/mach-pxa/tavorevb.c index 9fb38e80e076..736bfdc50ee6 100644 --- a/arch/arm/mach-pxa/tavorevb.c +++ b/arch/arm/mach-pxa/tavorevb.c @@ -491,6 +491,7 @@ MACHINE_START(TAVOREVB, "PXA930 Evaluation Board (aka TavorEVB)") /* Maintainer: Eric Miao */ .atag_offset = 0x100, .map_io = pxa3xx_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa3xx_init_irq, .handle_irq = pxa3xx_handle_irq, .timer = &pxa_timer, diff --git a/arch/arm/mach-pxa/time.c b/arch/arm/mach-pxa/time.c index b503049d6d26..3d6c9bd90de6 100644 --- a/arch/arm/mach-pxa/time.c +++ b/arch/arm/mach-pxa/time.c @@ -22,6 +22,7 @@ #include #include #include +#include /* * This is PXA's sched_clock implementation. This has a resolution diff --git a/arch/arm/mach-pxa/trizeps4.c b/arch/arm/mach-pxa/trizeps4.c index 0f30af617d8f..2b6ac00b2cd9 100644 --- a/arch/arm/mach-pxa/trizeps4.c +++ b/arch/arm/mach-pxa/trizeps4.c @@ -558,6 +558,7 @@ MACHINE_START(TRIZEPS4, "Keith und Koep Trizeps IV module") .atag_offset = 0x100, .init_machine = trizeps4_init, .map_io = trizeps4_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa27x_init_irq, .handle_irq = pxa27x_handle_irq, .timer = &pxa_timer, @@ -569,6 +570,7 @@ MACHINE_START(TRIZEPS4WL, "Keith und Koep Trizeps IV-WL module") .atag_offset = 0x100, .init_machine = trizeps4_init, .map_io = trizeps4_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa27x_init_irq, .handle_irq = pxa27x_handle_irq, .timer = &pxa_timer, diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c index 023d6ca789de..3143c3910c7d 100644 --- a/arch/arm/mach-pxa/viper.c +++ b/arch/arm/mach-pxa/viper.c @@ -994,6 +994,7 @@ MACHINE_START(VIPER, "Arcom/Eurotech VIPER SBC") /* Maintainer: Marc Zyngier */ .atag_offset = 0x100, .map_io = viper_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = viper_init_irq, .handle_irq = pxa25x_handle_irq, .timer = &pxa_timer, diff --git a/arch/arm/mach-pxa/vpac270.c b/arch/arm/mach-pxa/vpac270.c index 1f5cfa96f6d6..c57ab636ea9c 100644 --- a/arch/arm/mach-pxa/vpac270.c +++ b/arch/arm/mach-pxa/vpac270.c @@ -718,6 +718,7 @@ static void __init vpac270_init(void) MACHINE_START(VPAC270, "Voipac PXA270") .atag_offset = 0x100, .map_io = pxa27x_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa27x_init_irq, .handle_irq = pxa27x_handle_irq, .timer = &pxa_timer, diff --git a/arch/arm/mach-pxa/xcep.c b/arch/arm/mach-pxa/xcep.c index 4bbe9a36fe74..4275713ccd10 100644 --- a/arch/arm/mach-pxa/xcep.c +++ b/arch/arm/mach-pxa/xcep.c @@ -182,6 +182,7 @@ MACHINE_START(XCEP, "Iskratel XCEP") .atag_offset = 0x100, .init_machine = xcep_init, .map_io = pxa25x_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa25x_init_irq, .handle_irq = pxa25x_handle_irq, .timer = &pxa_timer, diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c index b6476848b561..fa8619970841 100644 --- a/arch/arm/mach-pxa/z2.c +++ b/arch/arm/mach-pxa/z2.c @@ -721,6 +721,7 @@ static void __init z2_init(void) MACHINE_START(ZIPIT2, "Zipit Z2") .atag_offset = 0x100, .map_io = pxa27x_map_io, + .nr_irqs = PXA_NR_IRQS, .init_irq = pxa27x_init_irq, .handle_irq = pxa27x_handle_irq, .timer = &pxa_timer, -- cgit v1.2.3 From a9bb5a4bf9f84256499c802fd397d56d55227e4f Mon Sep 17 00:00:00 2001 From: Russell King Date: Fri, 13 Jan 2012 22:56:32 +0000 Subject: PCMCIA: pxa: convert PXA socket drivers to use new irq/gpio management Convert all the PXA platform socket drivers to use the new irq/gpio management provided by soc_common. This relieves these drivers from having to do anything with these GPIOs other than provide the numbers to soc_common. Acked-by: Dominik Brodowski Signed-off-by: Russell King --- arch/arm/mach-pxa/include/mach/balloon3.h | 1 - drivers/pcmcia/pxa2xx_balloon3.c | 21 +++------- drivers/pcmcia/pxa2xx_cm_x255.c | 38 ++++++----------- drivers/pcmcia/pxa2xx_cm_x270.c | 22 ++-------- drivers/pcmcia/pxa2xx_colibri.c | 20 +-------- drivers/pcmcia/pxa2xx_e740.c | 70 ++++++------------------------- drivers/pcmcia/pxa2xx_mainstone.c | 30 +++++++------ drivers/pcmcia/pxa2xx_palmld.c | 7 +--- drivers/pcmcia/pxa2xx_palmtc.c | 7 +--- drivers/pcmcia/pxa2xx_palmtx.c | 7 +--- drivers/pcmcia/pxa2xx_sharpsl.c | 30 +------------ drivers/pcmcia/pxa2xx_stargate2.c | 33 +++------------ drivers/pcmcia/pxa2xx_trizeps4.c | 60 +++----------------------- drivers/pcmcia/pxa2xx_viper.c | 38 +++-------------- drivers/pcmcia/pxa2xx_vpac270.c | 53 ++++------------------- 15 files changed, 81 insertions(+), 356 deletions(-) (limited to 'arch/arm/mach-pxa') diff --git a/arch/arm/mach-pxa/include/mach/balloon3.h b/arch/arm/mach-pxa/include/mach/balloon3.h index f02fa1e6ba86..954641e6c8b1 100644 --- a/arch/arm/mach-pxa/include/mach/balloon3.h +++ b/arch/arm/mach-pxa/include/mach/balloon3.h @@ -174,7 +174,6 @@ enum balloon3_features { #define BALLOON3_AUX_NIRQ PXA_GPIO_TO_IRQ(BALLOON3_GPIO_AUX_NIRQ) #define BALLOON3_CODEC_IRQ PXA_GPIO_TO_IRQ(BALLOON3_GPIO_CODEC_IRQ) -#define BALLOON3_S0_CD_IRQ PXA_GPIO_TO_IRQ(BALLOON3_GPIO_S0_CD) #define BALLOON3_NR_IRQS (IRQ_BOARD_START + 16) diff --git a/drivers/pcmcia/pxa2xx_balloon3.c b/drivers/pcmcia/pxa2xx_balloon3.c index 22a75e610f12..12e38b497719 100644 --- a/drivers/pcmcia/pxa2xx_balloon3.c +++ b/drivers/pcmcia/pxa2xx_balloon3.c @@ -29,15 +29,6 @@ #include "soc_common.h" -/* - * These are a list of interrupt sources that provokes a polled - * check of status - */ -static struct pcmcia_irqs irqs[] = { - { 0, BALLOON3_S0_CD_IRQ, "PCMCIA0 CD" }, - { 0, BALLOON3_BP_NSTSCHG_IRQ, "PCMCIA0 STSCHG" }, -}; - static int balloon3_pcmcia_hw_init(struct soc_pcmcia_socket *skt) { uint16_t ver; @@ -49,12 +40,12 @@ static int balloon3_pcmcia_hw_init(struct soc_pcmcia_socket *skt) ver); skt->socket.pci_irq = BALLOON3_BP_CF_NRDY_IRQ; - return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs)); -} + skt->stat[SOC_STAT_CD].gpio = BALLOON3_GPIO_S0_CD; + skt->stat[SOC_STAT_CD].name = "PCMCIA0 CD"; + skt->stat[SOC_STAT_BVD1].irq = BALLOON3_BP_NSTSCHG_IRQ; + skt->stat[SOC_STAT_BVD1].name = "PCMCIA0 STSCHG"; -static void balloon3_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) -{ - soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs)); + return 0; } static unsigned long balloon3_pcmcia_status[2] = { @@ -85,7 +76,6 @@ static void balloon3_pcmcia_socket_state(struct soc_pcmcia_socket *skt, disable_irq(BALLOON3_BP_NSTSCHG_IRQ); } - state->detect = !gpio_get_value(BALLOON3_GPIO_S0_CD); state->ready = !!(status & BALLOON3_CF_nIRQ); state->bvd1 = !!(status & BALLOON3_CF_nSTSCHG_BVD1); state->bvd2 = 0; /* not available */ @@ -106,7 +96,6 @@ static int balloon3_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, static struct pcmcia_low_level balloon3_pcmcia_ops = { .owner = THIS_MODULE, .hw_init = balloon3_pcmcia_hw_init, - .hw_shutdown = balloon3_pcmcia_hw_shutdown, .socket_state = balloon3_pcmcia_socket_state, .configure_socket = balloon3_pcmcia_configure_socket, .first = 0, diff --git a/drivers/pcmcia/pxa2xx_cm_x255.c b/drivers/pcmcia/pxa2xx_cm_x255.c index 31ab6ddf52c9..f90e7b1a5958 100644 --- a/drivers/pcmcia/pxa2xx_cm_x255.c +++ b/drivers/pcmcia/pxa2xx_cm_x255.c @@ -25,17 +25,6 @@ #define GPIO_PCMCIA_S1_RDYINT (8) #define GPIO_PCMCIA_RESET (9) -#define PCMCIA_S0_CD_VALID gpio_to_irq(GPIO_PCMCIA_S0_CD_VALID) -#define PCMCIA_S1_CD_VALID gpio_to_irq(GPIO_PCMCIA_S1_CD_VALID) -#define PCMCIA_S0_RDYINT gpio_to_irq(GPIO_PCMCIA_S0_RDYINT) -#define PCMCIA_S1_RDYINT gpio_to_irq(GPIO_PCMCIA_S1_RDYINT) - - -static struct pcmcia_irqs irqs[] = { - { .sock = 0, .str = "PCMCIA0 CD" }, - { .sock = 1, .str = "PCMCIA1 CD" }, -}; - static int cmx255_pcmcia_hw_init(struct soc_pcmcia_socket *skt) { int ret = gpio_request(GPIO_PCMCIA_RESET, "PCCard reset"); @@ -43,19 +32,23 @@ static int cmx255_pcmcia_hw_init(struct soc_pcmcia_socket *skt) return ret; gpio_direction_output(GPIO_PCMCIA_RESET, 0); - skt->socket.pci_irq = skt->nr == 0 ? PCMCIA_S0_RDYINT : PCMCIA_S1_RDYINT; - irqs[0].irq = PCMCIA_S0_CD_VALID; - irqs[1].irq = PCMCIA_S1_CD_VALID; - ret = soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs)); - if (!ret) - gpio_free(GPIO_PCMCIA_RESET); + if (skt->nr == 0) { + skt->stat[SOC_STAT_CD].gpio = GPIO_PCMCIA_S0_CD_VALID; + skt->stat[SOC_STAT_CD].name = "PCMCIA0 CD"; + skt->stat[SOC_STAT_RDY].gpio = GPIO_PCMCIA_S0_RDYINT; + skt->stat[SOC_STAT_RDY].name = "PCMCIA0 RDY"; + } else { + skt->stat[SOC_STAT_CD].gpio = GPIO_PCMCIA_S1_CD_VALID; + skt->stat[SOC_STAT_CD].name = "PCMCIA1 CD"; + skt->stat[SOC_STAT_RDY].gpio = GPIO_PCMCIA_S1_RDYINT; + skt->stat[SOC_STAT_RDY].name = "PCMCIA1 RDY"; + } - return ret; + return 0; } static void cmx255_pcmcia_shutdown(struct soc_pcmcia_socket *skt) { - soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs)); gpio_free(GPIO_PCMCIA_RESET); } @@ -63,13 +56,6 @@ static void cmx255_pcmcia_shutdown(struct soc_pcmcia_socket *skt) static void cmx255_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *state) { - int cd = skt->nr ? GPIO_PCMCIA_S1_CD_VALID : GPIO_PCMCIA_S0_CD_VALID; - int rdy = skt->nr ? GPIO_PCMCIA_S1_RDYINT : GPIO_PCMCIA_S0_RDYINT; - - state->detect = !gpio_get_value(cd); - state->ready = !!gpio_get_value(rdy); - state->bvd1 = 1; - state->bvd2 = 1; state->vs_3v = 0; state->vs_Xv = 0; state->wrprot = 0; /* not available */ diff --git a/drivers/pcmcia/pxa2xx_cm_x270.c b/drivers/pcmcia/pxa2xx_cm_x270.c index 3dc7621a0767..efb5f132851b 100644 --- a/drivers/pcmcia/pxa2xx_cm_x270.c +++ b/drivers/pcmcia/pxa2xx_cm_x270.c @@ -22,14 +22,6 @@ #define GPIO_PCMCIA_S0_RDYINT (82) #define GPIO_PCMCIA_RESET (53) -#define PCMCIA_S0_CD_VALID gpio_to_irq(GPIO_PCMCIA_S0_CD_VALID) -#define PCMCIA_S0_RDYINT gpio_to_irq(GPIO_PCMCIA_S0_RDYINT) - - -static struct pcmcia_irqs irqs[] = { - { .sock = 0, .str = "PCMCIA0 CD" }, -}; - static int cmx270_pcmcia_hw_init(struct soc_pcmcia_socket *skt) { int ret = gpio_request(GPIO_PCMCIA_RESET, "PCCard reset"); @@ -37,18 +29,16 @@ static int cmx270_pcmcia_hw_init(struct soc_pcmcia_socket *skt) return ret; gpio_direction_output(GPIO_PCMCIA_RESET, 0); - skt->socket.pci_irq = PCMCIA_S0_RDYINT; - irqs[0].irq = PCMCIA_S0_CD_VALID; - ret = soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs)); - if (!ret) - gpio_free(GPIO_PCMCIA_RESET); + skt->stat[SOC_STAT_CD].gpio = GPIO_PCMCIA_S0_CD_VALID; + skt->stat[SOC_STAT_CD].name = "PCMCIA0 CD"; + skt->stat[SOC_STAT_RDY].gpio = GPIO_PCMCIA_S0_RDYINT; + skt->stat[SOC_STAT_RDY].name = "PCMCIA0 RDY"; return ret; } static void cmx270_pcmcia_shutdown(struct soc_pcmcia_socket *skt) { - soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs)); gpio_free(GPIO_PCMCIA_RESET); } @@ -56,10 +46,6 @@ static void cmx270_pcmcia_shutdown(struct soc_pcmcia_socket *skt) static void cmx270_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *state) { - state->detect = (gpio_get_value(GPIO_PCMCIA_S0_CD_VALID) == 0) ? 1 : 0; - state->ready = (gpio_get_value(GPIO_PCMCIA_S0_RDYINT) == 0) ? 0 : 1; - state->bvd1 = 1; - state->bvd2 = 1; state->vs_3v = 0; state->vs_Xv = 0; state->wrprot = 0; /* not available */ diff --git a/drivers/pcmcia/pxa2xx_colibri.c b/drivers/pcmcia/pxa2xx_colibri.c index c6dec572a05d..3565169a00f2 100644 --- a/drivers/pcmcia/pxa2xx_colibri.c +++ b/drivers/pcmcia/pxa2xx_colibri.c @@ -53,13 +53,6 @@ static struct gpio colibri_pcmcia_gpios[] = { { 0, GPIOF_INIT_HIGH,"PCMCIA Reset" }, }; -static struct pcmcia_irqs colibri_irqs[] = { - { - .sock = 0, - .str = "PCMCIA CD" - }, -}; - static int colibri_pcmcia_hw_init(struct soc_pcmcia_socket *skt) { int ret; @@ -69,19 +62,10 @@ static int colibri_pcmcia_hw_init(struct soc_pcmcia_socket *skt) if (ret) goto err1; - colibri_irqs[0].irq = gpio_to_irq(colibri_pcmcia_gpios[DETECT].gpio); skt->socket.pci_irq = gpio_to_irq(colibri_pcmcia_gpios[READY].gpio); + skt->stat[SOC_STAT_CD].irq = gpio_to_irq(colibri_pcmcia_gpios[DETECT].gpio); + skt->stat[SOC_STAT_CD].name = "PCMCIA CD"; - ret = soc_pcmcia_request_irqs(skt, colibri_irqs, - ARRAY_SIZE(colibri_irqs)); - if (ret) - goto err2; - - return ret; - -err2: - gpio_free_array(colibri_pcmcia_gpios, - ARRAY_SIZE(colibri_pcmcia_gpios)); err1: return ret; } diff --git a/drivers/pcmcia/pxa2xx_e740.c b/drivers/pcmcia/pxa2xx_e740.c index 17cd2ce7428f..24e00a503d08 100644 --- a/drivers/pcmcia/pxa2xx_e740.c +++ b/drivers/pcmcia/pxa2xx_e740.c @@ -23,52 +23,27 @@ #include "soc_common.h" -static struct pcmcia_irqs cd_irqs[] = { - { - .sock = 0, - .str = "CF card detect" - }, - { - .sock = 1, - .str = "Wifi switch" - }, -}; - static int e740_pcmcia_hw_init(struct soc_pcmcia_socket *skt) { - if (skt->nr == 0) - skt->socket.pci_irq = gpio_to_irq(GPIO_E740_PCMCIA_RDY0); - else - skt->socket.pci_irq = gpio_to_irq(GPIO_E740_PCMCIA_RDY1); - - cd_irqs[0].irq = gpio_to_irq(GPIO_E740_PCMCIA_CD0); - cd_irqs[1].irq = gpio_to_irq(GPIO_E740_PCMCIA_CD1); - - return soc_pcmcia_request_irqs(skt, &cd_irqs[skt->nr], 1); -} + if (skt->nr == 0) { + skt->stat[SOC_STAT_CD].gpio = GPIO_E740_PCMCIA_CD0; + skt->stat[SOC_STAT_CD].name = "CF card detect"; + skt->stat[SOC_STAT_RDY].gpio = GPIO_E740_PCMCIA_RDY0; + skt->stat[SOC_STAT_RDY].name = "CF ready"; + } else { + skt->stat[SOC_STAT_CD].gpio = GPIO_E740_PCMCIA_CD1; + skt->stat[SOC_STAT_CD].name = "Wifi switch"; + skt->stat[SOC_STAT_RDY].gpio = GPIO_E740_PCMCIA_RDY1; + skt->stat[SOC_STAT_RDY].name = "Wifi ready"; + } -/* - * Release all resources. - */ -static void e740_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) -{ - soc_pcmcia_free_irqs(skt, &cd_irqs[skt->nr], 1); + return 0; } static void e740_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *state) { - if (skt->nr == 0) { - state->detect = gpio_get_value(GPIO_E740_PCMCIA_CD0) ? 0 : 1; - state->ready = gpio_get_value(GPIO_E740_PCMCIA_RDY0) ? 1 : 0; - } else { - state->detect = gpio_get_value(GPIO_E740_PCMCIA_CD1) ? 0 : 1; - state->ready = gpio_get_value(GPIO_E740_PCMCIA_RDY1) ? 1 : 0; - } - state->vs_3v = 1; - state->bvd1 = 1; - state->bvd2 = 1; state->wrprot = 0; state->vs_Xv = 0; } @@ -109,32 +84,11 @@ static int e740_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, return 0; } -/* - * Enable card status IRQs on (re-)initialisation. This can - * be called at initialisation, power management event, or - * pcmcia event. - */ -static void e740_pcmcia_socket_init(struct soc_pcmcia_socket *skt) -{ - soc_pcmcia_enable_irqs(skt, cd_irqs, ARRAY_SIZE(cd_irqs)); -} - -/* - * Disable card status IRQs on suspend. - */ -static void e740_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt) -{ - soc_pcmcia_disable_irqs(skt, cd_irqs, ARRAY_SIZE(cd_irqs)); -} - static struct pcmcia_low_level e740_pcmcia_ops = { .owner = THIS_MODULE, .hw_init = e740_pcmcia_hw_init, - .hw_shutdown = e740_pcmcia_hw_shutdown, .socket_state = e740_pcmcia_socket_state, .configure_socket = e740_pcmcia_configure_socket, - .socket_init = e740_pcmcia_socket_init, - .socket_suspend = e740_pcmcia_socket_suspend, .nr = 2, }; diff --git a/drivers/pcmcia/pxa2xx_mainstone.c b/drivers/pcmcia/pxa2xx_mainstone.c index aded706c0b9f..b0ea4d3f8a1c 100644 --- a/drivers/pcmcia/pxa2xx_mainstone.c +++ b/drivers/pcmcia/pxa2xx_mainstone.c @@ -30,27 +30,26 @@ #include "soc_common.h" -static struct pcmcia_irqs irqs[] = { - { 0, MAINSTONE_S0_CD_IRQ, "PCMCIA0 CD" }, - { 1, MAINSTONE_S1_CD_IRQ, "PCMCIA1 CD" }, - { 0, MAINSTONE_S0_STSCHG_IRQ, "PCMCIA0 STSCHG" }, - { 1, MAINSTONE_S1_STSCHG_IRQ, "PCMCIA1 STSCHG" }, -}; - static int mst_pcmcia_hw_init(struct soc_pcmcia_socket *skt) { /* * Setup default state of GPIO outputs * before we enable them as outputs. */ - - skt->socket.pci_irq = (skt->nr == 0) ? MAINSTONE_S0_IRQ : MAINSTONE_S1_IRQ; - return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs)); -} - -static void mst_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) -{ - soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs)); + if (skt->nr == 0) { + skt->socket.pci_irq = MAINSTONE_S0_IRQ; + skt->stat[SOC_STAT_CD].irq = MAINSTONE_S0_CD_IRQ; + skt->stat[SOC_STAT_CD].name = "PCMCIA0 CD"; + skt->stat[SOC_STAT_BVD1].irq = MAINSTONE_S0_STSCHG_IRQ; + skt->stat[SOC_STAT_BVD1].name = "PCMCIA0 STSCHG"; + } else { + skt->socket.pci_irq = MAINSTONE_S1_IRQ; + skt->stat[SOC_STAT_CD].irq = MAINSTONE_S1_CD_IRQ; + skt->stat[SOC_STAT_CD].name = "PCMCIA1 CD"; + skt->stat[SOC_STAT_BVD1].irq = MAINSTONE_S1_STSCHG_IRQ; + skt->stat[SOC_STAT_BVD1].name = "PCMCIA1 STSCHG"; + } + return 0; } static unsigned long mst_pcmcia_status[2]; @@ -131,7 +130,6 @@ static int mst_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, static struct pcmcia_low_level mst_pcmcia_ops __initdata = { .owner = THIS_MODULE, .hw_init = mst_pcmcia_hw_init, - .hw_shutdown = mst_pcmcia_hw_shutdown, .socket_state = mst_pcmcia_socket_state, .configure_socket = mst_pcmcia_configure_socket, .nr = 2, diff --git a/drivers/pcmcia/pxa2xx_palmld.c b/drivers/pcmcia/pxa2xx_palmld.c index 6a8e011a8c13..4bf68144c365 100644 --- a/drivers/pcmcia/pxa2xx_palmld.c +++ b/drivers/pcmcia/pxa2xx_palmld.c @@ -23,7 +23,6 @@ static struct gpio palmld_pcmcia_gpios[] = { { GPIO_NR_PALMLD_PCMCIA_POWER, GPIOF_INIT_LOW, "PCMCIA Power" }, { GPIO_NR_PALMLD_PCMCIA_RESET, GPIOF_INIT_HIGH,"PCMCIA Reset" }, - { GPIO_NR_PALMLD_PCMCIA_READY, GPIOF_IN, "PCMCIA Ready" }, }; static int palmld_pcmcia_hw_init(struct soc_pcmcia_socket *skt) @@ -33,7 +32,8 @@ static int palmld_pcmcia_hw_init(struct soc_pcmcia_socket *skt) ret = gpio_request_array(palmld_pcmcia_gpios, ARRAY_SIZE(palmld_pcmcia_gpios)); - skt->socket.pci_irq = gpio_to_irq(GPIO_NR_PALMLD_PCMCIA_READY); + skt->stat[SOC_STAT_RDY].gpio = GPIO_NR_PALMLD_PCMCIA_READY; + skt->stat[SOC_STAT_RDY].name = "PCMCIA Ready"; return ret; } @@ -47,9 +47,6 @@ static void palmld_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *state) { state->detect = 1; /* always inserted */ - state->ready = !!gpio_get_value(GPIO_NR_PALMLD_PCMCIA_READY); - state->bvd1 = 1; - state->bvd2 = 1; state->wrprot = 0; state->vs_3v = 1; state->vs_Xv = 0; diff --git a/drivers/pcmcia/pxa2xx_palmtc.c b/drivers/pcmcia/pxa2xx_palmtc.c index 9e38de769ba3..b32d05f86789 100644 --- a/drivers/pcmcia/pxa2xx_palmtc.c +++ b/drivers/pcmcia/pxa2xx_palmtc.c @@ -26,7 +26,6 @@ static struct gpio palmtc_pcmcia_gpios[] = { { GPIO_NR_PALMTC_PCMCIA_POWER2, GPIOF_INIT_LOW, "PCMCIA Power 2" }, { GPIO_NR_PALMTC_PCMCIA_POWER3, GPIOF_INIT_LOW, "PCMCIA Power 3" }, { GPIO_NR_PALMTC_PCMCIA_RESET, GPIOF_INIT_HIGH,"PCMCIA Reset" }, - { GPIO_NR_PALMTC_PCMCIA_READY, GPIOF_IN, "PCMCIA Ready" }, { GPIO_NR_PALMTC_PCMCIA_PWRREADY, GPIOF_IN, "PCMCIA Power Ready" }, }; @@ -37,7 +36,8 @@ static int palmtc_pcmcia_hw_init(struct soc_pcmcia_socket *skt) ret = gpio_request_array(palmtc_pcmcia_gpios, ARRAY_SIZE(palmtc_pcmcia_gpios)); - skt->socket.pci_irq = gpio_to_irq(GPIO_NR_PALMTC_PCMCIA_READY); + skt->stat[SOC_STAT_RDY].gpio = GPIO_NR_PALMTC_PCMCIA_READY; + skt->stat[SOC_STAT_RDY].name = "PCMCIA Ready"; return ret; } @@ -51,9 +51,6 @@ static void palmtc_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *state) { state->detect = 1; /* always inserted */ - state->ready = !!gpio_get_value(GPIO_NR_PALMTC_PCMCIA_READY); - state->bvd1 = 1; - state->bvd2 = 1; state->wrprot = 0; state->vs_3v = 1; state->vs_Xv = 0; diff --git a/drivers/pcmcia/pxa2xx_palmtx.c b/drivers/pcmcia/pxa2xx_palmtx.c index 80645a688ee3..ee024ff0980a 100644 --- a/drivers/pcmcia/pxa2xx_palmtx.c +++ b/drivers/pcmcia/pxa2xx_palmtx.c @@ -23,7 +23,6 @@ static struct gpio palmtx_pcmcia_gpios[] = { { GPIO_NR_PALMTX_PCMCIA_POWER1, GPIOF_INIT_LOW, "PCMCIA Power 1" }, { GPIO_NR_PALMTX_PCMCIA_POWER2, GPIOF_INIT_LOW, "PCMCIA Power 2" }, { GPIO_NR_PALMTX_PCMCIA_RESET, GPIOF_INIT_HIGH,"PCMCIA Reset" }, - { GPIO_NR_PALMTX_PCMCIA_READY, GPIOF_IN, "PCMCIA Ready" }, }; static int palmtx_pcmcia_hw_init(struct soc_pcmcia_socket *skt) @@ -33,7 +32,8 @@ static int palmtx_pcmcia_hw_init(struct soc_pcmcia_socket *skt) ret = gpio_request_array(palmtx_pcmcia_gpios, ARRAY_SIZE(palmtx_pcmcia_gpios)); - skt->socket.pci_irq = gpio_to_irq(GPIO_NR_PALMTX_PCMCIA_READY); + skt->stat[SOC_STAT_RDY].gpio = GPIO_NR_PALMTX_PCMCIA_READY; + skt->stat[SOC_STAT_RDY].name = "PCMCIA Ready"; return ret; } @@ -47,9 +47,6 @@ static void palmtx_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *state) { state->detect = 1; /* always inserted */ - state->ready = !!gpio_get_value(GPIO_NR_PALMTX_PCMCIA_READY); - state->bvd1 = 1; - state->bvd2 = 1; state->wrprot = 0; state->vs_3v = 1; state->vs_Xv = 0; diff --git a/drivers/pcmcia/pxa2xx_sharpsl.c b/drivers/pcmcia/pxa2xx_sharpsl.c index 69ae2fd22400..b066273b6b4f 100644 --- a/drivers/pcmcia/pxa2xx_sharpsl.c +++ b/drivers/pcmcia/pxa2xx_sharpsl.c @@ -46,21 +46,9 @@ static void sharpsl_pcmcia_init_reset(struct soc_pcmcia_socket *skt) static int sharpsl_pcmcia_hw_init(struct soc_pcmcia_socket *skt) { - int ret; - - /* Register interrupts */ if (SCOOP_DEV[skt->nr].cd_irq >= 0) { - struct pcmcia_irqs cd_irq; - - cd_irq.sock = skt->nr; - cd_irq.irq = SCOOP_DEV[skt->nr].cd_irq; - cd_irq.str = SCOOP_DEV[skt->nr].cd_irq_str; - ret = soc_pcmcia_request_irqs(skt, &cd_irq, 1); - - if (ret) { - printk(KERN_ERR "Request for Compact Flash IRQ failed\n"); - return ret; - } + skt->stat[SOC_STAT_CD].irq = SCOOP_DEV[skt->nr].cd_irq; + skt->stat[SOC_STAT_CD].name = SCOOP_DEV[skt->nr].cd_irq_str; } skt->socket.pci_irq = SCOOP_DEV[skt->nr].irq; @@ -68,19 +56,6 @@ static int sharpsl_pcmcia_hw_init(struct soc_pcmcia_socket *skt) return 0; } -static void sharpsl_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) -{ - if (SCOOP_DEV[skt->nr].cd_irq >= 0) { - struct pcmcia_irqs cd_irq; - - cd_irq.sock = skt->nr; - cd_irq.irq = SCOOP_DEV[skt->nr].cd_irq; - cd_irq.str = SCOOP_DEV[skt->nr].cd_irq_str; - soc_pcmcia_free_irqs(skt, &cd_irq, 1); - } -} - - static void sharpsl_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *state) { @@ -222,7 +197,6 @@ static void sharpsl_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt) static struct pcmcia_low_level sharpsl_pcmcia_ops __initdata = { .owner = THIS_MODULE, .hw_init = sharpsl_pcmcia_hw_init, - .hw_shutdown = sharpsl_pcmcia_hw_shutdown, .socket_state = sharpsl_pcmcia_socket_state, .configure_socket = sharpsl_pcmcia_configure_socket, .socket_init = sharpsl_pcmcia_socket_init, diff --git a/drivers/pcmcia/pxa2xx_stargate2.c b/drivers/pcmcia/pxa2xx_stargate2.c index 6c2366b74a35..e7c7eb530cb1 100644 --- a/drivers/pcmcia/pxa2xx_stargate2.c +++ b/drivers/pcmcia/pxa2xx_stargate2.c @@ -33,10 +33,6 @@ #define SG2_S0_GPIO_DETECT 53 #define SG2_S0_GPIO_READY 81 -static struct pcmcia_irqs irqs[] = { - {.sock = 0, .str = "PCMCIA0 CD" }, -}; - static struct gpio sg2_pcmcia_gpios[] = { { SG2_S0_GPIO_RESET, GPIOF_OUT_INIT_HIGH, "PCMCIA Reset" }, { SG2_S0_POWER_CTL, GPIOF_OUT_INIT_HIGH, "PCMCIA Power Ctrl" }, @@ -44,22 +40,16 @@ static struct gpio sg2_pcmcia_gpios[] = { static int sg2_pcmcia_hw_init(struct soc_pcmcia_socket *skt) { - skt->socket.pci_irq = gpio_to_irq(SG2_S0_GPIO_READY); - irqs[0].irq = gpio_to_irq(SG2_S0_GPIO_DETECT); - - return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs)); -} - -static void sg2_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) -{ - soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs)); + skt->stat[SOC_STAT_CD].gpio = SG2_S0_GPIO_DETECT; + skt->stat[SOC_STAT_CD].name = "PCMCIA0 CD"; + skt->stat[SOC_STAT_RDY].gpio = SG2_S0_GPIO_READY; + skt->stat[SOC_STAT_RDY].name = "PCMCIA0 RDY"; + return 0; } static void sg2_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *state) { - state->detect = !gpio_get_value(SG2_S0_GPIO_DETECT); - state->ready = !!gpio_get_value(SG2_S0_GPIO_READY); state->bvd1 = 0; /* not available - battery detect on card */ state->bvd2 = 0; /* not available */ state->vs_3v = 1; /* not available - voltage detect for card */ @@ -94,24 +84,11 @@ static int sg2_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, return 0; } -static void sg2_pcmcia_socket_init(struct soc_pcmcia_socket *skt) -{ - soc_pcmcia_enable_irqs(skt, irqs, ARRAY_SIZE(irqs)); -} - -static void sg2_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt) -{ - soc_pcmcia_disable_irqs(skt, irqs, ARRAY_SIZE(irqs)); -} - static struct pcmcia_low_level sg2_pcmcia_ops __initdata = { .owner = THIS_MODULE, .hw_init = sg2_pcmcia_hw_init, - .hw_shutdown = sg2_pcmcia_hw_shutdown, .socket_state = sg2_pcmcia_socket_state, .configure_socket = sg2_pcmcia_configure_socket, - .socket_init = sg2_pcmcia_socket_init, - .socket_suspend = sg2_pcmcia_socket_suspend, .nr = 1, }; diff --git a/drivers/pcmcia/pxa2xx_trizeps4.c b/drivers/pcmcia/pxa2xx_trizeps4.c index 7c33f898135a..31fd93449913 100644 --- a/drivers/pcmcia/pxa2xx_trizeps4.c +++ b/drivers/pcmcia/pxa2xx_trizeps4.c @@ -29,32 +29,17 @@ extern void board_pcmcia_power(int power); -static struct pcmcia_irqs irqs[] = { - { .sock = 0, .str = "cs0_cd" } - /* on other baseboards we can have more inputs */ -}; - static int trizeps_pcmcia_hw_init(struct soc_pcmcia_socket *skt) { - int ret, i; /* we dont have voltage/card/ready detection * so we dont need interrupts for it */ switch (skt->nr) { case 0: - if (gpio_request(GPIO_PRDY, "cf_irq") < 0) { - pr_err("%s: sock %d unable to request gpio %d\n", __func__, - skt->nr, GPIO_PRDY); - return -EBUSY; - } - if (gpio_direction_input(GPIO_PRDY) < 0) { - pr_err("%s: sock %d unable to set input gpio %d\n", __func__, - skt->nr, GPIO_PRDY); - gpio_free(GPIO_PRDY); - return -EINVAL; - } - skt->socket.pci_irq = gpio_to_irq(GPIO_PRDY); - irqs[0].irq = gpio_to_irq(GPIO_PCD); + skt->stat[SOC_STAT_CD].gpio = GPIO_PCD; + skt->stat[SOC_STAT_CD].name = "cs0_cd"; + skt->stat[SOC_STAT_RDY].gpio = GPIO_PRDY; + skt->stat[SOC_STAT_RDY].name = "cs0_rdy"; break; default: break; @@ -62,39 +47,7 @@ static int trizeps_pcmcia_hw_init(struct soc_pcmcia_socket *skt) /* release the reset of this card */ pr_debug("%s: sock %d irq %d\n", __func__, skt->nr, skt->socket.pci_irq); - /* supplementory irqs for the socket */ - for (i = 0; i < ARRAY_SIZE(irqs); i++) { - if (irqs[i].sock != skt->nr) - continue; - if (gpio_request(irq_to_gpio(irqs[i].irq), irqs[i].str) < 0) { - pr_err("%s: sock %d unable to request gpio %d\n", - __func__, skt->nr, irq_to_gpio(irqs[i].irq)); - ret = -EBUSY; - goto error; - } - if (gpio_direction_input(irq_to_gpio(irqs[i].irq)) < 0) { - pr_err("%s: sock %d unable to set input gpio %d\n", - __func__, skt->nr, irq_to_gpio(irqs[i].irq)); - ret = -EINVAL; - goto error; - } - } - return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs)); - -error: - for (; i >= 0; i--) { - gpio_free(irq_to_gpio(irqs[i].irq)); - } - return (ret); -} - -static void trizeps_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) -{ - int i; - /* free allocated gpio's */ - gpio_free(GPIO_PRDY); - for (i = 0; i < ARRAY_SIZE(irqs); i++) - gpio_free(irq_to_gpio(irqs[i].irq)); + return 0; } static unsigned long trizeps_pcmcia_status[2]; @@ -118,8 +71,6 @@ static void trizeps_pcmcia_socket_state(struct soc_pcmcia_socket *skt, switch (skt->nr) { case 0: /* just fill in fix states */ - state->detect = gpio_get_value(GPIO_PCD) ? 0 : 1; - state->ready = gpio_get_value(GPIO_PRDY) ? 1 : 0; state->bvd1 = (status & ConXS_CFSR_BVD1) ? 1 : 0; state->bvd2 = (status & ConXS_CFSR_BVD2) ? 1 : 0; state->vs_3v = (status & ConXS_CFSR_VS1) ? 0 : 1; @@ -204,7 +155,6 @@ static void trizeps_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt) static struct pcmcia_low_level trizeps_pcmcia_ops = { .owner = THIS_MODULE, .hw_init = trizeps_pcmcia_hw_init, - .hw_shutdown = trizeps_pcmcia_hw_shutdown, .socket_state = trizeps_pcmcia_socket_state, .configure_socket = trizeps_pcmcia_configure_socket, .socket_init = trizeps_pcmcia_socket_init, diff --git a/drivers/pcmcia/pxa2xx_viper.c b/drivers/pcmcia/pxa2xx_viper.c index 1064b1c2869d..6100ef8ce53e 100644 --- a/drivers/pcmcia/pxa2xx_viper.c +++ b/drivers/pcmcia/pxa2xx_viper.c @@ -32,13 +32,6 @@ static struct platform_device *arcom_pcmcia_dev; -static struct pcmcia_irqs irqs[] = { - { - .sock = 0, - .str = "PCMCIA_CD", - }, -}; - static inline struct arcom_pcmcia_pdata *viper_get_pdata(void) { return arcom_pcmcia_dev->dev.platform_data; @@ -49,38 +42,28 @@ static int viper_pcmcia_hw_init(struct soc_pcmcia_socket *skt) struct arcom_pcmcia_pdata *pdata = viper_get_pdata(); unsigned long flags; - skt->socket.pci_irq = gpio_to_irq(pdata->rdy_gpio); - irqs[0].irq = gpio_to_irq(pdata->cd_gpio); - - if (gpio_request(pdata->cd_gpio, "CF detect")) - goto err_request_cd; - - if (gpio_request(pdata->rdy_gpio, "CF ready")) - goto err_request_rdy; + skt->stat[SOC_STAT_CD].gpio = pdata->cd_gpio; + skt->stat[SOC_STAT_CD].name = "PCMCIA_CD"; + skt->stat[SOC_STAT_RDY].gpio = pdata->rdy_gpio; + skt->stat[SOC_STAT_RDY].name = "CF ready"; if (gpio_request(pdata->pwr_gpio, "CF power")) goto err_request_pwr; local_irq_save(flags); - if (gpio_direction_output(pdata->pwr_gpio, 0) || - gpio_direction_input(pdata->cd_gpio) || - gpio_direction_input(pdata->rdy_gpio)) { + if (gpio_direction_output(pdata->pwr_gpio, 0)) { local_irq_restore(flags); goto err_dir; } local_irq_restore(flags); - return soc_pcmcia_request_irqs(skt, irqs, ARRAY_SIZE(irqs)); + return 0; err_dir: gpio_free(pdata->pwr_gpio); err_request_pwr: - gpio_free(pdata->rdy_gpio); -err_request_rdy: - gpio_free(pdata->cd_gpio); -err_request_cd: dev_err(&arcom_pcmcia_dev->dev, "Failed to setup PCMCIA GPIOs\n"); return -1; } @@ -92,21 +75,12 @@ static void viper_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) { struct arcom_pcmcia_pdata *pdata = viper_get_pdata(); - soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs)); gpio_free(pdata->pwr_gpio); - gpio_free(pdata->rdy_gpio); - gpio_free(pdata->cd_gpio); } static void viper_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *state) { - struct arcom_pcmcia_pdata *pdata = viper_get_pdata(); - - state->detect = !gpio_get_value(pdata->cd_gpio); - state->ready = !!gpio_get_value(pdata->rdy_gpio); - state->bvd1 = 1; - state->bvd2 = 1; state->wrprot = 0; state->vs_3v = 1; /* Can only apply 3.3V */ state->vs_Xv = 0; diff --git a/drivers/pcmcia/pxa2xx_vpac270.c b/drivers/pcmcia/pxa2xx_vpac270.c index 61b17d235dbe..cf07d8825513 100644 --- a/drivers/pcmcia/pxa2xx_vpac270.c +++ b/drivers/pcmcia/pxa2xx_vpac270.c @@ -23,29 +23,14 @@ #include "soc_common.h" static struct gpio vpac270_pcmcia_gpios[] = { - { GPIO84_VPAC270_PCMCIA_CD, GPIOF_IN, "PCMCIA Card Detect" }, - { GPIO35_VPAC270_PCMCIA_RDY, GPIOF_IN, "PCMCIA Ready" }, { GPIO107_VPAC270_PCMCIA_PPEN, GPIOF_INIT_LOW, "PCMCIA PPEN" }, { GPIO11_VPAC270_PCMCIA_RESET, GPIOF_INIT_LOW, "PCMCIA Reset" }, }; static struct gpio vpac270_cf_gpios[] = { - { GPIO17_VPAC270_CF_CD, GPIOF_IN, "CF Card Detect" }, - { GPIO12_VPAC270_CF_RDY, GPIOF_IN, "CF Ready" }, { GPIO16_VPAC270_CF_RESET, GPIOF_INIT_LOW, "CF Reset" }, }; -static struct pcmcia_irqs cd_irqs[] = { - { - .sock = 0, - .str = "PCMCIA CD" - }, - { - .sock = 1, - .str = "CF CD" - }, -}; - static int vpac270_pcmcia_hw_init(struct soc_pcmcia_socket *skt) { int ret; @@ -54,20 +39,18 @@ static int vpac270_pcmcia_hw_init(struct soc_pcmcia_socket *skt) ret = gpio_request_array(vpac270_pcmcia_gpios, ARRAY_SIZE(vpac270_pcmcia_gpios)); - skt->socket.pci_irq = gpio_to_irq(GPIO35_VPAC270_PCMCIA_RDY); - cd_irqs[0].irq = gpio_to_irq(GPIO84_VPAC270_PCMCIA_CD); - - if (!ret) - ret = soc_pcmcia_request_irqs(skt, &cd_irqs[0], 1); + skt->stat[SOC_STAT_CD].gpio = GPIO84_VPAC270_PCMCIA_CD; + skt->stat[SOC_STAT_CD].name = "PCMCIA CD"; + skt->stat[SOC_STAT_RDY].gpio = GPIO35_VPAC270_PCMCIA_RDY; + skt->stat[SOC_STAT_RDY].name = "PCMCIA Ready"; } else { ret = gpio_request_array(vpac270_cf_gpios, ARRAY_SIZE(vpac270_cf_gpios)); - skt->socket.pci_irq = gpio_to_irq(GPIO12_VPAC270_CF_RDY); - cd_irqs[1].irq = gpio_to_irq(GPIO17_VPAC270_CF_CD); - - if (!ret) - ret = soc_pcmcia_request_irqs(skt, &cd_irqs[1], 1); + skt->stat[SOC_STAT_CD].gpio = GPIO17_VPAC270_CF_CD; + skt->stat[SOC_STAT_CD].name = "CF CD"; + skt->stat[SOC_STAT_RDY].gpio = GPIO12_VPAC270_CF_RDY; + skt->stat[SOC_STAT_RDY].name = "CF Ready"; } return ret; @@ -86,15 +69,6 @@ static void vpac270_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) static void vpac270_pcmcia_socket_state(struct soc_pcmcia_socket *skt, struct pcmcia_state *state) { - if (skt->nr == 0) { - state->detect = !gpio_get_value(GPIO84_VPAC270_PCMCIA_CD); - state->ready = !!gpio_get_value(GPIO35_VPAC270_PCMCIA_RDY); - } else { - state->detect = !gpio_get_value(GPIO17_VPAC270_CF_CD); - state->ready = !!gpio_get_value(GPIO12_VPAC270_CF_RDY); - } - state->bvd1 = 1; - state->bvd2 = 1; state->wrprot = 0; state->vs_3v = 1; state->vs_Xv = 0; @@ -117,14 +91,6 @@ vpac270_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, return 0; } -static void vpac270_pcmcia_socket_init(struct soc_pcmcia_socket *skt) -{ -} - -static void vpac270_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt) -{ -} - static struct pcmcia_low_level vpac270_pcmcia_ops = { .owner = THIS_MODULE, @@ -136,9 +102,6 @@ static struct pcmcia_low_level vpac270_pcmcia_ops = { .socket_state = vpac270_pcmcia_socket_state, .configure_socket = vpac270_pcmcia_configure_socket, - - .socket_init = vpac270_pcmcia_socket_init, - .socket_suspend = vpac270_pcmcia_socket_suspend, }; static struct platform_device *vpac270_pcmcia_device; -- cgit v1.2.3 From 8675381109b0eb1c948a423c2b35e3f4509cb25e Mon Sep 17 00:00:00 2001 From: Heikki Krogerus Date: Mon, 13 Feb 2012 13:24:02 +0200 Subject: usb: otg: Rename otg_transceiver to usb_phy This is the first step in separating USB transceivers from USB OTG utilities. Includes fixes to IMX code from Sascha Hauer. Signed-off-by: Heikki Krogerus Acked-by: Sascha Hauer Acked-by: Pavankumar Kondeti Acked-by: Li Yang Acked-by: Alan Stern Acked-by: Igor Grinberg Reviewed-by: Marek Vasut Signed-off-by: Felipe Balbi --- arch/arm/mach-imx/mx31moboard-devboard.c | 6 +- arch/arm/mach-imx/mx31moboard-marxbot.c | 6 +- arch/arm/mach-pxa/pxa3xx-ulpi.c | 6 +- arch/arm/mach-tegra/include/mach/usb_phy.h | 2 +- arch/arm/plat-mxc/include/mach/mxc_ehci.h | 2 +- arch/arm/plat-mxc/include/mach/ulpi.h | 4 +- arch/arm/plat-mxc/ulpi.c | 6 +- drivers/power/isp1704_charger.c | 2 +- drivers/power/pda_power.c | 2 +- drivers/power/twl4030_charger.c | 2 +- drivers/usb/gadget/ci13xxx_udc.h | 2 +- drivers/usb/gadget/fsl_usb2_udc.h | 2 +- drivers/usb/gadget/langwell_udc.h | 2 +- drivers/usb/gadget/mv_udc.h | 2 +- drivers/usb/gadget/omap_udc.c | 4 +- drivers/usb/gadget/omap_udc.h | 2 +- drivers/usb/gadget/pxa25x_udc.h | 2 +- drivers/usb/gadget/pxa27x_udc.h | 2 +- drivers/usb/gadget/s3c-hsudc.c | 2 +- drivers/usb/host/ehci-msm.c | 2 +- drivers/usb/host/ehci-mv.c | 2 +- drivers/usb/host/ehci-tegra.c | 2 +- drivers/usb/host/ehci.h | 2 +- drivers/usb/host/ohci.h | 2 +- drivers/usb/musb/blackfin.c | 2 +- drivers/usb/musb/musb_core.c | 4 +- drivers/usb/musb/musb_core.h | 2 +- drivers/usb/musb/tusb6010.c | 2 +- drivers/usb/otg/Kconfig | 2 +- drivers/usb/otg/ab8500-usb.c | 12 ++-- drivers/usb/otg/fsl_otg.c | 18 +++--- drivers/usb/otg/fsl_otg.h | 2 +- drivers/usb/otg/gpio_vbus.c | 8 +-- drivers/usb/otg/isp1301_omap.c | 12 ++-- drivers/usb/otg/msm_otg.c | 54 ++++++++-------- drivers/usb/otg/mv_otg.c | 14 ++--- drivers/usb/otg/mv_otg.h | 2 +- drivers/usb/otg/nop-usb-xceiv.c | 10 +-- drivers/usb/otg/otg.c | 8 +-- drivers/usb/otg/otg_fsm.h | 2 +- drivers/usb/otg/twl4030-usb.c | 8 +-- drivers/usb/otg/twl6030-usb.c | 18 +++--- drivers/usb/otg/ulpi.c | 20 +++--- drivers/usb/otg/ulpi_viewport.c | 4 +- include/linux/usb/intel_mid_otg.h | 6 +- include/linux/usb/msm_hsusb.h | 2 +- include/linux/usb/otg.h | 98 +++++++++++++++--------------- include/linux/usb/ulpi.h | 2 +- 48 files changed, 190 insertions(+), 190 deletions(-) (limited to 'arch/arm/mach-pxa') diff --git a/arch/arm/mach-imx/mx31moboard-devboard.c b/arch/arm/mach-imx/mx31moboard-devboard.c index 0aa25364360d..9cd4a97efa52 100644 --- a/arch/arm/mach-imx/mx31moboard-devboard.c +++ b/arch/arm/mach-imx/mx31moboard-devboard.c @@ -158,7 +158,7 @@ static int devboard_usbh1_hw_init(struct platform_device *pdev) #define USBH1_VBUSEN_B IOMUX_TO_GPIO(MX31_PIN_NFRE_B) #define USBH1_MODE IOMUX_TO_GPIO(MX31_PIN_NFALE) -static int devboard_isp1105_init(struct otg_transceiver *otg) +static int devboard_isp1105_init(struct usb_phy *otg) { int ret = gpio_request(USBH1_MODE, "usbh1-mode"); if (ret) @@ -177,7 +177,7 @@ static int devboard_isp1105_init(struct otg_transceiver *otg) } -static int devboard_isp1105_set_vbus(struct otg_transceiver *otg, bool on) +static int devboard_isp1105_set_vbus(struct usb_phy *otg, bool on) { if (on) gpio_set_value(USBH1_VBUSEN_B, 0); @@ -194,7 +194,7 @@ static struct mxc_usbh_platform_data usbh1_pdata __initdata = { static int __init devboard_usbh1_init(void) { - struct otg_transceiver *otg; + struct usb_phy *otg; struct platform_device *pdev; otg = kzalloc(sizeof(*otg), GFP_KERNEL); diff --git a/arch/arm/mach-imx/mx31moboard-marxbot.c b/arch/arm/mach-imx/mx31moboard-marxbot.c index bb639cbda4e5..2be769bbe05e 100644 --- a/arch/arm/mach-imx/mx31moboard-marxbot.c +++ b/arch/arm/mach-imx/mx31moboard-marxbot.c @@ -272,7 +272,7 @@ static int marxbot_usbh1_hw_init(struct platform_device *pdev) #define USBH1_VBUSEN_B IOMUX_TO_GPIO(MX31_PIN_NFRE_B) #define USBH1_MODE IOMUX_TO_GPIO(MX31_PIN_NFALE) -static int marxbot_isp1105_init(struct otg_transceiver *otg) +static int marxbot_isp1105_init(struct usb_phy *otg) { int ret = gpio_request(USBH1_MODE, "usbh1-mode"); if (ret) @@ -291,7 +291,7 @@ static int marxbot_isp1105_init(struct otg_transceiver *otg) } -static int marxbot_isp1105_set_vbus(struct otg_transceiver *otg, bool on) +static int marxbot_isp1105_set_vbus(struct usb_phy *otg, bool on) { if (on) gpio_set_value(USBH1_VBUSEN_B, 0); @@ -308,7 +308,7 @@ static struct mxc_usbh_platform_data usbh1_pdata __initdata = { static int __init marxbot_usbh1_init(void) { - struct otg_transceiver *otg; + struct usb_phy *otg; struct platform_device *pdev; otg = kzalloc(sizeof(*otg), GFP_KERNEL); diff --git a/arch/arm/mach-pxa/pxa3xx-ulpi.c b/arch/arm/mach-pxa/pxa3xx-ulpi.c index e28dfb88827f..960d0ac50418 100644 --- a/arch/arm/mach-pxa/pxa3xx-ulpi.c +++ b/arch/arm/mach-pxa/pxa3xx-ulpi.c @@ -33,7 +33,7 @@ struct pxa3xx_u2d_ulpi { struct clk *clk; void __iomem *mmio_base; - struct otg_transceiver *otg; + struct usb_phy *otg; unsigned int ulpi_mode; }; @@ -79,7 +79,7 @@ static int pxa310_ulpi_poll(void) return -ETIMEDOUT; } -static int pxa310_ulpi_read(struct otg_transceiver *otg, u32 reg) +static int pxa310_ulpi_read(struct usb_phy *otg, u32 reg) { int err; @@ -98,7 +98,7 @@ static int pxa310_ulpi_read(struct otg_transceiver *otg, u32 reg) return u2d_readl(U2DOTGUCR) & U2DOTGUCR_RDATA; } -static int pxa310_ulpi_write(struct otg_transceiver *otg, u32 val, u32 reg) +static int pxa310_ulpi_write(struct usb_phy *otg, u32 val, u32 reg) { if (pxa310_ulpi_get_phymode() != SYNCH) { pr_warning("%s: PHY is not in SYNCH mode!\n", __func__); diff --git a/arch/arm/mach-tegra/include/mach/usb_phy.h b/arch/arm/mach-tegra/include/mach/usb_phy.h index d4b8f9e298a8..de1a0f602b28 100644 --- a/arch/arm/mach-tegra/include/mach/usb_phy.h +++ b/arch/arm/mach-tegra/include/mach/usb_phy.h @@ -58,7 +58,7 @@ struct tegra_usb_phy { struct clk *pad_clk; enum tegra_usb_phy_mode mode; void *config; - struct otg_transceiver *ulpi; + struct usb_phy *ulpi; }; struct tegra_usb_phy *tegra_usb_phy_open(int instance, void __iomem *regs, diff --git a/arch/arm/plat-mxc/include/mach/mxc_ehci.h b/arch/arm/plat-mxc/include/mach/mxc_ehci.h index 2c159dc2398b..9ffd1bbe615f 100644 --- a/arch/arm/plat-mxc/include/mach/mxc_ehci.h +++ b/arch/arm/plat-mxc/include/mach/mxc_ehci.h @@ -44,7 +44,7 @@ struct mxc_usbh_platform_data { int (*exit)(struct platform_device *pdev); unsigned int portsc; - struct otg_transceiver *otg; + struct usb_phy *otg; }; int mx51_initialize_usb_hw(int port, unsigned int flags); diff --git a/arch/arm/plat-mxc/include/mach/ulpi.h b/arch/arm/plat-mxc/include/mach/ulpi.h index f9161c96d7bd..d39d94a170e7 100644 --- a/arch/arm/plat-mxc/include/mach/ulpi.h +++ b/arch/arm/plat-mxc/include/mach/ulpi.h @@ -2,9 +2,9 @@ #define __MACH_ULPI_H #ifdef CONFIG_USB_ULPI -struct otg_transceiver *imx_otg_ulpi_create(unsigned int flags); +struct usb_phy *imx_otg_ulpi_create(unsigned int flags); #else -static inline struct otg_transceiver *imx_otg_ulpi_create(unsigned int flags) +static inline struct usb_phy *imx_otg_ulpi_create(unsigned int flags) { return NULL; } diff --git a/arch/arm/plat-mxc/ulpi.c b/arch/arm/plat-mxc/ulpi.c index 477e45bea1be..8eeeb6b979c4 100644 --- a/arch/arm/plat-mxc/ulpi.c +++ b/arch/arm/plat-mxc/ulpi.c @@ -58,7 +58,7 @@ static int ulpi_poll(void __iomem *view, u32 bit) return -ETIMEDOUT; } -static int ulpi_read(struct otg_transceiver *otg, u32 reg) +static int ulpi_read(struct usb_phy *otg, u32 reg) { int ret; void __iomem *view = otg->io_priv; @@ -84,7 +84,7 @@ static int ulpi_read(struct otg_transceiver *otg, u32 reg) return (__raw_readl(view) >> ULPIVW_RDATA_SHIFT) & ULPIVW_RDATA_MASK; } -static int ulpi_write(struct otg_transceiver *otg, u32 val, u32 reg) +static int ulpi_write(struct usb_phy *otg, u32 val, u32 reg) { int ret; void __iomem *view = otg->io_priv; @@ -112,7 +112,7 @@ struct otg_io_access_ops mxc_ulpi_access_ops = { }; EXPORT_SYMBOL_GPL(mxc_ulpi_access_ops); -struct otg_transceiver *imx_otg_ulpi_create(unsigned int flags) +struct usb_phy *imx_otg_ulpi_create(unsigned int flags) { return otg_ulpi_create(&mxc_ulpi_access_ops, flags); } diff --git a/drivers/power/isp1704_charger.c b/drivers/power/isp1704_charger.c index b806667b59ae..51cdea4fc034 100644 --- a/drivers/power/isp1704_charger.c +++ b/drivers/power/isp1704_charger.c @@ -56,7 +56,7 @@ static u16 isp170x_id[] = { struct isp1704_charger { struct device *dev; struct power_supply psy; - struct otg_transceiver *otg; + struct usb_phy *otg; struct notifier_block nb; struct work_struct work; diff --git a/drivers/power/pda_power.c b/drivers/power/pda_power.c index fd49689738af..dcf07f55eb04 100644 --- a/drivers/power/pda_power.c +++ b/drivers/power/pda_power.c @@ -40,7 +40,7 @@ static struct timer_list polling_timer; static int polling; #ifdef CONFIG_USB_OTG_UTILS -static struct otg_transceiver *transceiver; +static struct usb_phy *transceiver; static struct notifier_block otg_nb; #endif diff --git a/drivers/power/twl4030_charger.c b/drivers/power/twl4030_charger.c index 54b9198fa576..b3ead2305b4c 100644 --- a/drivers/power/twl4030_charger.c +++ b/drivers/power/twl4030_charger.c @@ -69,7 +69,7 @@ struct twl4030_bci { struct device *dev; struct power_supply ac; struct power_supply usb; - struct otg_transceiver *transceiver; + struct usb_phy *transceiver; struct notifier_block otg_nb; struct work_struct work; int irq_chg; diff --git a/drivers/usb/gadget/ci13xxx_udc.h b/drivers/usb/gadget/ci13xxx_udc.h index f4871e1fac59..0d31af56c989 100644 --- a/drivers/usb/gadget/ci13xxx_udc.h +++ b/drivers/usb/gadget/ci13xxx_udc.h @@ -136,7 +136,7 @@ struct ci13xxx { struct usb_gadget_driver *driver; /* 3rd party gadget driver */ struct ci13xxx_udc_driver *udc_driver; /* device controller driver */ int vbus_active; /* is VBUS active */ - struct otg_transceiver *transceiver; /* Transceiver struct */ + struct usb_phy *transceiver; /* Transceiver struct */ }; /****************************************************************************** diff --git a/drivers/usb/gadget/fsl_usb2_udc.h b/drivers/usb/gadget/fsl_usb2_udc.h index f781f5dec417..e651469fd39b 100644 --- a/drivers/usb/gadget/fsl_usb2_udc.h +++ b/drivers/usb/gadget/fsl_usb2_udc.h @@ -471,7 +471,7 @@ struct fsl_udc { struct usb_ctrlrequest local_setup_buff; spinlock_t lock; - struct otg_transceiver *transceiver; + struct usb_phy *transceiver; unsigned softconnect:1; unsigned vbus_active:1; unsigned stopped:1; diff --git a/drivers/usb/gadget/langwell_udc.h b/drivers/usb/gadget/langwell_udc.h index d6e78accaffe..8c8087abb481 100644 --- a/drivers/usb/gadget/langwell_udc.h +++ b/drivers/usb/gadget/langwell_udc.h @@ -162,7 +162,7 @@ struct langwell_udc { spinlock_t lock; /* device lock */ struct langwell_ep *ep; struct usb_gadget_driver *driver; - struct otg_transceiver *transceiver; + struct usb_phy *transceiver; u8 dev_addr; u32 usb_state; u32 resume_state; diff --git a/drivers/usb/gadget/mv_udc.h b/drivers/usb/gadget/mv_udc.h index 34aadfae723d..e2be9519abbe 100644 --- a/drivers/usb/gadget/mv_udc.h +++ b/drivers/usb/gadget/mv_udc.h @@ -217,7 +217,7 @@ struct mv_udc { struct work_struct vbus_work; struct workqueue_struct *qwork; - struct otg_transceiver *transceiver; + struct usb_phy *transceiver; struct mv_usb_platform_data *pdata; diff --git a/drivers/usb/gadget/omap_udc.c b/drivers/usb/gadget/omap_udc.c index 576cd8578b45..d3529787351d 100644 --- a/drivers/usb/gadget/omap_udc.c +++ b/drivers/usb/gadget/omap_udc.c @@ -2650,7 +2650,7 @@ static void omap_udc_release(struct device *dev) } static int __init -omap_udc_setup(struct platform_device *odev, struct otg_transceiver *xceiv) +omap_udc_setup(struct platform_device *odev, struct usb_phy *xceiv) { unsigned tmp, buf; @@ -2790,7 +2790,7 @@ static int __init omap_udc_probe(struct platform_device *pdev) { int status = -ENODEV; int hmc; - struct otg_transceiver *xceiv = NULL; + struct usb_phy *xceiv = NULL; const char *type = NULL; struct omap_usb_config *config = pdev->dev.platform_data; struct clk *dc_clk; diff --git a/drivers/usb/gadget/omap_udc.h b/drivers/usb/gadget/omap_udc.h index 29edc51b6b22..59d3b2213cb1 100644 --- a/drivers/usb/gadget/omap_udc.h +++ b/drivers/usb/gadget/omap_udc.h @@ -164,7 +164,7 @@ struct omap_udc { struct omap_ep ep[32]; u16 devstat; u16 clr_halt; - struct otg_transceiver *transceiver; + struct usb_phy *transceiver; struct list_head iso; unsigned softconnect:1; unsigned vbus_active:1; diff --git a/drivers/usb/gadget/pxa25x_udc.h b/drivers/usb/gadget/pxa25x_udc.h index 8eaf4e43726b..893e917f048e 100644 --- a/drivers/usb/gadget/pxa25x_udc.h +++ b/drivers/usb/gadget/pxa25x_udc.h @@ -119,7 +119,7 @@ struct pxa25x_udc { struct device *dev; struct clk *clk; struct pxa2xx_udc_mach_info *mach; - struct otg_transceiver *transceiver; + struct usb_phy *transceiver; u64 dma_mask; struct pxa25x_ep ep [PXA_UDC_NUM_ENDPOINTS]; diff --git a/drivers/usb/gadget/pxa27x_udc.h b/drivers/usb/gadget/pxa27x_udc.h index 7f4e8f424e80..a1d268c6f2cc 100644 --- a/drivers/usb/gadget/pxa27x_udc.h +++ b/drivers/usb/gadget/pxa27x_udc.h @@ -447,7 +447,7 @@ struct pxa_udc { struct usb_gadget_driver *driver; struct device *dev; struct pxa2xx_udc_mach_info *mach; - struct otg_transceiver *transceiver; + struct usb_phy *transceiver; enum ep0_state ep0state; struct udc_stats stats; diff --git a/drivers/usb/gadget/s3c-hsudc.c b/drivers/usb/gadget/s3c-hsudc.c index df8661d266cb..dea475a61fd3 100644 --- a/drivers/usb/gadget/s3c-hsudc.c +++ b/drivers/usb/gadget/s3c-hsudc.c @@ -145,7 +145,7 @@ struct s3c_hsudc { struct usb_gadget_driver *driver; struct device *dev; struct s3c24xx_hsudc_platdata *pd; - struct otg_transceiver *transceiver; + struct usb_phy *transceiver; struct regulator_bulk_data supplies[ARRAY_SIZE(s3c_hsudc_supply_names)]; spinlock_t lock; void __iomem *regs; diff --git a/drivers/usb/host/ehci-msm.c b/drivers/usb/host/ehci-msm.c index 592d5f76803e..ef7c4319c6e4 100644 --- a/drivers/usb/host/ehci-msm.c +++ b/drivers/usb/host/ehci-msm.c @@ -32,7 +32,7 @@ #define MSM_USB_BASE (hcd->regs) -static struct otg_transceiver *otg; +static struct usb_phy *otg; static int ehci_msm_reset(struct usb_hcd *hcd) { diff --git a/drivers/usb/host/ehci-mv.c b/drivers/usb/host/ehci-mv.c index 52a604fb9321..39ca79e008d9 100644 --- a/drivers/usb/host/ehci-mv.c +++ b/drivers/usb/host/ehci-mv.c @@ -28,7 +28,7 @@ struct ehci_hcd_mv { void __iomem *cap_regs; void __iomem *op_regs; - struct otg_transceiver *otg; + struct usb_phy *otg; struct mv_usb_platform_data *pdata; diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c index dbc7fe8ca9e7..2e157144dcf6 100644 --- a/drivers/usb/host/ehci-tegra.c +++ b/drivers/usb/host/ehci-tegra.c @@ -35,7 +35,7 @@ struct tegra_ehci_hcd { struct tegra_usb_phy *phy; struct clk *clk; struct clk *emc_clk; - struct otg_transceiver *transceiver; + struct usb_phy *transceiver; int host_resumed; int bus_suspended; int port_resuming; diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index 0a5fda73b3f2..8f9acbc96fde 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h @@ -176,7 +176,7 @@ struct ehci_hcd { /* one per controller */ /* * OTG controllers and transceivers need software interaction */ - struct otg_transceiver *transceiver; + struct usb_phy *transceiver; }; /* convert between an HCD pointer and the corresponding EHCI_HCD */ diff --git a/drivers/usb/host/ohci.h b/drivers/usb/host/ohci.h index 8ff6f7ea96fd..1b19aea25a2b 100644 --- a/drivers/usb/host/ohci.h +++ b/drivers/usb/host/ohci.h @@ -376,7 +376,7 @@ struct ohci_hcd { * OTG controllers and transceivers need software interaction; * other external transceivers should be software-transparent */ - struct otg_transceiver *transceiver; + struct usb_phy *transceiver; void (*start_hnp)(struct ohci_hcd *ohci); /* diff --git a/drivers/usb/musb/blackfin.c b/drivers/usb/musb/blackfin.c index 5e7cfba5b079..fc8e9edbcb82 100644 --- a/drivers/usb/musb/blackfin.c +++ b/drivers/usb/musb/blackfin.c @@ -317,7 +317,7 @@ static void bfin_musb_set_vbus(struct musb *musb, int is_on) musb_readb(musb->mregs, MUSB_DEVCTL)); } -static int bfin_musb_set_power(struct otg_transceiver *x, unsigned mA) +static int bfin_musb_set_power(struct usb_phy *x, unsigned mA) { return 0; } diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 3d11cf64ebd1..7b7ecf6c65b7 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -131,7 +131,7 @@ static inline struct musb *dev_to_musb(struct device *dev) /*-------------------------------------------------------------------------*/ #ifndef CONFIG_BLACKFIN -static int musb_ulpi_read(struct otg_transceiver *otg, u32 offset) +static int musb_ulpi_read(struct usb_phy *otg, u32 offset) { void __iomem *addr = otg->io_priv; int i = 0; @@ -165,7 +165,7 @@ static int musb_ulpi_read(struct otg_transceiver *otg, u32 offset) return musb_readb(addr, MUSB_ULPI_REG_DATA); } -static int musb_ulpi_write(struct otg_transceiver *otg, +static int musb_ulpi_write(struct usb_phy *otg, u32 offset, u32 data) { void __iomem *addr = otg->io_priv; diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h index 3d28fb8a2dc9..93de517a32a0 100644 --- a/drivers/usb/musb/musb_core.h +++ b/drivers/usb/musb/musb_core.h @@ -372,7 +372,7 @@ struct musb { u16 int_rx; u16 int_tx; - struct otg_transceiver *xceiv; + struct usb_phy *xceiv; u8 xceiv_event; int nIrq; diff --git a/drivers/usb/musb/tusb6010.c b/drivers/usb/musb/tusb6010.c index 1f405616e6cd..5ce01bdb1951 100644 --- a/drivers/usb/musb/tusb6010.c +++ b/drivers/usb/musb/tusb6010.c @@ -277,7 +277,7 @@ static struct musb *the_musb; * mode), or low power Default-B sessions, something else supplies power. * Caller must take care of locking. */ -static int tusb_draw_power(struct otg_transceiver *x, unsigned mA) +static int tusb_draw_power(struct usb_phy *x, unsigned mA) { struct musb *musb = the_musb; void __iomem *tbase = musb->ctrl_base; diff --git a/drivers/usb/otg/Kconfig b/drivers/usb/otg/Kconfig index 76d629345418..b353b393448a 100644 --- a/drivers/usb/otg/Kconfig +++ b/drivers/usb/otg/Kconfig @@ -23,7 +23,7 @@ config USB_GPIO_VBUS select USB_OTG_UTILS help Provides simple GPIO VBUS sensing for controllers with an - internal transceiver via the otg_transceiver interface, and + internal transceiver via the usb_phy interface, and optionally control of a D+ pullup GPIO as well as a VBUS current limit regulator. diff --git a/drivers/usb/otg/ab8500-usb.c b/drivers/usb/otg/ab8500-usb.c index 74fe6e62e0f7..5f06dda7db61 100644 --- a/drivers/usb/otg/ab8500-usb.c +++ b/drivers/usb/otg/ab8500-usb.c @@ -68,7 +68,7 @@ enum ab8500_usb_link_status { }; struct ab8500_usb { - struct otg_transceiver otg; + struct usb_phy otg; struct device *dev; int irq_num_id_rise; int irq_num_id_fall; @@ -82,7 +82,7 @@ struct ab8500_usb { int rev; }; -static inline struct ab8500_usb *xceiv_to_ab(struct otg_transceiver *x) +static inline struct ab8500_usb *xceiv_to_ab(struct usb_phy *x) { return container_of(x, struct ab8500_usb, otg); } @@ -269,7 +269,7 @@ static void ab8500_usb_phy_disable_work(struct work_struct *work) ab8500_usb_peri_phy_dis(ab); } -static int ab8500_usb_set_power(struct otg_transceiver *otg, unsigned mA) +static int ab8500_usb_set_power(struct usb_phy *otg, unsigned mA) { struct ab8500_usb *ab; @@ -290,13 +290,13 @@ static int ab8500_usb_set_power(struct otg_transceiver *otg, unsigned mA) * ab->vbus_draw. */ -static int ab8500_usb_set_suspend(struct otg_transceiver *x, int suspend) +static int ab8500_usb_set_suspend(struct usb_phy *x, int suspend) { /* TODO */ return 0; } -static int ab8500_usb_set_peripheral(struct otg_transceiver *otg, +static int ab8500_usb_set_peripheral(struct usb_phy *otg, struct usb_gadget *gadget) { struct ab8500_usb *ab; @@ -329,7 +329,7 @@ static int ab8500_usb_set_peripheral(struct otg_transceiver *otg, return 0; } -static int ab8500_usb_set_host(struct otg_transceiver *otg, +static int ab8500_usb_set_host(struct usb_phy *otg, struct usb_bus *host) { struct ab8500_usb *ab; diff --git a/drivers/usb/otg/fsl_otg.c b/drivers/usb/otg/fsl_otg.c index a190850d2d3b..66db2a117444 100644 --- a/drivers/usb/otg/fsl_otg.c +++ b/drivers/usb/otg/fsl_otg.c @@ -452,7 +452,7 @@ void otg_reset_controller(void) /* Call suspend/resume routines in host driver */ int fsl_otg_start_host(struct otg_fsm *fsm, int on) { - struct otg_transceiver *xceiv = fsm->transceiver; + struct usb_phy *xceiv = fsm->transceiver; struct device *dev; struct fsl_otg *otg_dev = container_of(xceiv, struct fsl_otg, otg); u32 retval = 0; @@ -518,7 +518,7 @@ end: */ int fsl_otg_start_gadget(struct otg_fsm *fsm, int on) { - struct otg_transceiver *xceiv = fsm->transceiver; + struct usb_phy *xceiv = fsm->transceiver; struct device *dev; if (!xceiv->gadget || !xceiv->gadget->dev.parent) @@ -542,7 +542,7 @@ int fsl_otg_start_gadget(struct otg_fsm *fsm, int on) * Called by initialization code of host driver. Register host controller * to the OTG. Suspend host for OTG role detection. */ -static int fsl_otg_set_host(struct otg_transceiver *otg_p, struct usb_bus *host) +static int fsl_otg_set_host(struct usb_phy *otg_p, struct usb_bus *host) { struct fsl_otg *otg_dev = container_of(otg_p, struct fsl_otg, otg); @@ -587,7 +587,7 @@ static int fsl_otg_set_host(struct otg_transceiver *otg_p, struct usb_bus *host) } /* Called by initialization code of udc. Register udc to OTG. */ -static int fsl_otg_set_peripheral(struct otg_transceiver *otg_p, +static int fsl_otg_set_peripheral(struct usb_phy *otg_p, struct usb_gadget *gadget) { struct fsl_otg *otg_dev = container_of(otg_p, struct fsl_otg, otg); @@ -625,7 +625,7 @@ static int fsl_otg_set_peripheral(struct otg_transceiver *otg_p, } /* Set OTG port power, only for B-device */ -static int fsl_otg_set_power(struct otg_transceiver *otg_p, unsigned mA) +static int fsl_otg_set_power(struct usb_phy *otg_p, unsigned mA) { if (!fsl_otg_dev) return -ENODEV; @@ -658,7 +658,7 @@ static void fsl_otg_event(struct work_struct *work) } /* B-device start SRP */ -static int fsl_otg_start_srp(struct otg_transceiver *otg_p) +static int fsl_otg_start_srp(struct usb_phy *otg_p) { struct fsl_otg *otg_dev = container_of(otg_p, struct fsl_otg, otg); @@ -673,7 +673,7 @@ static int fsl_otg_start_srp(struct otg_transceiver *otg_p) } /* A_host suspend will call this function to start hnp */ -static int fsl_otg_start_hnp(struct otg_transceiver *otg_p) +static int fsl_otg_start_hnp(struct usb_phy *otg_p) { struct fsl_otg *otg_dev = container_of(otg_p, struct fsl_otg, otg); @@ -698,7 +698,7 @@ static int fsl_otg_start_hnp(struct otg_transceiver *otg_p) irqreturn_t fsl_otg_isr(int irq, void *dev_id) { struct otg_fsm *fsm = &((struct fsl_otg *)dev_id)->fsm; - struct otg_transceiver *otg = &((struct fsl_otg *)dev_id)->otg; + struct usb_phy *otg = &((struct fsl_otg *)dev_id)->otg; u32 otg_int_src, otg_sc; otg_sc = fsl_readl(&usb_dr_regs->otgsc); @@ -815,7 +815,7 @@ err: int usb_otg_start(struct platform_device *pdev) { struct fsl_otg *p_otg; - struct otg_transceiver *otg_trans = otg_get_transceiver(); + struct usb_phy *otg_trans = otg_get_transceiver(); struct otg_fsm *fsm; int status; struct resource *res; diff --git a/drivers/usb/otg/fsl_otg.h b/drivers/usb/otg/fsl_otg.h index 3f8ef731aac9..caec254ad819 100644 --- a/drivers/usb/otg/fsl_otg.h +++ b/drivers/usb/otg/fsl_otg.h @@ -369,7 +369,7 @@ inline struct fsl_otg_timer *otg_timer_initializer } struct fsl_otg { - struct otg_transceiver otg; + struct usb_phy otg; struct otg_fsm fsm; struct usb_dr_mmap *dr_mem_map; struct delayed_work otg_event; diff --git a/drivers/usb/otg/gpio_vbus.c b/drivers/usb/otg/gpio_vbus.c index fb644c107ded..4e1b1384dc89 100644 --- a/drivers/usb/otg/gpio_vbus.c +++ b/drivers/usb/otg/gpio_vbus.c @@ -32,7 +32,7 @@ * Needs to be loaded before the UDC driver that will use it. */ struct gpio_vbus_data { - struct otg_transceiver otg; + struct usb_phy otg; struct device *dev; struct regulator *vbus_draw; int vbus_draw_enabled; @@ -149,7 +149,7 @@ static irqreturn_t gpio_vbus_irq(int irq, void *data) /* OTG transceiver interface */ /* bind/unbind the peripheral controller */ -static int gpio_vbus_set_peripheral(struct otg_transceiver *otg, +static int gpio_vbus_set_peripheral(struct usb_phy *otg, struct usb_gadget *gadget) { struct gpio_vbus_data *gpio_vbus; @@ -189,7 +189,7 @@ static int gpio_vbus_set_peripheral(struct otg_transceiver *otg, } /* effective for B devices, ignored for A-peripheral */ -static int gpio_vbus_set_power(struct otg_transceiver *otg, unsigned mA) +static int gpio_vbus_set_power(struct usb_phy *otg, unsigned mA) { struct gpio_vbus_data *gpio_vbus; @@ -201,7 +201,7 @@ static int gpio_vbus_set_power(struct otg_transceiver *otg, unsigned mA) } /* for non-OTG B devices: set/clear transceiver suspend mode */ -static int gpio_vbus_set_suspend(struct otg_transceiver *otg, int suspend) +static int gpio_vbus_set_suspend(struct usb_phy *otg, int suspend) { struct gpio_vbus_data *gpio_vbus; diff --git a/drivers/usb/otg/isp1301_omap.c b/drivers/usb/otg/isp1301_omap.c index 8c86787c2f09..1bc27948ac22 100644 --- a/drivers/usb/otg/isp1301_omap.c +++ b/drivers/usb/otg/isp1301_omap.c @@ -52,7 +52,7 @@ MODULE_DESCRIPTION("ISP1301 USB OTG Transceiver Driver"); MODULE_LICENSE("GPL"); struct isp1301 { - struct otg_transceiver otg; + struct usb_phy otg; struct i2c_client *client; void (*i2c_release)(struct device *dev); @@ -1274,7 +1274,7 @@ static int isp1301_otg_enable(struct isp1301 *isp) /* add or disable the host device+driver */ static int -isp1301_set_host(struct otg_transceiver *otg, struct usb_bus *host) +isp1301_set_host(struct usb_phy *otg, struct usb_bus *host) { struct isp1301 *isp = container_of(otg, struct isp1301, otg); @@ -1330,7 +1330,7 @@ isp1301_set_host(struct otg_transceiver *otg, struct usb_bus *host) } static int -isp1301_set_peripheral(struct otg_transceiver *otg, struct usb_gadget *gadget) +isp1301_set_peripheral(struct usb_phy *otg, struct usb_gadget *gadget) { struct isp1301 *isp = container_of(otg, struct isp1301, otg); #ifndef CONFIG_USB_OTG @@ -1399,7 +1399,7 @@ isp1301_set_peripheral(struct otg_transceiver *otg, struct usb_gadget *gadget) /*-------------------------------------------------------------------------*/ static int -isp1301_set_power(struct otg_transceiver *dev, unsigned mA) +isp1301_set_power(struct usb_phy *dev, unsigned mA) { if (!the_transceiver) return -ENODEV; @@ -1409,7 +1409,7 @@ isp1301_set_power(struct otg_transceiver *dev, unsigned mA) } static int -isp1301_start_srp(struct otg_transceiver *dev) +isp1301_start_srp(struct usb_phy *dev) { struct isp1301 *isp = container_of(dev, struct isp1301, otg); u32 otg_ctrl; @@ -1436,7 +1436,7 @@ isp1301_start_srp(struct otg_transceiver *dev) } static int -isp1301_start_hnp(struct otg_transceiver *dev) +isp1301_start_hnp(struct usb_phy *dev) { #ifdef CONFIG_USB_OTG struct isp1301 *isp = container_of(dev, struct isp1301, otg); diff --git a/drivers/usb/otg/msm_otg.c b/drivers/usb/otg/msm_otg.c index b276f8fcdeba..cba4737a04f4 100644 --- a/drivers/usb/otg/msm_otg.c +++ b/drivers/usb/otg/msm_otg.c @@ -235,7 +235,7 @@ static int msm_hsusb_ldo_set_mode(int on) return ret < 0 ? ret : 0; } -static int ulpi_read(struct otg_transceiver *otg, u32 reg) +static int ulpi_read(struct usb_phy *otg, u32 reg) { struct msm_otg *motg = container_of(otg, struct msm_otg, otg); int cnt = 0; @@ -260,7 +260,7 @@ static int ulpi_read(struct otg_transceiver *otg, u32 reg) return ULPI_DATA_READ(readl(USB_ULPI_VIEWPORT)); } -static int ulpi_write(struct otg_transceiver *otg, u32 val, u32 reg) +static int ulpi_write(struct usb_phy *otg, u32 val, u32 reg) { struct msm_otg *motg = container_of(otg, struct msm_otg, otg); int cnt = 0; @@ -390,7 +390,7 @@ static int msm_otg_phy_reset(struct msm_otg *motg) } #define LINK_RESET_TIMEOUT_USEC (250 * 1000) -static int msm_otg_reset(struct otg_transceiver *otg) +static int msm_otg_reset(struct usb_phy *otg) { struct msm_otg *motg = container_of(otg, struct msm_otg, otg); struct msm_otg_platform_data *pdata = motg->pdata; @@ -448,7 +448,7 @@ static int msm_otg_reset(struct otg_transceiver *otg) #ifdef CONFIG_PM_SLEEP static int msm_otg_suspend(struct msm_otg *motg) { - struct otg_transceiver *otg = &motg->otg; + struct usb_phy *otg = &motg->otg; struct usb_bus *bus = otg->host; struct msm_otg_platform_data *pdata = motg->pdata; int cnt = 0; @@ -543,7 +543,7 @@ static int msm_otg_suspend(struct msm_otg *motg) static int msm_otg_resume(struct msm_otg *motg) { - struct otg_transceiver *otg = &motg->otg; + struct usb_phy *otg = &motg->otg; struct usb_bus *bus = otg->host; int cnt = 0; unsigned temp; @@ -627,7 +627,7 @@ static void msm_otg_notify_charger(struct msm_otg *motg, unsigned mA) motg->cur_power = mA; } -static int msm_otg_set_power(struct otg_transceiver *otg, unsigned mA) +static int msm_otg_set_power(struct usb_phy *otg, unsigned mA) { struct msm_otg *motg = container_of(otg, struct msm_otg, otg); @@ -644,7 +644,7 @@ static int msm_otg_set_power(struct otg_transceiver *otg, unsigned mA) return 0; } -static void msm_otg_start_host(struct otg_transceiver *otg, int on) +static void msm_otg_start_host(struct usb_phy *otg, int on) { struct msm_otg *motg = container_of(otg, struct msm_otg, otg); struct msm_otg_platform_data *pdata = motg->pdata; @@ -683,7 +683,7 @@ static void msm_otg_start_host(struct otg_transceiver *otg, int on) } } -static int msm_otg_set_host(struct otg_transceiver *otg, struct usb_bus *host) +static int msm_otg_set_host(struct usb_phy *otg, struct usb_bus *host) { struct msm_otg *motg = container_of(otg, struct msm_otg, otg); struct usb_hcd *hcd; @@ -729,7 +729,7 @@ static int msm_otg_set_host(struct otg_transceiver *otg, struct usb_bus *host) return 0; } -static void msm_otg_start_peripheral(struct otg_transceiver *otg, int on) +static void msm_otg_start_peripheral(struct usb_phy *otg, int on) { struct msm_otg *motg = container_of(otg, struct msm_otg, otg); struct msm_otg_platform_data *pdata = motg->pdata; @@ -756,7 +756,7 @@ static void msm_otg_start_peripheral(struct otg_transceiver *otg, int on) } -static int msm_otg_set_peripheral(struct otg_transceiver *otg, +static int msm_otg_set_peripheral(struct usb_phy *otg, struct usb_gadget *gadget) { struct msm_otg *motg = container_of(otg, struct msm_otg, otg); @@ -800,7 +800,7 @@ static int msm_otg_set_peripheral(struct otg_transceiver *otg, static bool msm_chg_check_secondary_det(struct msm_otg *motg) { - struct otg_transceiver *otg = &motg->otg; + struct usb_phy *otg = &motg->otg; u32 chg_det; bool ret = false; @@ -821,7 +821,7 @@ static bool msm_chg_check_secondary_det(struct msm_otg *motg) static void msm_chg_enable_secondary_det(struct msm_otg *motg) { - struct otg_transceiver *otg = &motg->otg; + struct usb_phy *otg = &motg->otg; u32 chg_det; switch (motg->pdata->phy_type) { @@ -861,7 +861,7 @@ static void msm_chg_enable_secondary_det(struct msm_otg *motg) static bool msm_chg_check_primary_det(struct msm_otg *motg) { - struct otg_transceiver *otg = &motg->otg; + struct usb_phy *otg = &motg->otg; u32 chg_det; bool ret = false; @@ -882,7 +882,7 @@ static bool msm_chg_check_primary_det(struct msm_otg *motg) static void msm_chg_enable_primary_det(struct msm_otg *motg) { - struct otg_transceiver *otg = &motg->otg; + struct usb_phy *otg = &motg->otg; u32 chg_det; switch (motg->pdata->phy_type) { @@ -907,7 +907,7 @@ static void msm_chg_enable_primary_det(struct msm_otg *motg) static bool msm_chg_check_dcd(struct msm_otg *motg) { - struct otg_transceiver *otg = &motg->otg; + struct usb_phy *otg = &motg->otg; u32 line_state; bool ret = false; @@ -928,7 +928,7 @@ static bool msm_chg_check_dcd(struct msm_otg *motg) static void msm_chg_disable_dcd(struct msm_otg *motg) { - struct otg_transceiver *otg = &motg->otg; + struct usb_phy *otg = &motg->otg; u32 chg_det; switch (motg->pdata->phy_type) { @@ -947,7 +947,7 @@ static void msm_chg_disable_dcd(struct msm_otg *motg) static void msm_chg_enable_dcd(struct msm_otg *motg) { - struct otg_transceiver *otg = &motg->otg; + struct usb_phy *otg = &motg->otg; u32 chg_det; switch (motg->pdata->phy_type) { @@ -968,7 +968,7 @@ static void msm_chg_enable_dcd(struct msm_otg *motg) static void msm_chg_block_on(struct msm_otg *motg) { - struct otg_transceiver *otg = &motg->otg; + struct usb_phy *otg = &motg->otg; u32 func_ctrl, chg_det; /* put the controller in non-driving mode */ @@ -1003,7 +1003,7 @@ static void msm_chg_block_on(struct msm_otg *motg) static void msm_chg_block_off(struct msm_otg *motg) { - struct otg_transceiver *otg = &motg->otg; + struct usb_phy *otg = &motg->otg; u32 func_ctrl, chg_det; switch (motg->pdata->phy_type) { @@ -1038,7 +1038,7 @@ static void msm_chg_block_off(struct msm_otg *motg) static void msm_chg_detect_work(struct work_struct *w) { struct msm_otg *motg = container_of(w, struct msm_otg, chg_work.work); - struct otg_transceiver *otg = &motg->otg; + struct usb_phy *otg = &motg->otg; bool is_dcd, tmout, vout; unsigned long delay; @@ -1152,7 +1152,7 @@ static void msm_otg_init_sm(struct msm_otg *motg) static void msm_otg_sm_work(struct work_struct *w) { struct msm_otg *motg = container_of(w, struct msm_otg, sm_work); - struct otg_transceiver *otg = &motg->otg; + struct usb_phy *otg = &motg->otg; switch (otg->state) { case OTG_STATE_UNDEFINED: @@ -1243,7 +1243,7 @@ static void msm_otg_sm_work(struct work_struct *w) static irqreturn_t msm_otg_irq(int irq, void *data) { struct msm_otg *motg = data; - struct otg_transceiver *otg = &motg->otg; + struct usb_phy *otg = &motg->otg; u32 otgsc = 0; if (atomic_read(&motg->in_lpm)) { @@ -1281,7 +1281,7 @@ static irqreturn_t msm_otg_irq(int irq, void *data) static int msm_otg_mode_show(struct seq_file *s, void *unused) { struct msm_otg *motg = s->private; - struct otg_transceiver *otg = &motg->otg; + struct usb_phy *otg = &motg->otg; switch (otg->state) { case OTG_STATE_A_HOST: @@ -1309,7 +1309,7 @@ static ssize_t msm_otg_mode_write(struct file *file, const char __user *ubuf, struct seq_file *s = file->private_data; struct msm_otg *motg = s->private; char buf[16]; - struct otg_transceiver *otg = &motg->otg; + struct usb_phy *otg = &motg->otg; int status = count; enum usb_mode_type req_mode; @@ -1414,7 +1414,7 @@ static int __init msm_otg_probe(struct platform_device *pdev) int ret = 0; struct resource *res; struct msm_otg *motg; - struct otg_transceiver *otg; + struct usb_phy *otg; dev_info(&pdev->dev, "msm_otg probe\n"); if (!pdev->dev.platform_data) { @@ -1598,7 +1598,7 @@ free_motg: static int __devexit msm_otg_remove(struct platform_device *pdev) { struct msm_otg *motg = platform_get_drvdata(pdev); - struct otg_transceiver *otg = &motg->otg; + struct usb_phy *otg = &motg->otg; int cnt = 0; if (otg->host || otg->gadget) @@ -1660,7 +1660,7 @@ static int __devexit msm_otg_remove(struct platform_device *pdev) static int msm_otg_runtime_idle(struct device *dev) { struct msm_otg *motg = dev_get_drvdata(dev); - struct otg_transceiver *otg = &motg->otg; + struct usb_phy *otg = &motg->otg; dev_dbg(dev, "OTG runtime idle\n"); diff --git a/drivers/usb/otg/mv_otg.c b/drivers/usb/otg/mv_otg.c index b5fbe1452ab0..6e05d58effe1 100644 --- a/drivers/usb/otg/mv_otg.c +++ b/drivers/usb/otg/mv_otg.c @@ -55,7 +55,7 @@ static char *state_string[] = { "a_vbus_err" }; -static int mv_otg_set_vbus(struct otg_transceiver *otg, bool on) +static int mv_otg_set_vbus(struct usb_phy *otg, bool on) { struct mv_otg *mvotg = container_of(otg, struct mv_otg, otg); if (mvotg->pdata->set_vbus == NULL) @@ -64,7 +64,7 @@ static int mv_otg_set_vbus(struct otg_transceiver *otg, bool on) return mvotg->pdata->set_vbus(on); } -static int mv_otg_set_host(struct otg_transceiver *otg, +static int mv_otg_set_host(struct usb_phy *otg, struct usb_bus *host) { otg->host = host; @@ -72,7 +72,7 @@ static int mv_otg_set_host(struct otg_transceiver *otg, return 0; } -static int mv_otg_set_peripheral(struct otg_transceiver *otg, +static int mv_otg_set_peripheral(struct usb_phy *otg, struct usb_gadget *gadget) { otg->gadget = gadget; @@ -203,7 +203,7 @@ static void mv_otg_init_irq(struct mv_otg *mvotg) static void mv_otg_start_host(struct mv_otg *mvotg, int on) { #ifdef CONFIG_USB - struct otg_transceiver *otg = &mvotg->otg; + struct usb_phy *otg = &mvotg->otg; struct usb_hcd *hcd; if (!otg->host) @@ -222,7 +222,7 @@ static void mv_otg_start_host(struct mv_otg *mvotg, int on) static void mv_otg_start_periphrals(struct mv_otg *mvotg, int on) { - struct otg_transceiver *otg = &mvotg->otg; + struct usb_phy *otg = &mvotg->otg; if (!otg->gadget) return; @@ -343,7 +343,7 @@ static void mv_otg_update_inputs(struct mv_otg *mvotg) static void mv_otg_update_state(struct mv_otg *mvotg) { struct mv_otg_ctrl *otg_ctrl = &mvotg->otg_ctrl; - struct otg_transceiver *otg = &mvotg->otg; + struct usb_phy *otg = &mvotg->otg; int old_state = otg->state; switch (old_state) { @@ -416,7 +416,7 @@ static void mv_otg_update_state(struct mv_otg *mvotg) static void mv_otg_work(struct work_struct *work) { struct mv_otg *mvotg; - struct otg_transceiver *otg; + struct usb_phy *otg; int old_state; mvotg = container_of((struct delayed_work *)work, struct mv_otg, work); diff --git a/drivers/usb/otg/mv_otg.h b/drivers/usb/otg/mv_otg.h index be6ca1437645..a74ee07a2727 100644 --- a/drivers/usb/otg/mv_otg.h +++ b/drivers/usb/otg/mv_otg.h @@ -136,7 +136,7 @@ struct mv_otg_regs { }; struct mv_otg { - struct otg_transceiver otg; + struct usb_phy otg; struct mv_otg_ctrl otg_ctrl; /* base address */ diff --git a/drivers/usb/otg/nop-usb-xceiv.c b/drivers/usb/otg/nop-usb-xceiv.c index c1e360046435..2ab027997060 100644 --- a/drivers/usb/otg/nop-usb-xceiv.c +++ b/drivers/usb/otg/nop-usb-xceiv.c @@ -33,7 +33,7 @@ #include struct nop_usb_xceiv { - struct otg_transceiver otg; + struct usb_phy otg; struct device *dev; }; @@ -58,17 +58,17 @@ void usb_nop_xceiv_unregister(void) } EXPORT_SYMBOL(usb_nop_xceiv_unregister); -static inline struct nop_usb_xceiv *xceiv_to_nop(struct otg_transceiver *x) +static inline struct nop_usb_xceiv *xceiv_to_nop(struct usb_phy *x) { return container_of(x, struct nop_usb_xceiv, otg); } -static int nop_set_suspend(struct otg_transceiver *x, int suspend) +static int nop_set_suspend(struct usb_phy *x, int suspend) { return 0; } -static int nop_set_peripheral(struct otg_transceiver *x, +static int nop_set_peripheral(struct usb_phy *x, struct usb_gadget *gadget) { struct nop_usb_xceiv *nop; @@ -88,7 +88,7 @@ static int nop_set_peripheral(struct otg_transceiver *x, return 0; } -static int nop_set_host(struct otg_transceiver *x, struct usb_bus *host) +static int nop_set_host(struct usb_phy *x, struct usb_bus *host) { struct nop_usb_xceiv *nop; diff --git a/drivers/usb/otg/otg.c b/drivers/usb/otg/otg.c index 307c27bc51eb..56c0f1781d8c 100644 --- a/drivers/usb/otg/otg.c +++ b/drivers/usb/otg/otg.c @@ -15,7 +15,7 @@ #include -static struct otg_transceiver *xceiv; +static struct usb_phy *xceiv; /** * otg_get_transceiver - find the (single) OTG transceiver @@ -26,7 +26,7 @@ static struct otg_transceiver *xceiv; * * For use by USB host and peripheral drivers. */ -struct otg_transceiver *otg_get_transceiver(void) +struct usb_phy *otg_get_transceiver(void) { if (xceiv) get_device(xceiv->dev); @@ -42,7 +42,7 @@ EXPORT_SYMBOL(otg_get_transceiver); * * For use by USB host and peripheral drivers. */ -void otg_put_transceiver(struct otg_transceiver *x) +void otg_put_transceiver(struct usb_phy *x) { if (x) put_device(x->dev); @@ -57,7 +57,7 @@ EXPORT_SYMBOL(otg_put_transceiver); * coordinate the activities of drivers for host and peripheral * controllers, and in some cases for VBUS current regulation. */ -int otg_set_transceiver(struct otg_transceiver *x) +int otg_set_transceiver(struct usb_phy *x) { if (xceiv && x) return -EBUSY; diff --git a/drivers/usb/otg/otg_fsm.h b/drivers/usb/otg/otg_fsm.h index 0cecf1d593a0..5e589ae9a199 100644 --- a/drivers/usb/otg/otg_fsm.h +++ b/drivers/usb/otg/otg_fsm.h @@ -82,7 +82,7 @@ struct otg_fsm { int loc_sof; struct otg_fsm_ops *ops; - struct otg_transceiver *transceiver; + struct usb_phy *transceiver; /* Current usb protocol used: 0:undefine; 1:host; 2:client */ int protocol; diff --git a/drivers/usb/otg/twl4030-usb.c b/drivers/usb/otg/twl4030-usb.c index 14f66c358629..beeecc239d18 100644 --- a/drivers/usb/otg/twl4030-usb.c +++ b/drivers/usb/otg/twl4030-usb.c @@ -144,7 +144,7 @@ #define GPIO_USB_4PIN_ULPI_2430C (3 << 0) struct twl4030_usb { - struct otg_transceiver otg; + struct usb_phy otg; struct device *dev; /* TWL4030 internal USB regulator supplies */ @@ -548,7 +548,7 @@ static void twl4030_usb_phy_init(struct twl4030_usb *twl) sysfs_notify(&twl->dev->kobj, NULL, "vbus"); } -static int twl4030_set_suspend(struct otg_transceiver *x, int suspend) +static int twl4030_set_suspend(struct usb_phy *x, int suspend) { struct twl4030_usb *twl = xceiv_to_twl(x); @@ -560,7 +560,7 @@ static int twl4030_set_suspend(struct otg_transceiver *x, int suspend) return 0; } -static int twl4030_set_peripheral(struct otg_transceiver *x, +static int twl4030_set_peripheral(struct usb_phy *x, struct usb_gadget *gadget) { struct twl4030_usb *twl; @@ -576,7 +576,7 @@ static int twl4030_set_peripheral(struct otg_transceiver *x, return 0; } -static int twl4030_set_host(struct otg_transceiver *x, struct usb_bus *host) +static int twl4030_set_host(struct usb_phy *x, struct usb_bus *host) { struct twl4030_usb *twl; diff --git a/drivers/usb/otg/twl6030-usb.c b/drivers/usb/otg/twl6030-usb.c index ed2b26cfe814..56c4d3d50ebe 100644 --- a/drivers/usb/otg/twl6030-usb.c +++ b/drivers/usb/otg/twl6030-usb.c @@ -87,7 +87,7 @@ #define VBUS_DET BIT(2) struct twl6030_usb { - struct otg_transceiver otg; + struct usb_phy otg; struct device *dev; /* for vbus reporting with irqs disabled */ @@ -137,7 +137,7 @@ static inline u8 twl6030_readb(struct twl6030_usb *twl, u8 module, u8 address) return ret; } -static int twl6030_phy_init(struct otg_transceiver *x) +static int twl6030_phy_init(struct usb_phy *x) { struct twl6030_usb *twl; struct device *dev; @@ -155,7 +155,7 @@ static int twl6030_phy_init(struct otg_transceiver *x) return 0; } -static void twl6030_phy_shutdown(struct otg_transceiver *x) +static void twl6030_phy_shutdown(struct usb_phy *x) { struct twl6030_usb *twl; struct device *dev; @@ -167,7 +167,7 @@ static void twl6030_phy_shutdown(struct otg_transceiver *x) pdata->phy_power(twl->dev, 0, 0); } -static int twl6030_phy_suspend(struct otg_transceiver *x, int suspend) +static int twl6030_phy_suspend(struct usb_phy *x, int suspend) { struct twl6030_usb *twl = xceiv_to_twl(x); struct device *dev = twl->dev; @@ -178,7 +178,7 @@ static int twl6030_phy_suspend(struct otg_transceiver *x, int suspend) return 0; } -static int twl6030_start_srp(struct otg_transceiver *x) +static int twl6030_start_srp(struct usb_phy *x) { struct twl6030_usb *twl = xceiv_to_twl(x); @@ -324,7 +324,7 @@ static irqreturn_t twl6030_usbotg_irq(int irq, void *_twl) return IRQ_HANDLED; } -static int twl6030_set_peripheral(struct otg_transceiver *x, +static int twl6030_set_peripheral(struct usb_phy *x, struct usb_gadget *gadget) { struct twl6030_usb *twl; @@ -340,7 +340,7 @@ static int twl6030_set_peripheral(struct otg_transceiver *x, return 0; } -static int twl6030_enable_irq(struct otg_transceiver *x) +static int twl6030_enable_irq(struct usb_phy *x) { struct twl6030_usb *twl = xceiv_to_twl(x); @@ -376,7 +376,7 @@ static void otg_set_vbus_work(struct work_struct *data) CHARGERUSB_CTRL1); } -static int twl6030_set_vbus(struct otg_transceiver *x, bool enabled) +static int twl6030_set_vbus(struct usb_phy *x, bool enabled) { struct twl6030_usb *twl = xceiv_to_twl(x); @@ -386,7 +386,7 @@ static int twl6030_set_vbus(struct otg_transceiver *x, bool enabled) return 0; } -static int twl6030_set_host(struct otg_transceiver *x, struct usb_bus *host) +static int twl6030_set_host(struct usb_phy *x, struct usb_bus *host) { struct twl6030_usb *twl; diff --git a/drivers/usb/otg/ulpi.c b/drivers/usb/otg/ulpi.c index 0b0466728fdc..51841ed829ab 100644 --- a/drivers/usb/otg/ulpi.c +++ b/drivers/usb/otg/ulpi.c @@ -49,7 +49,7 @@ static struct ulpi_info ulpi_ids[] = { ULPI_INFO(ULPI_ID(0x0424, 0x0006), "SMSC USB331x"), }; -static int ulpi_set_otg_flags(struct otg_transceiver *otg) +static int ulpi_set_otg_flags(struct usb_phy *otg) { unsigned int flags = ULPI_OTG_CTRL_DP_PULLDOWN | ULPI_OTG_CTRL_DM_PULLDOWN; @@ -73,7 +73,7 @@ static int ulpi_set_otg_flags(struct otg_transceiver *otg) return otg_io_write(otg, flags, ULPI_OTG_CTRL); } -static int ulpi_set_fc_flags(struct otg_transceiver *otg) +static int ulpi_set_fc_flags(struct usb_phy *otg) { unsigned int flags = 0; @@ -115,7 +115,7 @@ static int ulpi_set_fc_flags(struct otg_transceiver *otg) return otg_io_write(otg, flags, ULPI_FUNC_CTRL); } -static int ulpi_set_ic_flags(struct otg_transceiver *otg) +static int ulpi_set_ic_flags(struct usb_phy *otg) { unsigned int flags = 0; @@ -134,7 +134,7 @@ static int ulpi_set_ic_flags(struct otg_transceiver *otg) return otg_io_write(otg, flags, ULPI_IFC_CTRL); } -static int ulpi_set_flags(struct otg_transceiver *otg) +static int ulpi_set_flags(struct usb_phy *otg) { int ret; @@ -149,7 +149,7 @@ static int ulpi_set_flags(struct otg_transceiver *otg) return ulpi_set_fc_flags(otg); } -static int ulpi_check_integrity(struct otg_transceiver *otg) +static int ulpi_check_integrity(struct usb_phy *otg) { int ret, i; unsigned int val = 0x55; @@ -175,7 +175,7 @@ static int ulpi_check_integrity(struct otg_transceiver *otg) return 0; } -static int ulpi_init(struct otg_transceiver *otg) +static int ulpi_init(struct usb_phy *otg) { int i, vid, pid, ret; u32 ulpi_id = 0; @@ -206,7 +206,7 @@ static int ulpi_init(struct otg_transceiver *otg) return ulpi_set_flags(otg); } -static int ulpi_set_host(struct otg_transceiver *otg, struct usb_bus *host) +static int ulpi_set_host(struct usb_phy *otg, struct usb_bus *host) { unsigned int flags = otg_io_read(otg, ULPI_IFC_CTRL); @@ -231,7 +231,7 @@ static int ulpi_set_host(struct otg_transceiver *otg, struct usb_bus *host) return otg_io_write(otg, flags, ULPI_IFC_CTRL); } -static int ulpi_set_vbus(struct otg_transceiver *otg, bool on) +static int ulpi_set_vbus(struct usb_phy *otg, bool on) { unsigned int flags = otg_io_read(otg, ULPI_OTG_CTRL); @@ -248,11 +248,11 @@ static int ulpi_set_vbus(struct otg_transceiver *otg, bool on) return otg_io_write(otg, flags, ULPI_OTG_CTRL); } -struct otg_transceiver * +struct usb_phy * otg_ulpi_create(struct otg_io_access_ops *ops, unsigned int flags) { - struct otg_transceiver *otg; + struct usb_phy *otg; otg = kzalloc(sizeof(*otg), GFP_KERNEL); if (!otg) diff --git a/drivers/usb/otg/ulpi_viewport.c b/drivers/usb/otg/ulpi_viewport.c index e9a37f90994f..e7b311b960bd 100644 --- a/drivers/usb/otg/ulpi_viewport.c +++ b/drivers/usb/otg/ulpi_viewport.c @@ -40,7 +40,7 @@ static int ulpi_viewport_wait(void __iomem *view, u32 mask) return -ETIMEDOUT; } -static int ulpi_viewport_read(struct otg_transceiver *otg, u32 reg) +static int ulpi_viewport_read(struct usb_phy *otg, u32 reg) { int ret; void __iomem *view = otg->io_priv; @@ -58,7 +58,7 @@ static int ulpi_viewport_read(struct otg_transceiver *otg, u32 reg) return ULPI_VIEW_DATA_READ(readl(view)); } -static int ulpi_viewport_write(struct otg_transceiver *otg, u32 val, u32 reg) +static int ulpi_viewport_write(struct usb_phy *otg, u32 val, u32 reg) { int ret; void __iomem *view = otg->io_priv; diff --git a/include/linux/usb/intel_mid_otg.h b/include/linux/usb/intel_mid_otg.h index a0ccf795f362..756cf5543ffd 100644 --- a/include/linux/usb/intel_mid_otg.h +++ b/include/linux/usb/intel_mid_otg.h @@ -104,11 +104,11 @@ struct iotg_ulpi_access_ops { /* * the Intel MID (Langwell/Penwell) otg transceiver driver needs to interact * with device and host drivers to implement the USB OTG related feature. More - * function members are added based on otg_transceiver data structure for this + * function members are added based on usb_phy data structure for this * purpose. */ struct intel_mid_otg_xceiv { - struct otg_transceiver otg; + struct usb_phy otg; struct otg_hsm hsm; /* base address */ @@ -147,7 +147,7 @@ struct intel_mid_otg_xceiv { }; static inline -struct intel_mid_otg_xceiv *otg_to_mid_xceiv(struct otg_transceiver *otg) +struct intel_mid_otg_xceiv *otg_to_mid_xceiv(struct usb_phy *otg) { return container_of(otg, struct intel_mid_otg_xceiv, otg); } diff --git a/include/linux/usb/msm_hsusb.h b/include/linux/usb/msm_hsusb.h index 00311fe9d0df..2d3547ae9562 100644 --- a/include/linux/usb/msm_hsusb.h +++ b/include/linux/usb/msm_hsusb.h @@ -160,7 +160,7 @@ struct msm_otg_platform_data { * detection process. */ struct msm_otg { - struct otg_transceiver otg; + struct usb_phy otg; struct msm_otg_platform_data *pdata; int irq; struct clk *clk; diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h index d87f44f5b04e..e0bc55702a89 100644 --- a/include/linux/usb/otg.h +++ b/include/linux/usb/otg.h @@ -43,14 +43,14 @@ enum usb_xceiv_events { USB_EVENT_ENUMERATED, /* gadget driver enumerated */ }; -struct otg_transceiver; +struct usb_phy; /* for transceivers connected thru an ULPI interface, the user must * provide access ops */ struct otg_io_access_ops { - int (*read)(struct otg_transceiver *otg, u32 reg); - int (*write)(struct otg_transceiver *otg, u32 val, u32 reg); + int (*read)(struct usb_phy *x, u32 reg); + int (*write)(struct usb_phy *x, u32 val, u32 reg); }; /* @@ -59,7 +59,7 @@ struct otg_io_access_ops { * moment, using the transceiver, ID signal, HNP and sometimes static * configuration information (including "board isn't wired for otg"). */ -struct otg_transceiver { +struct usb_phy { struct device *dev; const char *label; unsigned int flags; @@ -82,40 +82,40 @@ struct otg_transceiver { u16 port_change; /* initialize/shutdown the OTG controller */ - int (*init)(struct otg_transceiver *otg); - void (*shutdown)(struct otg_transceiver *otg); + int (*init)(struct usb_phy *x); + void (*shutdown)(struct usb_phy *x); /* bind/unbind the host controller */ - int (*set_host)(struct otg_transceiver *otg, + int (*set_host)(struct usb_phy *x, struct usb_bus *host); /* bind/unbind the peripheral controller */ - int (*set_peripheral)(struct otg_transceiver *otg, + int (*set_peripheral)(struct usb_phy *x, struct usb_gadget *gadget); /* effective for B devices, ignored for A-peripheral */ - int (*set_power)(struct otg_transceiver *otg, + int (*set_power)(struct usb_phy *x, unsigned mA); /* effective for A-peripheral, ignored for B devices */ - int (*set_vbus)(struct otg_transceiver *otg, + int (*set_vbus)(struct usb_phy *x, bool enabled); /* for non-OTG B devices: set transceiver into suspend mode */ - int (*set_suspend)(struct otg_transceiver *otg, + int (*set_suspend)(struct usb_phy *x, int suspend); /* for B devices only: start session with A-Host */ - int (*start_srp)(struct otg_transceiver *otg); + int (*start_srp)(struct usb_phy *x); /* start or continue HNP role switch */ - int (*start_hnp)(struct otg_transceiver *otg); + int (*start_hnp)(struct usb_phy *x); }; /* for board-specific init logic */ -extern int otg_set_transceiver(struct otg_transceiver *); +extern int otg_set_transceiver(struct usb_phy *); #if defined(CONFIG_NOP_USB_XCEIV) || (defined(CONFIG_NOP_USB_XCEIV_MODULE) && defined(MODULE)) /* sometimes transceivers are accessed only through e.g. ULPI */ @@ -132,50 +132,50 @@ static inline void usb_nop_xceiv_unregister(void) #endif /* helpers for direct access thru low-level io interface */ -static inline int otg_io_read(struct otg_transceiver *otg, u32 reg) +static inline int otg_io_read(struct usb_phy *x, u32 reg) { - if (otg->io_ops && otg->io_ops->read) - return otg->io_ops->read(otg, reg); + if (x->io_ops && x->io_ops->read) + return x->io_ops->read(x, reg); return -EINVAL; } -static inline int otg_io_write(struct otg_transceiver *otg, u32 val, u32 reg) +static inline int otg_io_write(struct usb_phy *x, u32 val, u32 reg) { - if (otg->io_ops && otg->io_ops->write) - return otg->io_ops->write(otg, val, reg); + if (x->io_ops && x->io_ops->write) + return x->io_ops->write(x, val, reg); return -EINVAL; } static inline int -otg_init(struct otg_transceiver *otg) +otg_init(struct usb_phy *x) { - if (otg->init) - return otg->init(otg); + if (x->init) + return x->init(x); return 0; } static inline void -otg_shutdown(struct otg_transceiver *otg) +otg_shutdown(struct usb_phy *x) { - if (otg->shutdown) - otg->shutdown(otg); + if (x->shutdown) + x->shutdown(x); } /* for usb host and peripheral controller drivers */ #ifdef CONFIG_USB_OTG_UTILS -extern struct otg_transceiver *otg_get_transceiver(void); -extern void otg_put_transceiver(struct otg_transceiver *); +extern struct usb_phy *otg_get_transceiver(void); +extern void otg_put_transceiver(struct usb_phy *); extern const char *otg_state_string(enum usb_otg_state state); #else -static inline struct otg_transceiver *otg_get_transceiver(void) +static inline struct usb_phy *otg_get_transceiver(void) { return NULL; } -static inline void otg_put_transceiver(struct otg_transceiver *x) +static inline void otg_put_transceiver(struct usb_phy *x) { } @@ -187,67 +187,67 @@ static inline const char *otg_state_string(enum usb_otg_state state) /* Context: can sleep */ static inline int -otg_start_hnp(struct otg_transceiver *otg) +otg_start_hnp(struct usb_phy *x) { - return otg->start_hnp(otg); + return x->start_hnp(x); } /* Context: can sleep */ static inline int -otg_set_vbus(struct otg_transceiver *otg, bool enabled) +otg_set_vbus(struct usb_phy *x, bool enabled) { - return otg->set_vbus(otg, enabled); + return x->set_vbus(x, enabled); } /* for HCDs */ static inline int -otg_set_host(struct otg_transceiver *otg, struct usb_bus *host) +otg_set_host(struct usb_phy *x, struct usb_bus *host) { - return otg->set_host(otg, host); + return x->set_host(x, host); } /* for usb peripheral controller drivers */ /* Context: can sleep */ static inline int -otg_set_peripheral(struct otg_transceiver *otg, struct usb_gadget *periph) +otg_set_peripheral(struct usb_phy *x, struct usb_gadget *periph) { - return otg->set_peripheral(otg, periph); + return x->set_peripheral(x, periph); } static inline int -otg_set_power(struct otg_transceiver *otg, unsigned mA) +otg_set_power(struct usb_phy *x, unsigned mA) { - return otg->set_power(otg, mA); + return x->set_power(x, mA); } /* Context: can sleep */ static inline int -otg_set_suspend(struct otg_transceiver *otg, int suspend) +otg_set_suspend(struct usb_phy *x, int suspend) { - if (otg->set_suspend != NULL) - return otg->set_suspend(otg, suspend); + if (x->set_suspend != NULL) + return x->set_suspend(x, suspend); else return 0; } static inline int -otg_start_srp(struct otg_transceiver *otg) +otg_start_srp(struct usb_phy *x) { - return otg->start_srp(otg); + return x->start_srp(x); } /* notifiers */ static inline int -otg_register_notifier(struct otg_transceiver *otg, struct notifier_block *nb) +otg_register_notifier(struct usb_phy *x, struct notifier_block *nb) { - return atomic_notifier_chain_register(&otg->notifier, nb); + return atomic_notifier_chain_register(&x->notifier, nb); } static inline void -otg_unregister_notifier(struct otg_transceiver *otg, struct notifier_block *nb) +otg_unregister_notifier(struct usb_phy *x, struct notifier_block *nb) { - atomic_notifier_chain_unregister(&otg->notifier, nb); + atomic_notifier_chain_unregister(&x->notifier, nb); } /* for OTG controller drivers (and maybe other stuff) */ diff --git a/include/linux/usb/ulpi.h b/include/linux/usb/ulpi.h index 9595796d62ed..51ebf72bc449 100644 --- a/include/linux/usb/ulpi.h +++ b/include/linux/usb/ulpi.h @@ -181,7 +181,7 @@ /*-------------------------------------------------------------------------*/ -struct otg_transceiver *otg_ulpi_create(struct otg_io_access_ops *ops, +struct usb_phy *otg_ulpi_create(struct otg_io_access_ops *ops, unsigned int flags); #ifdef CONFIG_USB_ULPI_VIEWPORT -- cgit v1.2.3 From 298b083cf9dd2efd9bb7020107ab0077135051e0 Mon Sep 17 00:00:00 2001 From: Heikki Krogerus Date: Mon, 13 Feb 2012 13:24:13 +0200 Subject: usb: otg: ulpi: Start using struct usb_otg Use struct usb_otg members with OTG specific functions instead of usb_phy members. Signed-off-by: Heikki Krogerus Acked-by: Igor Grinberg Acked-by: Sascha Hauer Reviewed-by: Marek Vasut Signed-off-by: Felipe Balbi --- arch/arm/mach-pxa/pxa3xx-ulpi.c | 6 +- arch/arm/plat-mxc/include/mach/ulpi.h | 2 +- arch/arm/plat-mxc/ulpi.c | 2 +- drivers/usb/otg/ulpi.c | 114 +++++++++++++++++++--------------- drivers/usb/otg/ulpi_viewport.c | 2 +- include/linux/usb/ulpi.h | 4 +- 6 files changed, 71 insertions(+), 59 deletions(-) (limited to 'arch/arm/mach-pxa') diff --git a/arch/arm/mach-pxa/pxa3xx-ulpi.c b/arch/arm/mach-pxa/pxa3xx-ulpi.c index 960d0ac50418..a13f33565623 100644 --- a/arch/arm/mach-pxa/pxa3xx-ulpi.c +++ b/arch/arm/mach-pxa/pxa3xx-ulpi.c @@ -111,7 +111,7 @@ static int pxa310_ulpi_write(struct usb_phy *otg, u32 val, u32 reg) return pxa310_ulpi_poll(); } -struct otg_io_access_ops pxa310_ulpi_access_ops = { +struct usb_phy_io_ops pxa310_ulpi_access_ops = { .read = pxa310_ulpi_read, .write = pxa310_ulpi_write, }; @@ -139,7 +139,7 @@ static int pxa310_start_otg_host_transcvr(struct usb_bus *host) pxa310_otg_transceiver_rtsm(); - err = otg_init(u2d->otg); + err = usb_phy_init(u2d->otg); if (err) { pr_err("OTG transceiver init failed"); return err; @@ -191,7 +191,7 @@ static void pxa310_stop_otg_hc(void) otg_set_host(u2d->otg, NULL); otg_set_vbus(u2d->otg, 0); - otg_shutdown(u2d->otg); + usb_phy_shutdown(u2d->otg); } static void pxa310_u2d_setup_otg_hc(void) diff --git a/arch/arm/plat-mxc/include/mach/ulpi.h b/arch/arm/plat-mxc/include/mach/ulpi.h index d39d94a170e7..42bdaca6d7d9 100644 --- a/arch/arm/plat-mxc/include/mach/ulpi.h +++ b/arch/arm/plat-mxc/include/mach/ulpi.h @@ -10,7 +10,7 @@ static inline struct usb_phy *imx_otg_ulpi_create(unsigned int flags) } #endif -extern struct otg_io_access_ops mxc_ulpi_access_ops; +extern struct usb_phy_io_ops mxc_ulpi_access_ops; #endif /* __MACH_ULPI_H */ diff --git a/arch/arm/plat-mxc/ulpi.c b/arch/arm/plat-mxc/ulpi.c index 8eeeb6b979c4..d2963427184f 100644 --- a/arch/arm/plat-mxc/ulpi.c +++ b/arch/arm/plat-mxc/ulpi.c @@ -106,7 +106,7 @@ static int ulpi_write(struct usb_phy *otg, u32 val, u32 reg) return ulpi_poll(view, ULPIVW_RUN); } -struct otg_io_access_ops mxc_ulpi_access_ops = { +struct usb_phy_io_ops mxc_ulpi_access_ops = { .read = ulpi_read, .write = ulpi_write, }; diff --git a/drivers/usb/otg/ulpi.c b/drivers/usb/otg/ulpi.c index 51841ed829ab..217339dd7a90 100644 --- a/drivers/usb/otg/ulpi.c +++ b/drivers/usb/otg/ulpi.c @@ -49,31 +49,31 @@ static struct ulpi_info ulpi_ids[] = { ULPI_INFO(ULPI_ID(0x0424, 0x0006), "SMSC USB331x"), }; -static int ulpi_set_otg_flags(struct usb_phy *otg) +static int ulpi_set_otg_flags(struct usb_phy *phy) { unsigned int flags = ULPI_OTG_CTRL_DP_PULLDOWN | ULPI_OTG_CTRL_DM_PULLDOWN; - if (otg->flags & ULPI_OTG_ID_PULLUP) + if (phy->flags & ULPI_OTG_ID_PULLUP) flags |= ULPI_OTG_CTRL_ID_PULLUP; /* * ULPI Specification rev.1.1 default * for Dp/DmPulldown is enabled. */ - if (otg->flags & ULPI_OTG_DP_PULLDOWN_DIS) + if (phy->flags & ULPI_OTG_DP_PULLDOWN_DIS) flags &= ~ULPI_OTG_CTRL_DP_PULLDOWN; - if (otg->flags & ULPI_OTG_DM_PULLDOWN_DIS) + if (phy->flags & ULPI_OTG_DM_PULLDOWN_DIS) flags &= ~ULPI_OTG_CTRL_DM_PULLDOWN; - if (otg->flags & ULPI_OTG_EXTVBUSIND) + if (phy->flags & ULPI_OTG_EXTVBUSIND) flags |= ULPI_OTG_CTRL_EXTVBUSIND; - return otg_io_write(otg, flags, ULPI_OTG_CTRL); + return usb_phy_io_write(phy, flags, ULPI_OTG_CTRL); } -static int ulpi_set_fc_flags(struct usb_phy *otg) +static int ulpi_set_fc_flags(struct usb_phy *phy) { unsigned int flags = 0; @@ -81,27 +81,27 @@ static int ulpi_set_fc_flags(struct usb_phy *otg) * ULPI Specification rev.1.1 default * for XcvrSelect is Full Speed. */ - if (otg->flags & ULPI_FC_HS) + if (phy->flags & ULPI_FC_HS) flags |= ULPI_FUNC_CTRL_HIGH_SPEED; - else if (otg->flags & ULPI_FC_LS) + else if (phy->flags & ULPI_FC_LS) flags |= ULPI_FUNC_CTRL_LOW_SPEED; - else if (otg->flags & ULPI_FC_FS4LS) + else if (phy->flags & ULPI_FC_FS4LS) flags |= ULPI_FUNC_CTRL_FS4LS; else flags |= ULPI_FUNC_CTRL_FULL_SPEED; - if (otg->flags & ULPI_FC_TERMSEL) + if (phy->flags & ULPI_FC_TERMSEL) flags |= ULPI_FUNC_CTRL_TERMSELECT; /* * ULPI Specification rev.1.1 default * for OpMode is Normal Operation. */ - if (otg->flags & ULPI_FC_OP_NODRV) + if (phy->flags & ULPI_FC_OP_NODRV) flags |= ULPI_FUNC_CTRL_OPMODE_NONDRIVING; - else if (otg->flags & ULPI_FC_OP_DIS_NRZI) + else if (phy->flags & ULPI_FC_OP_DIS_NRZI) flags |= ULPI_FUNC_CTRL_OPMODE_DISABLE_NRZI; - else if (otg->flags & ULPI_FC_OP_NSYNC_NEOP) + else if (phy->flags & ULPI_FC_OP_NSYNC_NEOP) flags |= ULPI_FUNC_CTRL_OPMODE_NOSYNC_NOEOP; else flags |= ULPI_FUNC_CTRL_OPMODE_NORMAL; @@ -112,54 +112,54 @@ static int ulpi_set_fc_flags(struct usb_phy *otg) */ flags |= ULPI_FUNC_CTRL_SUSPENDM; - return otg_io_write(otg, flags, ULPI_FUNC_CTRL); + return usb_phy_io_write(phy, flags, ULPI_FUNC_CTRL); } -static int ulpi_set_ic_flags(struct usb_phy *otg) +static int ulpi_set_ic_flags(struct usb_phy *phy) { unsigned int flags = 0; - if (otg->flags & ULPI_IC_AUTORESUME) + if (phy->flags & ULPI_IC_AUTORESUME) flags |= ULPI_IFC_CTRL_AUTORESUME; - if (otg->flags & ULPI_IC_EXTVBUS_INDINV) + if (phy->flags & ULPI_IC_EXTVBUS_INDINV) flags |= ULPI_IFC_CTRL_EXTERNAL_VBUS; - if (otg->flags & ULPI_IC_IND_PASSTHRU) + if (phy->flags & ULPI_IC_IND_PASSTHRU) flags |= ULPI_IFC_CTRL_PASSTHRU; - if (otg->flags & ULPI_IC_PROTECT_DIS) + if (phy->flags & ULPI_IC_PROTECT_DIS) flags |= ULPI_IFC_CTRL_PROTECT_IFC_DISABLE; - return otg_io_write(otg, flags, ULPI_IFC_CTRL); + return usb_phy_io_write(phy, flags, ULPI_IFC_CTRL); } -static int ulpi_set_flags(struct usb_phy *otg) +static int ulpi_set_flags(struct usb_phy *phy) { int ret; - ret = ulpi_set_otg_flags(otg); + ret = ulpi_set_otg_flags(phy); if (ret) return ret; - ret = ulpi_set_ic_flags(otg); + ret = ulpi_set_ic_flags(phy); if (ret) return ret; - return ulpi_set_fc_flags(otg); + return ulpi_set_fc_flags(phy); } -static int ulpi_check_integrity(struct usb_phy *otg) +static int ulpi_check_integrity(struct usb_phy *phy) { int ret, i; unsigned int val = 0x55; for (i = 0; i < 2; i++) { - ret = otg_io_write(otg, val, ULPI_SCRATCH); + ret = usb_phy_io_write(phy, val, ULPI_SCRATCH); if (ret < 0) return ret; - ret = otg_io_read(otg, ULPI_SCRATCH); + ret = usb_phy_io_read(phy, ULPI_SCRATCH); if (ret < 0) return ret; @@ -175,13 +175,13 @@ static int ulpi_check_integrity(struct usb_phy *otg) return 0; } -static int ulpi_init(struct usb_phy *otg) +static int ulpi_init(struct usb_phy *phy) { int i, vid, pid, ret; u32 ulpi_id = 0; for (i = 0; i < 4; i++) { - ret = otg_io_read(otg, ULPI_PRODUCT_ID_HIGH - i); + ret = usb_phy_io_read(phy, ULPI_PRODUCT_ID_HIGH - i); if (ret < 0) return ret; ulpi_id = (ulpi_id << 8) | ret; @@ -199,16 +199,17 @@ static int ulpi_init(struct usb_phy *otg) } } - ret = ulpi_check_integrity(otg); + ret = ulpi_check_integrity(phy); if (ret) return ret; - return ulpi_set_flags(otg); + return ulpi_set_flags(phy); } -static int ulpi_set_host(struct usb_phy *otg, struct usb_bus *host) +static int ulpi_set_host(struct usb_otg *otg, struct usb_bus *host) { - unsigned int flags = otg_io_read(otg, ULPI_IFC_CTRL); + struct usb_phy *phy = otg->phy; + unsigned int flags = usb_phy_io_read(phy, ULPI_IFC_CTRL); if (!host) { otg->host = NULL; @@ -221,51 +222,62 @@ static int ulpi_set_host(struct usb_phy *otg, struct usb_bus *host) ULPI_IFC_CTRL_3_PIN_SERIAL_MODE | ULPI_IFC_CTRL_CARKITMODE); - if (otg->flags & ULPI_IC_6PIN_SERIAL) + if (phy->flags & ULPI_IC_6PIN_SERIAL) flags |= ULPI_IFC_CTRL_6_PIN_SERIAL_MODE; - else if (otg->flags & ULPI_IC_3PIN_SERIAL) + else if (phy->flags & ULPI_IC_3PIN_SERIAL) flags |= ULPI_IFC_CTRL_3_PIN_SERIAL_MODE; - else if (otg->flags & ULPI_IC_CARKIT) + else if (phy->flags & ULPI_IC_CARKIT) flags |= ULPI_IFC_CTRL_CARKITMODE; - return otg_io_write(otg, flags, ULPI_IFC_CTRL); + return usb_phy_io_write(phy, flags, ULPI_IFC_CTRL); } -static int ulpi_set_vbus(struct usb_phy *otg, bool on) +static int ulpi_set_vbus(struct usb_otg *otg, bool on) { - unsigned int flags = otg_io_read(otg, ULPI_OTG_CTRL); + struct usb_phy *phy = otg->phy; + unsigned int flags = usb_phy_io_read(phy, ULPI_OTG_CTRL); flags &= ~(ULPI_OTG_CTRL_DRVVBUS | ULPI_OTG_CTRL_DRVVBUS_EXT); if (on) { - if (otg->flags & ULPI_OTG_DRVVBUS) + if (phy->flags & ULPI_OTG_DRVVBUS) flags |= ULPI_OTG_CTRL_DRVVBUS; - if (otg->flags & ULPI_OTG_DRVVBUS_EXT) + if (phy->flags & ULPI_OTG_DRVVBUS_EXT) flags |= ULPI_OTG_CTRL_DRVVBUS_EXT; } - return otg_io_write(otg, flags, ULPI_OTG_CTRL); + return usb_phy_io_write(phy, flags, ULPI_OTG_CTRL); } struct usb_phy * -otg_ulpi_create(struct otg_io_access_ops *ops, +otg_ulpi_create(struct usb_phy_io_ops *ops, unsigned int flags) { - struct usb_phy *otg; + struct usb_phy *phy; + struct usb_otg *otg; + + phy = kzalloc(sizeof(*phy), GFP_KERNEL); + if (!phy) + return NULL; otg = kzalloc(sizeof(*otg), GFP_KERNEL); - if (!otg) + if (!otg) { + kfree(phy); return NULL; + } + + phy->label = "ULPI"; + phy->flags = flags; + phy->io_ops = ops; + phy->otg = otg; + phy->init = ulpi_init; - otg->label = "ULPI"; - otg->flags = flags; - otg->io_ops = ops; - otg->init = ulpi_init; + otg->phy = phy; otg->set_host = ulpi_set_host; otg->set_vbus = ulpi_set_vbus; - return otg; + return phy; } EXPORT_SYMBOL_GPL(otg_ulpi_create); diff --git a/drivers/usb/otg/ulpi_viewport.c b/drivers/usb/otg/ulpi_viewport.c index e7b311b960bd..c5ba7e5423fc 100644 --- a/drivers/usb/otg/ulpi_viewport.c +++ b/drivers/usb/otg/ulpi_viewport.c @@ -74,7 +74,7 @@ static int ulpi_viewport_write(struct usb_phy *otg, u32 val, u32 reg) return ulpi_viewport_wait(view, ULPI_VIEW_RUN); } -struct otg_io_access_ops ulpi_viewport_access_ops = { +struct usb_phy_io_ops ulpi_viewport_access_ops = { .read = ulpi_viewport_read, .write = ulpi_viewport_write, }; diff --git a/include/linux/usb/ulpi.h b/include/linux/usb/ulpi.h index 51ebf72bc449..6f033a415ecb 100644 --- a/include/linux/usb/ulpi.h +++ b/include/linux/usb/ulpi.h @@ -181,12 +181,12 @@ /*-------------------------------------------------------------------------*/ -struct usb_phy *otg_ulpi_create(struct otg_io_access_ops *ops, +struct usb_phy *otg_ulpi_create(struct usb_phy_io_ops *ops, unsigned int flags); #ifdef CONFIG_USB_ULPI_VIEWPORT /* access ops for controllers with a viewport register */ -extern struct otg_io_access_ops ulpi_viewport_access_ops; +extern struct usb_phy_io_ops ulpi_viewport_access_ops; #endif #endif /* __LINUX_USB_ULPI_H */ -- cgit v1.2.3 From bc329ad7b018c8f6725cb025bf4d192925db84e6 Mon Sep 17 00:00:00 2001 From: Haojian Zhuang Date: Mon, 6 Feb 2012 15:33:22 +0800 Subject: ARM: pxa: fix wrong parsing gpio event on spitz (~GPLR0 & GPIO_bit(SPITZ_GPIO_KEY_INT)) | (GPLR0 & GPIO_bit(SPITZ_GPIO_SYNC)); After using gpio_get_value, the statement should be in below. ((!gpio_get_value(SPITZ_GPIO_KEY_INT) << GPIO_bit(SPITZ_GPIO_KEY_INT)) | gpio_get_value(SPITZ_GPIO_SYNC)); Signed-off-by: Haojian Zhuang --- arch/arm/mach-pxa/spitz_pm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'arch/arm/mach-pxa') diff --git a/arch/arm/mach-pxa/spitz_pm.c b/arch/arm/mach-pxa/spitz_pm.c index 34cbdac51525..438f02fe122a 100644 --- a/arch/arm/mach-pxa/spitz_pm.c +++ b/arch/arm/mach-pxa/spitz_pm.c @@ -172,10 +172,9 @@ static int spitz_should_wakeup(unsigned int resume_on_alarm) static unsigned long spitz_charger_wakeup(void) { unsigned long ret; - ret = (!gpio_get_value(SPITZ_GPIO_KEY_INT) + ret = ((!gpio_get_value(SPITZ_GPIO_KEY_INT) << GPIO_bit(SPITZ_GPIO_KEY_INT)) - | (!gpio_get_value(SPITZ_GPIO_SYNC) - << GPIO_bit(SPITZ_GPIO_SYNC)); + | gpio_get_value(SPITZ_GPIO_SYNC)); return ret; } -- cgit v1.2.3 From 438d7dc2bb531de59e335fea69d4a041f353f6f9 Mon Sep 17 00:00:00 2001 From: Haojian Zhuang Date: Mon, 6 Feb 2012 15:59:11 +0800 Subject: ARM: pxa: fix mixed declarations and code in sharpsl_pm arch/arm/mach-pxa/sharpsl_pm.c: In function 'sharpsl_pm_pxa_read_max1111': arch/arm/mach-pxa/sharpsl_pm.c:180: warning: ISO C90 forbids mixed declarations and code Signed-off-by: Haojian Zhuang --- arch/arm/mach-pxa/sharpsl_pm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'arch/arm/mach-pxa') diff --git a/arch/arm/mach-pxa/sharpsl_pm.c b/arch/arm/mach-pxa/sharpsl_pm.c index 8d5168d253a9..30989baf7f2a 100644 --- a/arch/arm/mach-pxa/sharpsl_pm.c +++ b/arch/arm/mach-pxa/sharpsl_pm.c @@ -168,6 +168,7 @@ struct battery_thresh sharpsl_battery_levels_noac[] = { #define MAXCTRL_SEL_SH 4 #define MAXCTRL_STR (1u << 7) +extern int max1111_read_channel(int); /* * Read MAX1111 ADC */ @@ -177,8 +178,6 @@ int sharpsl_pm_pxa_read_max1111(int channel) if (machine_is_tosa()) return 0; - extern int max1111_read_channel(int); - /* max1111 accepts channels from 0-3, however, * it is encoded from 0-7 here in the code. */ -- cgit v1.2.3 From be9bac9d33c0864ac7684c683df5da3b0c38e3b7 Mon Sep 17 00:00:00 2001 From: Danny Kukawka Date: Wed, 15 Feb 2012 20:19:25 +0100 Subject: ARM: pxa: fix including linux/gpio.h twice arch/arm/mach-pxa/pxa27x.c included 'linux/gpio.h' twice, remove the duplicate. Signed-off-by: Danny Kukawka Signed-off-by: Haojian Zhuang --- arch/arm/mach-pxa/pxa27x.c | 1 - 1 file changed, 1 deletion(-) (limited to 'arch/arm/mach-pxa') diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c index aed6cbcf3866..c1673b3441d4 100644 --- a/arch/arm/mach-pxa/pxa27x.c +++ b/arch/arm/mach-pxa/pxa27x.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #include -- cgit v1.2.3 From 88879c43eb8485861c17fcc15219c0b1ea17a925 Mon Sep 17 00:00:00 2001 From: Danny Kukawka Date: Thu, 16 Feb 2012 15:45:42 +0100 Subject: arch/arm/mach-pxa/: included linux/gpio.h twice arch/arm/mach-pxa/pxa25x.c and arch/arm/mach-pxa/saarb.c included 'linux/gpio.h' twice, remove the duplicates. Signed-off-by: Danny Kukawka Signed-off-by: Haojian Zhuang --- arch/arm/mach-pxa/pxa25x.c | 1 - arch/arm/mach-pxa/saarb.c | 1 - 2 files changed, 2 deletions(-) (limited to 'arch/arm/mach-pxa') diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c index 91e4f6c03766..00d6eacab8e4 100644 --- a/arch/arm/mach-pxa/pxa25x.c +++ b/arch/arm/mach-pxa/pxa25x.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include diff --git a/arch/arm/mach-pxa/saarb.c b/arch/arm/mach-pxa/saarb.c index febc809ed5a6..5aded5e6148f 100644 --- a/arch/arm/mach-pxa/saarb.c +++ b/arch/arm/mach-pxa/saarb.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include -- cgit v1.2.3 From d87f614326a2cb4c3ead0a45e5468c7c3ca6b72f Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Fri, 30 Dec 2011 12:06:11 +0800 Subject: pxa/hx4700: add platform device and I2C info for AK4641 codec The audio on hx4700 needs this to properly work. Signed-off-by: Philipp Zabel Signed-off-by: Dmitry Artamonow Signed-off-by: Axel Lin Acked-by: Marek Vasut Tested-by: Paul Parsons Signed-off-by: Haojian Zhuang --- arch/arm/mach-pxa/hx4700.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'arch/arm/mach-pxa') diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c index fb9b62dcf4ca..208eef1c0485 100644 --- a/arch/arm/mach-pxa/hx4700.c +++ b/arch/arm/mach-pxa/hx4700.c @@ -45,6 +45,7 @@ #include #include +#include #include