AMD Geode CS5535/5536 GPIO driver
PATCH 1/1 AMD Geode CS5535/5536 GPIO driver
A GPIO driver for the AMD Geode CS5535/5536 Companion Devices.
In the release 2 I've addressed all the concerns expressed by the various subsys maintainers involved.
--- arch/x86/Kconfig | 10 ++++ arch/x86/kernel/geode_32.c | 91 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+)
arch/x86/Kconfig +10 -0
@@ -1911,6 +1911,16 @@ config GEODE_MFGPT_TIMER MFGPTs have a better resolution and max interval than the generic PIT, and are suitable for use as high-res timers. +config GEODE_GPIO + bool "Geode GPIO support" + depends on MGEODE_LX && !CS5535_GPIO + default n + help + Say yes here to provide support for the 28 GPIO pins on + the AMD CS5535 and CS5536 Geode Companion Devices. + + If unsure, say N. + config OLPC bool "One Laptop Per Child support" default n
arch/x86/kernel/geode_32.c +91 -0
115 lines not on this page · raw message
Signature · 6 lines
Best regards, Alessandro Zummo, Tower Technologies - Torino, Italy http://www.towertech.it
arch/x86/Kconfig config GEODE_MFGPT_TIMER · line 1916
Quoted 9 lines · Alessandro Zummo
arch/x86/Kconfig +3
-0@@ -1911,6 +1911,16 @@ config GEODE_MFGPT_TIMER MFGPTs have a better resolution and max interval than the generic PIT, and are suitable for use as high-res timers. +config GEODE_GPIO + bool "Geode GPIO support" + depends on MGEODE_LX && !CS5535_GPIO
and also GPIOLIB ... maybe can you just "select GPIOLIB".
arch/x86/Kconfig config GEODE_MFGPT_TIMER
Quoted 11 lines
arch/x86/Kconfig +9
-0+ default n + help +static int cs5535_direction_output(struct gpio_chip *chip, unsigned offset, + int value) +{ + cs5535_gpio_set(chip, offset, value); + + geode_gpio_set(geode_gpio(offset), GPIO_OUTPUT_ENABLE); + geode_gpio_clear(geode_gpio(offset), GPIO_INPUT_ENABLE);
Unless this hardware misbehaves when both output and input modes are enabled (e.g. in the window between those two calls), I'd suggest just not clearing INPUT_ENABLE. It's legit to ask for the *actual* value of an output line, e.g. for when it uses open drain mode. (And didn't this hardware have an option for open drain GPIO signaling?)
Otherwise this has about the right shape for platform GPIOs.
- Dave
Quoted 6 lines · On Thu, 5 Feb 2009 16:12:20 -0800 David Brownell <[email protected]> wrote:
Unless this hardware misbehaves when both output and input modes are enabled (e.g. in the window between those two calls), I'd suggest just not clearing
INPUT_ENABLE. It's legit to ask for the *actual* value of an output line, e.g. for when it uses open drain mode. (And didn't this hardware have an option for open drain GPIO signaling?)
seems reasonable,
I'll let the Geode people decide what to do here...
Signature · 6 lines
Best regards, Alessandro Zummo, Tower Technologies - Torino, Italy http://www.towertech.it
Quoted 10 lines · Alessandro Zummo
Quoted 6 lines · On Thu, 5 Feb 2009 16:12:20 -0800 David Brownell <[email protected]> wrote:
Unless this hardware misbehaves when both output and input modes are enabled (e.g. in the window between those two calls), I'd suggest just not clearing
INPUT_ENABLE. It's legit to ask for the *actual* value of an output line, e.g. for when it uses open drain mode. (And didn't this hardware have an option for open drain GPIO signaling?)
Quoted 2 lines
seems reasonable,
I'll let the Geode people decide what to do here...
Sorry, I'm just getting around to answering this. I don't recall any situation where the hardware would mis-behave, but you never know with this bit of silicon.
I say leave them both on, and revisit it if you get flamed.
Jordan
Sorry, I'm just now getting around to looking at this. Why did we move it from cs553x-gpio.c to geode_32.c? I have a lemote (longsoon-based) which uses cs5536:
Linux debian 2.6.27.1 #193 Mon Jan 5 11:14:50 CST 2009 mips64 GNU/Linux
system type : lemote-notebook
processor : 0
cpu model : ICT Loongson-2 V0.3 FPU V0.1
BogoMIPS : 132.09
wait instruction : yes
microsecond timers : yestlb_entries : 64
extra interrupt vector : no
hardware watchpoint : no
ASEs implemented : shadow register sets : 1 core : 0 VCED exceptions : not available VCEI exceptions : not available
00:07.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10) 00:08.0 VGA compatible controller: Silicon Motion, Inc. SM712 LynxEM+ (rev b0)
00:09.0 USB Controller: NEC Corporation USB (rev 44)
00:09.1 USB Controller: NEC Corporation USB 2.0 (rev 05)
00:0e.0 ISA bridge: Advanced Micro Devices [AMD] CS5536 [Geode companion] ISA (rev 03) 00:0e.2 IDE interface: Advanced Micro Devices [AMD] CS5536 [Geode companion] IDE (rev 01) 00:0e.3 Multimedia audio controller: Advanced Micro Devices [AMD] CS5536 [Geode companion] Audio (rev 01) 00:0e.4 USB Controller: Advanced Micro Devices [AMD] CS5536 [Geode companion] OHC (rev 02) 00:0e.5 USB Controller: Advanced Micro Devices [AMD] CS5536 [Geode companion] EHC (rev 02) 00:0e.6 USB Controller: Advanced Micro Devices [AMD] CS5536 [Geode companion] UDC (rev 02) 00:0e.7 USB Controller: Advanced Micro Devices [AMD] CS5536 [Geode companion] UOC (rev 02)
This leads me to believe that the gpio framework should not be architecture-specific (nor geode-specific).
Quoted 8 lines · On Thu, 5 Feb 2009 16:10:07 +0100 Alessandro Zummo <[email protected]>…
A GPIO driver for the AMD Geode CS5535/5536 Companion Devices.
In the release 2 I've addressed all the concerns expressed by the various subsys maintainers involved.
---
[...]
Quoted 3 lines · On Sat, 14 Feb 2009 15:27:19 -0500 Andres Salomon <[email protected]> wrote:
Sorry, I'm just now getting around to looking at this. Why did we move it from
cs553x-gpio.ctogeode_32.c? I have a lemote (longsoon-based) which uses cs5536:
I've been suggested to move it within geode_32. the driver is probably pretty geode specific anyhow.
Signature · 6 lines
Best regards, Alessandro Zummo, Tower Technologies - Torino, Italy http://www.towertech.it
Quoted 10 lines · On Sat, 14 Feb 2009 23:02:35 +0100 Alessandro Zummo…
Quoted 3 lines · On Sat, 14 Feb 2009 15:27:19 -0500 Andres Salomon <[email protected]> wrote:
Sorry, I'm just now getting around to looking at this. Why did we move it from
cs553x-gpio.ctogeode_32.c? I have a lemote (longsoon-based) which uses cs5536:I've been suggested to move it within
geode_32. the driver is
probably pretty geode specific anyhow.
If the whole point is to make the cs553x GPIO stuff portable (and to use the portable API), then what's the point if we know that it can/will be used by non-x86 platforms?
We already have a cs553x GPIO char device, a geode GPIO lib that works (but has flaws).. I'm all for creating The One True CS553x GPIO API, but I'd consider something that's geode (and x86)-specific to be a waste of time.
Quoted 5 lines · On Sat, 14 Feb 2009 17:38:11 -0500 Andres Salomon <[email protected]> wrote:
Quoted 3 lines
I've been suggested to move it within
geode_32. the driver is
probably pretty geode specific anyhow.
Quoted 8 lines
If the whole point is to make the cs553x GPIO stuff portable (and to use the portable API), then what's the point if we know that it can/will be used by non-x86 platforms?
We already have a cs553x GPIO char device, a geode GPIO lib that works (but has flaws).. I'm all for creating The One True CS553x GPIO API, but I'd consider something that's geode (and x86)-specific to be a waste of time.
GPIO lib is generic enough for most archs to use it and my driver uses it Anyway I did my homework.. I will submit a revision with the latest suggested changes... if accepted I will be happy to maintain it.
Signature · 6 lines
Best regards, Alessandro Zummo, Tower Technologies - Torino, Italy http://www.towertech.it