collie and SA1100 patches
Subsystems (4)
Hi all!
This patchset implements prober power management for collie. To archieve this some bugs were fixed and gpiolib-support was added to the ucb1x00 driver. Please tell me if I should CC some other people or lists.
Regards,
Thomas
Statistics:
arch/arm/mach-sa1100/collie.c | 79 +++++-
arch/arm/mach-sa1100/include/mach/collie.h | 77 +++---
arch/arm/mach-sa1100/include/mach/gpio.h | 19 +-
arch/arm/mach-sa1100/include/mach/mcp.h | 1 +
drivers/leds/leds-locomo.c | 2 +-
drivers/mfd/mcp-core.c | 2 +-
drivers/mfd/mcp-sa11x0.c | 3 +-
drivers/mfd/ucb1x00-assabet.c | 2 +-
drivers/mfd/ucb1x00-core.c | 89 ++++++-
drivers/mfd/ucb1x00-ts.c | 2 +-
drivers/power/Kconfig | 7 +
drivers/power/Makefile | 1 +
drivers/power/collie_battery.c | 418 ++++++++++++++++++++++++++++
{drivers => include/linux}/mfd/mcp.h | 3 +
{drivers => include/linux}/mfd/ucb1x00.h | 7 +-
15 files changed, 649 insertions(+), 63 deletions(-)
create mode 100644 drivers/power/collie_battery.c
rename {drivers => include/linux}/mfd/mcp.h (97%)
rename {drivers => include/linux}/mfd/ucb1x00.h (98%)PATCH 1/9 collie: fix scoop convesion to new api
--- arch/arm/mach-sa1100/collie.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/mach-sa1100/collie.c +1 -0
@@ -56,6 +56,7 @@ static struct resource collie_scoop_resources[] = {static struct scoop_config collie_scoop_setup = { .io_dir =COLLIE_SCOOP_IO_DIR , .io_out =COLLIE_SCOOP_IO_OUT , + .gpio_base =COLLIE_SCOOP_GPIO_BASE , };struct platform_device colliescoop_device = {
Signature · 1 line
1.6.0.4
PATCH 2/9 collie: prepare for gpiolib use
prefix gpio definitions for direct register access with '_' so we can use the other names for gpio_request & co
--- arch/arm/mach-sa1100/collie.c | 12 ++++--- arch/arm/mach-sa1100/include/mach/collie.h | 42 +++++++++++++++++---------- 2 files changed, 33 insertions(+), 21 deletions(-)
arch/arm/mach-sa1100/collie.c +7 -5
@@ -249,22 +249,24 @@ static void __init collie_init(void)GPDR =GPIO_LDD8 |GPIO_LDD9 |GPIO_LDD10 |GPIO_LDD11 |GPIO_LDD12 |GPIO_LDD13 |GPIO_LDD14 |GPIO_LDD15 |GPIO_SSP_TXD |GPIO_SSP_SCLK |GPIO_SSP_SFRM |GPIO_SDLC_SCLK | - COLLIE_GPIO_UCB1x00_RESET | COLLIE_GPIO_nMIC_ON | - COLLIE_GPIO_nREMOCON_ON | GPIO_32_768kHz; + _COLLIE_GPIO_UCB1x00_RESET | _COLLIE_GPIO_nMIC_ON | + _COLLIE_GPIO_nREMOCON_ON | GPIO_32_768kHz;PPDR =PPC_LDD0 |PPC_LDD1 |PPC_LDD2 |PPC_LDD3 |PPC_LDD4 |PPC_LDD5 |PPC_LDD6 |PPC_LDD7 |PPC_L_PCLK |PPC_L_LCLK |PPC_L_FCLK |PPC_L_BIAS |PPC_TXD1 |PPC_TXD2 |PPC_TXD3 |PPC_TXD4 |PPC_SCLK |PPC_SFRM ; -PWER =COLLIE_GPIO_AC_IN |COLLIE_GPIO_CO |COLLIE_GPIO_ON_KEY | -COLLIE_GPIO_WAKEUP | COLLIE_GPIO_nREMOCON_INT |PWER_RTC ; +PWER = _COLLIE_GPIO_AC_IN | _COLLIE_GPIO_CO | _COLLIE_GPIO_ON_KEY | + _COLLIE_GPIO_WAKEUP | _COLLIE_GPIO_nREMOCON_INT |PWER_RTC ; -PGSR = COLLIE_GPIO_nREMOCON_ON; +PGSR = _COLLIE_GPIO_nREMOCON_ON;PSDR =PPC_RXD1 |PPC_RXD2 |PPC_RXD3 |PPC_RXD4 ;PCFR =PCFR_OPDE ; +GPSR |= _COLLIE_GPIO_UCB1x00_RESET; + platform_scoop_config = &collie_pcmcia_config;
arch/arm/mach-sa1100/include/mach/collie.h +26 -16
50 lines not on this page · raw message
Signature · 1 line
1.6.0.4
PATCH 3/9 move drivers/mfd/*.h to include/linux/mfd
So drivers like collie_battery driver can use
those files easier.
---
drivers/mfd/mcp-core.c | 2 +-
drivers/mfd/mcp-sa11x0.c | 2 +-
drivers/mfd/ucb1x00-assabet.c | 2 +-
drivers/mfd/ucb1x00-core.c | 2 +-
drivers/mfd/ucb1x00-ts.c | 2 +-
{drivers => include/linux}/mfd/mcp.h | 2 ++
{drivers => include/linux}/mfd/ucb1x00.h | 4 ++--
7 files changed, 9 insertions(+), 7 deletions(-)
rename {drivers => include/linux}/mfd/mcp.h (98%)
rename {drivers => include/linux}/mfd/ucb1x00.h (99%)drivers/mfd/mcp-core.c +1 -1
@@ -17,11 +17,11 @@#include <linux/device.h> #include <linux/slab.h> #include <linux/string.h> +#include <linux/mfd/mcp.h> #include <mach/dma.h> #include <asm/system.h> -#include "mcp.h" #define to_mcp (d) container_of(d, struct mcp, attached_device)#define to_mcp_driver (d) container_of(d, struct mcp_driver, drv)
drivers/mfd/mcp-sa11x0.c +1 -1
@@ -19,6 +19,7 @@#include <linux/spinlock.h> #include <linux/slab.h> #include <linux/platform_device.h> +#include <linux/mfd/mcp.h> #include <mach/dma.h> #include <mach/hardware.h>
@@ -28,7 +29,6 @@#include <mach/assabet.h> -#include "mcp.h" struct mcp_sa11x0 {u32 mccr0;
drivers/mfd/ucb1x00-assabet.c +1 -1
@@ -14,10 +14,10 @@#include <linux/fs.h> #include <linux/proc_fs.h> #include <linux/device.h> +#include <linux/mfd/ucb1x00.h> #include <mach/dma.h> -#include "ucb1x00.h" #define UCB1X00_ATTR (name,input)\ static ssize_t name##_show(struct device *dev, struct device_attribute *attr, \
drivers/mfd/ucb1x00-core.c +1 -1
@@ -24,11 +24,11 @@#include <linux/interrupt.h> #include <linux/device.h> #include <linux/mutex.h> +#include <linux/mfd/ucb1x00.h> #include <mach/dma.h> #include <mach/hardware.h> -#include "ucb1x00.h" static DEFINE_MUTEX (ucb1x00_mutex);static LIST_HEAD (ucb1x00_drivers);
drivers/mfd/ucb1x00-ts.c +1 -1
@@ -30,12 +30,12 @@#include <linux/freezer.h> #include <linux/slab.h> #include <linux/kthread.h> +#include <linux/mfd/ucb1x00.h> #include <mach/dma.h> #include <mach/collie.h> #include <asm/mach-types.h> -#include "ucb1x00.h" struct ucb1x00_ts {
include/linux/mfd/mcp.h renamed from drivers/mfd/mcp.h +2 -0
@@ -10,6 +10,8 @@#ifndef MCP_H #define MCP_H +#include <mach/dma.h> +struct mcp_ops ; struct mcp {
include/linux/mfd/ucb1x00.h renamed from drivers/mfd/ucb1x00.h +2 -2
@@ -1,5 +1,5 @@/* -* linux/drivers/mfd/ucb1x00.h +* linux/include/mfd/ucb1x00.h * * Copyright (C) 2001 Russell King, All Rights Reserved. *
@@ -10,6 +10,7 @@#ifndef UCB1200_H #define UCB1200_H +#include <linux/mfd/mcp.h> #define UCB_IO_DATA 0x00#define UCB_IO_DIR 0x01
@@ -100,7 +101,6 @@#define UCB_MODE_DYN_VFLAG_ENA (1 << 12)#define UCB_MODE_AUD_OFF_CAN (1 << 13) -#include "mcp.h" struct ucb1x00_irq {void *devid;
Signature · 1 line
1.6.0.4
PATCH 4/9 collie: locomo-led change default trigger
Collie uses now the powersupply framework. Change the default led-trigger of locomo-led to reflect that.
--- drivers/leds/leds-locomo.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/leds/leds-locomo.c +1 -1
@@ -44,7 +44,7 @@ static void locomoled_brightness_set1(struct led_classdev *led_cdev,static struct led_classdev locomo_led0 = { .name ="locomo:amber:charge" , - .default_trigger ="sharpsl-charge" , + .default_trigger ="main-battery-charging" , .brightness_set = locomoled_brightness_set0, };
Signature · 1 line
1.6.0.4
PATCH 5/9 SA1100: make gpio_to_irq and reverse a macro
The function can't be used for static initialisations so convert them to macros.
--- arch/arm/mach-sa1100/include/mach/gpio.h | 19 ++++--------------- 1 files changed, 4 insertions(+), 15 deletions(-)
arch/arm/mach-sa1100/include/mach/gpio.h +4 -15
@@ -49,20 +49,9 @@ static inline void gpio_set_value(unsigned gpio, int value)#define gpio_cansleep __gpio_cansleep -static inline unsigned gpio_to_irq (unsigned gpio) -{ -if (gpio <11 ) -return IRQ_GPIO0 + gpio; -else -return IRQ_GPIO11 -11 + gpio; -} - -static inline unsigned irq_to_gpio (unsigned irq) -{ -if (irq <IRQ_GPIO11_27 ) -return irq -IRQ_GPIO0 ; -else -return irq -IRQ_GPIO11 +11 ; -} +#define gpio_to_irq (gpio) ((gpio < 11) ? (IRQ_GPIO0 + gpio) : \ + (IRQ_GPIO11 - 11 + gpio)) +#define irq_to_gpio (irq) ((irq < IRQ_GPIO11_27) ? (irq - IRQ_GPIO0) : \ + (irq - IRQ_GPIO11 + 11))#endif
Signature · 1 line
1.6.0.4
PATCH 6/9 add gpiolib support to ucb1x00
The old access methods to the gpios will be removed when all users has been converted. (mainly ucb1x00-ts)
--- arch/arm/mach-sa1100/include/mach/mcp.h | 1 + drivers/mfd/mcp-sa11x0.c | 1 + drivers/mfd/ucb1x00-core.c | 87 ++++++++++++++++++++++++++++++- include/linux/mfd/mcp.h | 1 + include/linux/mfd/ucb1x00.h | 3 + 5 files changed, 91 insertions(+), 2 deletions(-)
arch/arm/mach-sa1100/include/mach/mcp.h +1 -0
@@ -16,6 +16,7 @@ struct mcp_plat_data {u32 mccr0;u32 mccr1;unsigned int sclk_rate; + int gpio_base; };#endif
drivers/mfd/mcp-sa11x0.c +1 -0
@@ -163,6 +163,7 @@ static int mcp_sa11x0_probe(struct platform_device *pdev) mcp->dma_audio_wr = DMA_Ser4MCP0Wr; mcp->dma_telco_rd = DMA_Ser4MCP1Rd; mcp->dma_telco_wr = DMA_Ser4MCP1Wr; + mcp->gpio_base = data->gpio_base;platform_set_drvdata (pdev, mcp);
drivers/mfd/ucb1x00-core.c +85 -2
154 lines not on this page · raw message
include/linux/mfd/mcp.h +1 -0
@@ -26,6 +26,7 @@ struct mcp {dma_device_t dma_telco_rd;dma_device_t dma_telco_wr;struct device attached_device; +int gpio_base; };struct mcp_ops {
include/linux/mfd/ucb1x00.h +3 -0
@@ -11,6 +11,8 @@#define UCB1200_H #include <linux/mfd/mcp.h> +#include <linux/gpio.h> +#define UCB_IO_DATA 0x00#define UCB_IO_DIR 0x01
@@ -123,6 +125,7 @@ struct ucb1x00 {struct device dev;struct list_head node;struct list_head devs; +struct gpio_chip gpio; };struct ucb1x00_driver ;
Signature · 1 line
1.6.0.4
PATCH 7/9 collie: convert to gpiolib for ucb1x00
Only the parts used for collie_battery are converted. The rest will be cleaned up later.
--- arch/arm/mach-sa1100/collie.c | 1 + arch/arm/mach-sa1100/include/mach/collie.h | 35 ++++++++++++++------------- 2 files changed, 19 insertions(+), 17 deletions(-)
arch/arm/mach-sa1100/collie.c +1 -0
@@ -86,6 +86,7 @@ static struct scoop_pcmcia_config collie_pcmcia_config = {static struct mcp_plat_data collie_mcp_data = { .mccr0 =MCCR0_ADM | MCCR0_ExtClk, .sclk_rate =9216000 , + .gpio_base =COLLIE_TC35143_GPIO_BASE , };#ifdef CONFIG_SHARP_LOCOMO
arch/arm/mach-sa1100/include/mach/collie.h +18 -17
@@ -25,10 +25,10 @@#define COLLIE_GPIO_VPEN (COLLIE_SCOOP_GPIO_BASE + 7)#define COLLIE_SCP_LB_VOL_CHG SCOOP_GPCR_PA19 -#define COLLIE_SCOOP_IO_DIR ( COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R | \ +#define COLLIE_SCOOP_IO_DIR (COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R | \ COLLIE_SCP_5VON | COLLIE_SCP_AMP_ON | \ - COLLIE_SCP_LB_VOL_CHG ) -#define COLLIE_SCOOP_IO_OUT ( COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R ) + COLLIE_SCP_LB_VOL_CHG) +#define COLLIE_SCOOP_IO_OUT (COLLIE_SCP_MUTE_L | COLLIE_SCP_MUTE_R)/* GPIOs for gpiolib */
@@ -80,19 +80,20 @@#define COLLIE_LCM_IRQ_GPIO_nSD_WP IRQ_LOCOMO_GPIO14/* GPIO's on the TC35143AF (Toshiba Analog Frontend) */ -#define COLLIE_TC35143_GPIO_VERSION0 UCB_IO_0/* GPIO0=Version */ -#define COLLIE_TC35143_GPIO_TBL_CHK UCB_IO_1/* GPIO1=TBL_CHK */ -#define COLLIE_TC35143_GPIO_VPEN_ON UCB_IO_2/* GPIO2=VPNE_ON */ -#define COLLIE_TC35143_GPIO_IR_ON UCB_IO_3/* GPIO3=IR_ON */ -#define COLLIE_TC35143_GPIO_AMP_ON UCB_IO_4/* GPIO4=AMP_ON */ -#define COLLIE_TC35143_GPIO_VERSION1 UCB_IO_5/* GPIO5=Version */ -#define COLLIE_TC35143_GPIO_FS8KLPF UCB_IO_5/* GPIO5=fs 8k LPF */ -#define COLLIE_TC35143_GPIO_BUZZER_BIAS UCB_IO_6/* GPIO6=BUZZER BIAS */ -#define COLLIE_TC35143_GPIO_MBAT_ON UCB_IO_7/* GPIO7=MBAT_ON */ -#define COLLIE_TC35143_GPIO_BBAT_ON UCB_IO_8/* GPIO8=BBAT_ON */ -#define COLLIE_TC35143_GPIO_TMP_ON UCB_IO_9/* GPIO9=TMP_ON */ -#define COLLIE_TC35143_GPIO_IN ( UCB_IO_0 | UCB_IO_2 | UCB_IO_5 ) -#define COLLIE_TC35143_GPIO_OUT ( UCB_IO_1 | UCB_IO_3 | UCB_IO_4 | UCB_IO_6 | \ - UCB_IO_7 | UCB_IO_8 | UCB_IO_9 ) +#define COLLIE_TC35143_GPIO_BASE (GPIO_MAX + 13) +#define COLLIE_TC35143_GPIO_VERSION0 UCB_IO_0 +#define COLLIE_TC35143_GPIO_TBL_CHK UCB_IO_1 +#define COLLIE_TC35143_GPIO_VPEN_ON UCB_IO_2 +#define COLLIE_TC35143_GPIO_IR_ON UCB_IO_3 +#define COLLIE_TC35143_GPIO_AMP_ON UCB_IO_4 +#define COLLIE_TC35143_GPIO_VERSION1 UCB_IO_5 +#define COLLIE_TC35143_GPIO_FS8KLPF UCB_IO_5 +#define COLLIE_TC35143_GPIO_BUZZER_BIAS UCB_IO_6 +#define COLLIE_GPIO_MBAT_ON (COLLIE_TC35143_GPIO_BASE + 7) +#define COLLIE_GPIO_BBAT_ON (COLLIE_TC35143_GPIO_BASE + 8) +#define COLLIE_GPIO_TMP_ON (COLLIE_TC35143_GPIO_BASE + 9) +#define COLLIE_TC35143_GPIO_IN (UCB_IO_0 | UCB_IO_2 | UCB_IO_5) +#define COLLIE_TC35143_GPIO_OUT (UCB_IO_1 | UCB_IO_3 | UCB_IO_4 \ + | UCB_IO_6)#endif
Signature · 1 line
1.6.0.4
PATCH 8/9 collie: add battery driver
This driver is based on tosa_battery.c.
--- drivers/power/Kconfig | 7 + drivers/power/Makefile | 1 + drivers/power/collie_battery.c | 418 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 426 insertions(+), 0 deletions(-) create mode 100644 drivers/power/collie_battery.c
drivers/power/Kconfig +7 -0
@@ -77,6 +77,13 @@ config BATTERY_TOSA Say Y to enable support for the battery on the Sharp Zaurus SL-6000 (tosa) models. +config BATTERY_COLLIE + tristate "Sharp SL-5500 (collie) battery" + depends on SA1100_COLLIE && MCP_UCB1200 + help + Say Y to enable support for the battery on the Sharp Zaurus + SL-5500 (collie) models. + config BATTERY_WM97XX bool "WM97xx generic battery driver" depends on TOUCHSCREEN_WM97XX=y
drivers/power/Makefile +1 -0
@@ -24,6 +24,7 @@ obj-$(CONFIG_BATTERY_DS2782) += ds2782_battery.o obj-$(CONFIG_BATTERY_PMU) += pmu_battery.o obj-$(CONFIG_BATTERY_OLPC) += olpc_battery.o obj-$(CONFIG_BATTERY_TOSA) += tosa_battery.o +obj-$(CONFIG_BATTERY_COLLIE) += collie_battery.o obj-$(CONFIG_BATTERY_WM97XX) += wm97xx_battery.o obj-$(CONFIG_BATTERY_BQ27x00) += bq27x00_battery.o obj-$(CONFIG_BATTERY_DA9030) += da9030_battery.o
drivers/power/collie_battery.c new file +418 -0
418 lines not on this page · raw message
Signature · 1 line
1.6.0.4
PATCH 9/9 collie: support pda_power driver
This add the pda-power platform device to collie.
--- arch/arm/mach-sa1100/collie.c | 65 +++++++++++++++++++++++++++++++++++++++++ 1 files changed, 65 insertions(+), 0 deletions(-)
arch/arm/mach-sa1100/collie.c +65 -0
@@ -26,6 +26,7 @@#include <linux/mtd/partitions.h> #include <linux/timer.h> #include <linux/gpio.h> +#include <linux/pda_power.h> #include <mach/hardware.h> #include <asm/mach-types.h>
@@ -89,6 +90,69 @@ static struct mcp_plat_data collie_mcp_data = { .gpio_base = COLLIE_TC35143_GPIO_BASE, }; +/* +* Collie AC IN +*/ +static int collie_power_init (struct device *dev) +{ +int ret =gpio_request (COLLIE_GPIO_AC_IN ,"ac in" ); +if (ret) + goto err_gpio_req; + + ret =gpio_direction_input (COLLIE_GPIO_AC_IN ); +if (ret) + goto err_gpio_in; + +return 0 ; + +err_gpio_in: +gpio_free (COLLIE_GPIO_AC_IN ); +err_gpio_req: +return ret; +} + +static void collie_power_exit (struct device *dev) +{ +gpio_free (COLLIE_GPIO_AC_IN ); +} + +static int collie_power_ac_online (void ) +{ +return gpio_get_value (COLLIE_GPIO_AC_IN ) ==2 ; +} + +static char *collie_ac_supplied_to[] = { +"main-battery" , +"backup-battery" , +}; + +static struct pda_power_pdata collie_power_data = { + .init = collie_power_init, + .is_ac_online = collie_power_ac_online, + .exit = collie_power_exit, + .supplied_to = collie_ac_supplied_to, + .num_supplicants =ARRAY_SIZE (collie_ac_supplied_to), +}; + +static struct resource collie_power_resource[] = { + { + .name ="ac" , + .start =gpio_to_irq (COLLIE_GPIO_AC_IN ), + .end =gpio_to_irq (COLLIE_GPIO_AC_IN ), + .flags =IORESOURCE_IRQ | +IORESOURCE_IRQ_HIGHEDGE | +IORESOURCE_IRQ_LOWEDGE , + }, +}; + +static struct platform_device collie_power_device = { + .name ="pda-power" , + .id =-1 , + .dev.platform_data = &collie_power_data, + .resource = collie_power_resource, + .num_resources =ARRAY_SIZE (collie_power_resource), +}; +#ifdef CONFIG_SHARP_LOCOMO /* * low-level UART features.
@@ -180,6 +244,7 @@ struct platform_device collie_locomo_device = {static struct platform_device *devices[]__initdata = { &collie_locomo_device, &colliescoop_device, + &collie_power_device, };static struct mtd_partition collie_partitions[] = {
Signature · 1 line
1.6.0.4
PATCH 6/9 add gpiolib support to ucb1x00
In reply to Thomas KunzeQuoted 2 lines · Thomas Kunze
The old access methods to the gpios will be removed when all users has been converted. (mainly ucb1x00-ts)
btw, what was the point in moving private includes out of drivers/mfd into include/linux/mfd? If they're private, they should stay private and local to the relevant files IMHO.
PATCH 6/9 add gpiolib support to ucb1x00
Quoted 10 lines · Russell King - ARM Linux
Quoted 3 lines · Thomas Kunze
The old access methods to the gpios will be removed when all users has been converted. (mainly ucb1x00-ts)
btw, what was the point in moving private includes out of
drivers/mfdintoinclude/linux/mfd? If they're private, they should stay private and local to the relevant files IMHO.
I moved the touchscreen driver to drivers/input/touchscreen and the battery driver (in drivers/power) needs those too.
There is an out of tree sound driver for ucb1x00 thats in the sound directory. So moving those includes to a more accessable location makes sense to me.
Regards,
Thomas
PATCH 5/9 SA1100: make gpio_to_irq and reverse a macro
In reply to Thomas KunzeHi!
Quoted 4 lines
The function can't be used for static initialisations so convert them to macros.
Signed-off-by Thomas Kunze <[email protected]>
Do you actually use them in initializers?
If not, I guess the function version is nicer...
Quoted 25 lines
arch/arm/mach-sa1100/include/mach/gpio.h +4
-15@@ -49,20 +49,9 @@ static inline void gpio_set_value(unsigned gpio, int value)#define gpio_cansleep __gpio_cansleep -static inline unsigned gpio_to_irq (unsigned gpio) -{ -if (gpio <11 ) -return IRQ_GPIO0 + gpio; -else -return IRQ_GPIO11 -11 + gpio; -} - -static inline unsigned irq_to_gpio (unsigned irq) -{ -if (irq <IRQ_GPIO11_27 ) -return irq -IRQ_GPIO0 ; -else -return irq -IRQ_GPIO11 +11 ; -} +#define gpio_to_irq (gpio) ((gpio < 11) ? (IRQ_GPIO0 + gpio) : \ + (IRQ_GPIO11 - 11 + gpio)) +#define irq_to_gpio (irq) ((irq < IRQ_GPIO11_27) ? (irq - IRQ_GPIO0) : \ + (irq - IRQ_GPIO11 + 11))#endif
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
PATCH 5/9 SA1100: make gpio_to_irq and reverse a macro
Quoted 11 lines · Pavel Machek
Hi!
Quoted 5 lines
The function can't be used for static initialisations so convert them to macros.
Signed-off-by Thomas Kunze <[email protected]>Do you actually use them in initializers?
Yes the last patch of the series does.
PATCH 2/9 collie: prepare for gpiolib use
In reply to Thomas KunzeQuoted 2 lines · Thomas Kunze
prefix gpio definitions for direct register access with '_' so we can use the other names for
gpio_request& co
Familiar problem - numeric vs bit-shifted gpio defines. I'm facing it here too while converting h3[16]00 to gpiolib, and I'm thinking about dropping bit-shifted defines completely and using GPIO_GPIO(SOME_NUMERIC_GPIO) instead.
Perhaps you may find this idea useful for collie.
Signature · 2 lines
Best regards, Dmitry "MAD" Artamonow
PATCH 2/9 collie: prepare for gpiolib use
Quoted 8 lines · Dmitry Artamonow
Quoted 2 lines · Thomas Kunze
prefix gpio definitions for direct register access with '_' so we can use the other names for
gpio_request& coFamiliar problem - numeric vs bit-shifted gpio defines. I'm facing it here too while converting h3[16]00 to gpiolib, and I'm thinking about dropping bit-shifted defines completely and using
GPIO_GPIO(SOME_NUMERIC_GPIO)instead.
What we did with PXA was to decide not to use definitions for the built-in GPIOs - what's the point of:
#define GPIO0 0
#define GPIO1 1
#define GPIO2 2
...
It's a bit like:
#define NUMBER0 0
#define NUMBER1 1
etc.
Yes, there's a reason to if the number spaces are different, but for the built-in GPIOs, they aren't.
PATCH 2/9 collie: prepare for gpiolib use
Quoted 10 lines · Russell King - ARM Linux
Quoted 8 lines · Dmitry Artamonow
Quoted 2 lines · Thomas Kunze
prefix gpio definitions for direct register access with '_' so we can use the other names for
gpio_request& coFamiliar problem - numeric vs bit-shifted gpio defines. I'm facing it here too while converting h3[16]00 to gpiolib, and I'm thinking about dropping bit-shifted defines completely and using
GPIO_GPIO(SOME_NUMERIC_GPIO)instead.
Quoted 8 lines
What we did with PXA was to decide not to use definitions for the built-in GPIOs - what's the point of:
#define GPIO0 0
#define GPIO1 1
#define GPIO2 2
...
A point could be that 'grep GPIO0 ...' would find any usage of that GPIO in the kernel source while 'grep 0 ...' would be quite pointless.
Lothar Wa?mann
Signature · 9 lines
___________________________________________________________ Ka-Ro electronics GmbH | Pascalstra?e 22 | D - 52076 Aachen Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10 Gesch?ftsf?hrer: Matthias Kaussen Handelsregistereintrag: Amtsgericht Aachen, HRB 4996 www.karo-electronics.de | info at karo-electronics.de ___________________________________________________________
PATCH 2/9 collie: prepare for gpiolib use
Hello.
Quoted 11 lines · Lothar Wa?mann
Quoted 10 lines
Quoted 7 lines
Quoted 2 lines
prefix gpio definitions for direct register access with '_' so we can use the other names for
gpio_request& coFamiliar problem - numeric vs bit-shifted gpio defines. I'm facing it here too while converting h3[16]00 to gpiolib, and I'm thinking about dropping bit-shifted defines completely and using
GPIO_GPIO(SOME_NUMERIC_GPIO)instead.What we did with PXA was to decide not to use definitions for the built-in GPIOs - what's the point of:
Quoted 8 lines
Quoted 4 lines
#define GPIO0 0
#define GPIO1 1
#define GPIO2 2
...A point could be that 'grep GPIO0 ...' would find any usage of that GPIO in the kernel source while 'grep 0 ...' would be quite pointless.
That's why some people have GPIO(n) macro. :-)
#define GPIO(n) (n)
Quoted 1 line
Lothar Wa?mann
WBR, Sergei
PATCH 2/9 collie: prepare for gpiolib use
In reply to Russell King - ARM LinuxQuoted 18 lines · Russell King - ARM Linux
Quoted 8 lines · Dmitry Artamonow
Quoted 2 lines · Thomas Kunze
prefix gpio definitions for direct register access with '_' so we can use the other names for
gpio_request& coFamiliar problem - numeric vs bit-shifted gpio defines. I'm facing it here too while converting h3[16]00 to gpiolib, and I'm thinking about dropping bit-shifted defines completely and using
GPIO_GPIO(SOME_NUMERIC_GPIO)instead.What we did with PXA was to decide not to use definitions for the built-in GPIOs - what's the point of:
#define GPIO0 0
#define GPIO1 1
#define GPIO2 2
...
Quoted 8 lines
It's a bit like:
#define NUMBER0 0
#define NUMBER1 1
etc.Yes, there's a reason to if the number spaces are different, but for the built-in GPIOs, they aren't.
Perhaps I wasn't exactly clear in explaining my thoughts. Sorry. I meant following - currently in mach/h3600_gpio.h we have gpios declared like that:
#define GPIO_H3100_IR_ON GPIO_GPIO (8)
which effectively means:
#define GPIO_H3100_IR_ON (1 << 8)
i.e. bit-shifted value.
But gpiolibs needs numeric gpio definitions, something like that:
#define NGPIO_H3100_IR_ON 8
That's all well, but not all direct operations with GPIO registers on SA1100 can be converted to gpiolib. Operations with GAFR (GPIO alternate function register), for example (PXA have MFD API for that, but StrongArm doesn't)
So for constructions like these:
GAFR &= ~GPIO_H3100_IR_ON; we either need to keep both variants of GPIO definitions in header, or keep only "numeric" and change code to: GAFR &= ~GPIO_GPIO(NGPIO_H3100_IR_ON);
Signature · 2 lines
Best regards, Dmitry "MAD" Artamonow
PATCH 2/9 collie: prepare for gpiolib use
Quoted 8 lines · Dmitry Artamonow
Perhaps I wasn't exactly clear in explaining my thoughts. Sorry. I meant following - currently in
mach/h3600_gpio.hwe have gpios declared like that:
#defineGPIO_H3100_IR_ONGPIO_GPIO(8)
which effectively means:
#defineGPIO_H3100_IR_ON(1 << 8)
i.e. bit-shifted value.
Quoted 5 lines
But gpiolibs needs numeric gpio definitions, something like that:
#defineNGPIO_H3100_IR_ON8That's all well, but not all direct operations with GPIO registers on SA1100 can be converted to gpiolib.
I tinkered around with this yesterday before your message came through, and I defined a new set of definitions, eg:
#define H3100_GPIO_IR_ON 8
so avoiding the problem. See my 'sa1100' branch published in the usual places.
Quoted 2 lines
Operations with GAFR (GPIO alternate function register), for example (PXA have MFD API for that, but StrongArm doesn't)
Maybe long-term replicating something like the MFP API would be a good idea, rather than sticking with direct manipulation of the GAFR (which is racy if done from two different contexts).
Currently, it's hard to audit that all GAFR manipulations are done in a safe way.
RMK's sa1100 branch (was Re: [PATCH 2/9] collie: prepare for gpiolib use)
Quoted 8 lines · Russell King - ARM Linux
On Wed, Oct 07, 2009 at 04:42:52PM +0400, Dmitry Artamonow wrote:
I tinkered around with this yesterday before your message came through, and I defined a new set of definitions, eg:#define
H3100_GPIO_IR_ON8so avoiding the problem. See my 'sa1100' branch published in the usual places.
Whoa! Seems that you did a lot of work. What do you plan to do with it? Should I rebase my work on top of IPAQ patches in this branch? Basically they do the same as my patches, but there's some things here and there that I missed or not done yet, and will gladly reuse.
Signature · 2 lines
Best regards, Dmitry "MAD" Artamonow
RMK's sa1100 branch (was Re: [PATCH 2/9] collie: prepare for gpiolib use)
Quoted 5 lines · Dmitry Artamonow
Quoted 4 lines · Russell King - ARM Linux
On Wed, Oct 07, 2009 at 04:42:52PM +0400, Dmitry Artamonow wrote:
I tinkered around with this yesterday before your message came through, and I defined a new set of definitions, eg:
Quoted 7 lines
Quoted 4 lines
#define
H3100_GPIO_IR_ON8so avoiding the problem. See my 'sa1100' branch published in the usual places.
Whoa! Seems that you did a lot of work. What do you plan to do with it? Should I rebase my work on top of IPAQ patches in this branch?
That's up to you really - while I do have a H3600 which had Linux on, I don't know what state it's in with regard to being usable, so I don't count myself as being able to properly test changes in this area.
PATCH 2/9 collie: prepare for gpiolib use
In reply to Dmitry ArtamonowQuoted 6 lines · Dmitry Artamonow
Quoted 3 lines · Thomas Kunze
prefix gpio definitions for direct register access with '_' so we can use the other names for
gpio_request& co
Quoted 8 lines
Familiar problem - numeric vs bit-shifted gpio defines. I'm facing it here too while converting h3[16]00 to gpiolib, and I'm thinking about dropping bit-shifted defines completely and using
GPIO_GPIO(SOME_NUMERIC_GPIO)instead.Perhaps you may find this idea useful for collie.
While a good idea I don't want to make the line in cpu initialisation any longer.
This is only a short term solution. In the long term we should do the same as pxa.
Quoted 7 lines · Thomas Kunze
This patchset implements prober power management for collie. To archieve this some bugs were fixed and gpiolib-support was added to the ucb1x00 driver. Please tell me if I should CC some other people or lists.
drivers/mfd/ucb1x00-assabet.c | 2 +- drivers/mfd/ucb1x00-core.c | 89 ++++++- drivers/mfd/ucb1x00-ts.c | 2 +-
This stuff probably ought to be CCed to Samuel Ortiz at least.
Quoted 5 lines · On Mon, 5 Oct 2009 23:35:24 +0200 Thomas Kunze <[email protected]> wrote:
Hi all!
This patchset implements prober power management for collie. To archieve this some bugs were fixed and gpiolib-support was added to the ucb1x00 driver. Please tell me if I should CC some other people or lists.
Without looking at the patches, how does this affect other sa11xx based platforms?
Quoted 30 lines
Regards,
ThomasStatistics:
arch/arm/mach-sa1100/collie.c | 79 +++++- arch/arm/mach-sa1100/include/mach/collie.h | 77 +++--- arch/arm/mach-sa1100/include/mach/gpio.h | 19 +- arch/arm/mach-sa1100/include/mach/mcp.h | 1 + drivers/leds/leds-locomo.c | 2 +- drivers/mfd/mcp-core.c | 2 +- drivers/mfd/mcp-sa11x0.c | 3 +- drivers/mfd/ucb1x00-assabet.c | 2 +- drivers/mfd/ucb1x00-core.c | 89 ++++++- drivers/mfd/ucb1x00-ts.c | 2 +- drivers/power/Kconfig | 7 + drivers/power/Makefile | 1 + drivers/power/collie_battery.c | 418 ++++++++++++++++++++++++++++ {drivers => include/linux}/mfd/mcp.h | 3 + {drivers => include/linux}/mfd/ucb1x00.h | 7 +- 15 files changed, 649 insertions(+), 63 deletions(-) create mode 100644 drivers/power/collie_battery.c rename {drivers => include/linux}/mfd/mcp.h (97%) rename {drivers => include/linux}/mfd/ucb1x00.h (98%)_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 1 line
Kristoffer Ericson <[email protected]>
Quoted 6 lines · Kristoffer Ericson
Quoted 2 lines · On Mon, 5 Oct 2009 23:35:24 +0200 Thomas Kunze <[email protected]> wrote:
Hi all!
Quoted 8 lines
Quoted 4 lines
This patchset implements prober power management for collie. To archieve this some bugs were fixed and gpiolib-support was added to the ucb1x00 driver. Please tell me if I should CC some other people or lists.
Without looking at the patches, how does this affect other sa11xx based platforms?
They can use gpiolib for ucb1x00 now (patch 3 and 6) and can use "gpio_to_irq" and "irq_to_gpio"
in static initialisation. Otherwise they aren't affected.
Quoted 34 lines
Quoted 31 lines
Regards,
ThomasStatistics:
arch/arm/mach-sa1100/collie.c | 79 +++++- arch/arm/mach-sa1100/include/mach/collie.h | 77 +++--- arch/arm/mach-sa1100/include/mach/gpio.h | 19 +- arch/arm/mach-sa1100/include/mach/mcp.h | 1 + drivers/leds/leds-locomo.c | 2 +- drivers/mfd/mcp-core.c | 2 +- drivers/mfd/mcp-sa11x0.c | 3 +- drivers/mfd/ucb1x00-assabet.c | 2 +- drivers/mfd/ucb1x00-core.c | 89 ++++++- drivers/mfd/ucb1x00-ts.c | 2 +- drivers/power/Kconfig | 7 + drivers/power/Makefile | 1 + drivers/power/collie_battery.c | 418 ++++++++++++++++++++++++++++ {drivers => include/linux}/mfd/mcp.h | 3 + {drivers => include/linux}/mfd/ucb1x00.h | 7 +- 15 files changed, 649 insertions(+), 63 deletions(-) create mode 100644 drivers/power/collie_battery.c rename {drivers => include/linux}/mfd/mcp.h (97%) rename {drivers => include/linux}/mfd/ucb1x00.h (98%)_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Hi!
Quoted 3 lines
This patchset implements prober power management for collie. To archieve this some bugs were fixed and gpiolib-support was added to the ucb1x00 driver. Please tell me if I should CC some other people or lists.
Thanks for working on collie! :-).
Yep, the series looks okay; I guess I should get the dust off the collie.
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Hi,
what is the status of this patchset?
The patchset is available via git at:
http://git.linuxtogo.org/?p=thesing/collie.git;a=shortlog;h=refs/heads/for-lak
The branch is based on 2.6.32-rc5. Please tell me if I should rebase on sth. else.
Regards,
Thomas
Quoted 36 lines
Hi all!
This patchset implements prober power management for collie. To archieve this some bugs were fixed and gpiolib-support was added to the ucb1x00 driver. Please tell me if I should CC some other people or lists.
Regards,
ThomasStatistics:
arch/arm/mach-sa1100/collie.c | 79 +++++- arch/arm/mach-sa1100/include/mach/collie.h | 77 +++--- arch/arm/mach-sa1100/include/mach/gpio.h | 19 +- arch/arm/mach-sa1100/include/mach/mcp.h | 1 + drivers/leds/leds-locomo.c | 2 +- drivers/mfd/mcp-core.c | 2 +- drivers/mfd/mcp-sa11x0.c | 3 +- drivers/mfd/ucb1x00-assabet.c | 2 +- drivers/mfd/ucb1x00-core.c | 89 ++++++- drivers/mfd/ucb1x00-ts.c | 2 +- drivers/power/Kconfig | 7 + drivers/power/Makefile | 1 + drivers/power/collie_battery.c | 418 ++++++++++++++++++++++++++++ {drivers => include/linux}/mfd/mcp.h | 3 + {drivers => include/linux}/mfd/ucb1x00.h | 7 +- 15 files changed, 649 insertions(+), 63 deletions(-) create mode 100644 drivers/power/collie_battery.c rename {drivers => include/linux}/mfd/mcp.h (97%) rename {drivers => include/linux}/mfd/ucb1x00.h (98%)_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 8 lines · Thomas Kunze
Hi,
what is the status of this patchset?
The patchset is available via git at:
http://git.linuxtogo.org/?p=thesing/collie.git;a=shortlog;h=refs/heads/for-lakThe branch is based on 2.6.32-rc5. Please tell me if I should rebase on sth. else.
This patchset looks OK to me. I'm willing to see such changes being made to pxa2xx-based zaurus as well.
Russell,
Are you interested to merge this?
Quoted 48 lines
Regards,
ThomasQuoted 33 lines
Hi all!
? This patchset implements prober power management for collie. To archieve this
some bugs were fixed and gpiolib-support was added to the ucb1x00 driver. Please tell me if I should CC some other people or lists.Regards,
ThomasStatistics:
?arch/arm/mach-sa1100/collie.c ? ? ? ? ? ? ?| ? 79 +++++- ?arch/arm/mach-sa1100/include/mach/collie.h | ? 77 +++--- ?arch/arm/mach-sa1100/include/mach/gpio.h ? | ? 19 +- ?arch/arm/mach-sa1100/include/mach/mcp.h ? ?| ? ?1 + ?drivers/leds/leds-locomo.c ? ? ? ? ? ? ? ? | ? ?2 +- ?drivers/mfd/mcp-core.c ? ? ? ? ? ? ? ? ? ? | ? ?2 +- ?drivers/mfd/mcp-sa11x0.c ? ? ? ? ? ? ? ? ? | ? ?3 +- ?drivers/mfd/ucb1x00-assabet.c ? ? ? ? ? ? ?| ? ?2 +- ?drivers/mfd/ucb1x00-core.c ? ? ? ? ? ? ? ? | ? 89 ++++++- ?drivers/mfd/ucb1x00-ts.c ? ? ? ? ? ? ? ? ? | ? ?2 +- ?drivers/power/Kconfig ? ? ? ? ? ? ? ? ? ? ?| ? ?7 + ?drivers/power/Makefile ? ? ? ? ? ? ? ? ? ? | ? ?1 + ?drivers/power/collie_battery.c ? ? ? ? ? ? | ?418++++++++++++++++++++++++++++
?{drivers =>include/linux}/mfd/mcp.h? ? ? | ? ?3 + ?{drivers =>include/linux}/mfd/ucb1x00.h? | ? ?7 +- ?15 files changed, 649 insertions(+), 63 deletions(-) ?create mode 100644drivers/power/collie_battery.c?rename {drivers =>include/linux}/mfd/mcp.h(97%) ?rename {drivers =>include/linux}/mfd/ucb1x00.h(98%)Quoted 5 lines
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Hi,
could somebody tell me how to proceed from here, please? Should I send some ping messages every two weeks or so?
Regards,
Thomas
Hi!
Quoted 2 lines
could somebody tell me how to proceed from here, please? Should I send some ping messages every two weeks or so?
Respin the series, yes. ARM maintainers are often slow :-(. Cc: akpm I'd say. You are fixing old regressions.
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 7 lines · Pavel Machek
Hi!
Quoted 2 lines
could somebody tell me how to proceed from here, please? Should I send some ping messages every two weeks or so?
Respin the series, yes. ARM maintainers are often slow :-(. Cc: akpm I'd say. You are fixing old regressions.
Well, I'm still waiting to hear what the outcome of my sa1100 branch is, and I can't reply to Thomas until that's settled.
Quoted 8 lines · On Sat, 7 Nov 2009 09:28:47 +0100 Pavel Machek <[email protected]> wrote:
Hi!
Quoted 2 lines
could somebody tell me how to proceed from here, please? Should I send some ping messages every two weeks or so?
Respin the series, yes. ARM maintainers are often slow :-(. Cc: akpm I'd say. You are fixing old regressions.
Please add me to CC when you resend patch, missed your first send and like to keep updated on SA1100 changes.
Quoted 10 lines
Pavel
Signature · 7 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel at lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 1 line
Kristoffer Ericson <[email protected]>