RE: [PATCH 004/182] gpio: generic: factor into gpio_chip struct
On Wednesday, December 09, 2015 6:13 AM, Linus Walleij wrote: > The separate struct bgpio_chip has been a pain to handle, both > by being confusingly similar in name to struct gpio_chip and > for being contained inside a struct so that struct gpio_chip > is contained in a struct contained in a struct, making several > steps of dereferencing necessary. > > Make things simpler: include the fields directly into > , #ifdef:ed for CONFIG_GENERIC_GPIO, and > get rid of the altogether. Prefix > some of the member variables with bgpio_* and add proper > kerneldoc while we're at it. > > Modify all users to handle the change and use a struct > gpio_chip directly. And while we're at it: replace all > container_of() dereferencing by gpiochip_get_data() and > registering the gpio_chip with gpiochip_add_data(). > > Cc: a...@kernel.org > Cc: Lee Jones <lee.jo...@linaro.org> > Cc: Alexander Shiyan <shc_w...@mail.ru> > Cc: Shawn Guo <shawn...@kernel.org> > Cc: Sascha Hauer <ker...@pengutronix.de> > Cc: Tony Lindgren <t...@atomide.com> > Cc: Kukjin Kim <kg...@kernel.org> > Cc: Krzysztof Kozlowski <k.kozlow...@samsung.com> > Cc: Alexandre Courbot <gnu...@gmail.com> > Cc: Gregory Fong <gregory.0...@gmail.com> > Cc: Brian Norris <computersforpe...@gmail.com> > Cc: Florian Fainelli <f.faine...@gmail.com> > Cc: Liviu Dudau <liviu.du...@arm.com> > Cc: Sudeep Holla <sudeep.ho...@arm.com> > Cc: Lorenzo Pieralisi <lorenzo.pieral...@arm.com> > Cc: Nicolas Pitre <nicolas.pi...@linaro.org> > Cc: Olof Johansson <o...@lixom.net> > Cc: Vladimir Zapolskiy <vladimir_zapols...@mentor.com> > Cc: Rabin Vincent <ra...@rab.in> > Cc: linux-arm-ker...@lists.infradead.org > Cc: linux-omap@vger.kernel.org > Cc: linux-samsung-...@vger.kernel.org > Cc: bcm-kernel-feedback-l...@broadcom.com > Signed-off-by: Linus Walleij <linus.wall...@linaro.org> > --- > ARM SoC folks and Lee: it would be great if you could > ACK the few lines hitting arch/arm/* and drivers/mfd/* in this > so I can take it through the GPIO tree. > --- > drivers/gpio/gpio-ep93xx.c | 25 +-- > diff --git a/drivers/gpio/gpio-ep93xx.c b/drivers/gpio/gpio-ep93xx.c > index 3e3947b35c83..ad279078fed7 100644 > --- a/drivers/gpio/gpio-ep93xx.c > +++ b/drivers/gpio/gpio-ep93xx.c > @@ -16,10 +16,11 @@ > #include > #include > #include > -#include > #include > #include > -#include > +#include > +/* FIXME: this is here for gpio_to_irq() - get rid of this! */ > +#include > > #include > #include > @@ -28,7 +29,7 @@ > > struct ep93xx_gpio { > void __iomem*mmio_base; > - struct bgpio_chip bgc[8]; > + struct gpio_chipgc[8]; > }; > > /* > @@ -319,26 +320,26 @@ static int ep93xx_gpio_to_irq(struct gpio_chip *chip, > unsigned offset) > return 64 + gpio; > } > > -static int ep93xx_gpio_add_bank(struct bgpio_chip *bgc, struct device *dev, > +static int ep93xx_gpio_add_bank(struct gpio_chip *gc, struct device *dev, > void __iomem *mmio_base, struct ep93xx_gpio_bank *bank) > { > void __iomem *data = mmio_base + bank->data; > void __iomem *dir = mmio_base + bank->dir; > int err; > > - err = bgpio_init(bgc, dev, 1, data, NULL, NULL, dir, NULL, 0); > + err = bgpio_init(gc, dev, 1, data, NULL, NULL, dir, NULL, 0); > if (err) > return err; > > - bgc->gc.label = bank->label; > - bgc->gc.base = bank->base; > + gc->label = bank->label; > + gc->base = bank->base; > > if (bank->has_debounce) { > - bgc->gc.set_debounce = ep93xx_gpio_set_debounce; > - bgc->gc.to_irq = ep93xx_gpio_to_irq; > + gc->set_debounce = ep93xx_gpio_set_debounce; > + gc->to_irq = ep93xx_gpio_to_irq; > } > > - return gpiochip_add(>gc); > + return gpiochip_add_data(gc, NULL); > } > > static int ep93xx_gpio_probe(struct platform_device *pdev) > @@ -358,10 +359,10 @@ static int ep93xx_gpio_probe(struct platform_device > *pdev) > return PTR_ERR(ep93xx_gpio->mmio_base); > > for (i = 0; i < ARRAY_SIZE(ep93xx_gpio_banks); i++) { > - struct bgpio_chip *bgc = _gpio->bgc[i]; > + struct gpio_chip *gc = _gpio->gc[i]; > struct ep93xx_gpio_bank *bank = _gpio_banks[i]; > > - if (ep93xx_gpio_add_bank(bgc, >dev, > + if (ep93xx_gpio_add_bank(gc, >dev, >ep93xx_gpio->mmio_base, bank)) > dev_warn(>dev, "Unable to add gpio bank %s\n", > bank->label); For the drivers/gpio/gpio-ep93xx.c part: Acked-by: H Hartley Sweeten <hswee...@visionengravers.com> -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH RESEND] Input: omap-keypad: dynamically handle register offsets
On Tuesday, April 10, 2012 9:24 AM, Dmitry Torokhov wrote: On Tue, Apr 03, 2012 at 10:52:26AM +0530, Sourav Poddar wrote: From: G, Manjunath Kondaiah manj...@ti.com Keypad controller register offsets are different for omap4 and omap5. Handle these offsets through static mapping and assign these mappings during run time. In addition to Felipe's comments. @@ -76,11 +81,66 @@ struct omap4_keypad { unsigned int rows; unsigned int cols; +unsigned int revision; +u32 irqstatus; +u32 irqenable; u32 reg_offset; and you probably won't need revision field. unsigned int row_shift; unsigned char key_state[8]; unsigned short keymap[]; }; +static int kbd_readl(struct omap4_keypad *keypad_data, u32 offset) +{ +if (keypad_data-revision == KBD_REVISION_OMAP4) +return __raw_readl(keypad_data-base + offset); keypad_data-base is an ioremap'ed address. Shouldn't all the __raw_{read,write}l be {read,write}l instead? Regards, Hartley -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 0/5] mtd: plat_nand: Add default partition parser and use it
This patch series adds cmdlinepart as the default partition parser for the plat_nand driver and updates all the arch setup code to use it. Arch setup code that requires other partition parsers can still pass that information as chip.part_probe_types. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com mtd: plat_nand: Add default partition parser to driver arm: Use the plat_nand default partition parser blackfin: Use the plat_nand default partition parser mips: Use the plat_nand default partition parser sh: Use the plat_nand default partition parser arch/arm/mach-ep93xx/snappercl15.c|3 --- arch/arm/mach-ep93xx/ts72xx.c |3 --- arch/arm/mach-ixp4xx/ixdp425-setup.c |3 --- arch/arm/mach-omap1/board-fsample.c |3 --- arch/arm/mach-omap1/board-h2.c|3 --- arch/arm/mach-omap1/board-h3.c|3 --- arch/arm/mach-omap1/board-perseus2.c |3 --- arch/arm/mach-orion5x/ts78xx-setup.c |3 --- arch/arm/mach-pxa/balloon3.c |3 --- arch/arm/mach-pxa/em-x270.c |3 --- arch/arm/mach-pxa/palmtx.c|3 --- arch/blackfin/mach-bf561/boards/acvilon.c |3 --- arch/mips/alchemy/devboards/db1200.c |3 --- arch/mips/alchemy/devboards/db1300.c |3 --- arch/mips/alchemy/devboards/db1550.c |3 --- arch/mips/pnx833x/common/platform.c |6 -- arch/sh/boards/mach-migor/setup.c |1 - drivers/mtd/nand/plat_nand.c |8 ++-- 18 files changed, 6 insertions(+), 54 deletions(-) -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 2/5] arm: Use the plat_nand default partition parser
Use the default partition parser, cmdlinepart, provided by the plat_nand driver. Signed-off-by: H Hartley Sweeten hswee...@visionengravers.com Cc: Ryan Mallon rmal...@gmail.com Cc: Imre Kaloz ka...@openwrt.org Cc: Krzysztof Halasa k...@pm.waw.pl Cc: Tony Lindgren t...@atomide.com Cc: Alexander Clouter a...@digriz.org.uk Cc: Nicolas Pitre n...@fluxnic.net Cc: Eric Miao eric.y.m...@gmail.com Cc: Haojian Zhuang haojian.zhu...@gmail.com Cc: Marek Vasut marek.va...@gmail.com --- diff --git a/arch/arm/mach-ep93xx/snappercl15.c b/arch/arm/mach-ep93xx/snappercl15.c index 0c00852..5df9092 100644 --- a/arch/arm/mach-ep93xx/snappercl15.c +++ b/arch/arm/mach-ep93xx/snappercl15.c @@ -82,8 +82,6 @@ static int snappercl15_nand_dev_ready(struct mtd_info *mtd) return !!(__raw_readw(NAND_CTRL_ADDR(chip)) SNAPPERCL15_NAND_RDY); } -static const char *snappercl15_nand_part_probes[] = {cmdlinepart, NULL}; - static struct mtd_partition snappercl15_nand_parts[] = { { .name = Kernel, @@ -100,7 +98,6 @@ static struct mtd_partition snappercl15_nand_parts[] = { static struct platform_nand_data snappercl15_nand_data = { .chip = { .nr_chips = 1, - .part_probe_types = snappercl15_nand_part_probes, .partitions = snappercl15_nand_parts, .nr_partitions = ARRAY_SIZE(snappercl15_nand_parts), .options= NAND_NO_AUTOINCR, diff --git a/arch/arm/mach-ep93xx/ts72xx.c b/arch/arm/mach-ep93xx/ts72xx.c index 5ea7909..14d7121 100644 --- a/arch/arm/mach-ep93xx/ts72xx.c +++ b/arch/arm/mach-ep93xx/ts72xx.c @@ -105,8 +105,6 @@ static int ts72xx_nand_device_ready(struct mtd_info *mtd) return !!(__raw_readb(addr) 0x20); } -static const char *ts72xx_nand_part_probes[] = { cmdlinepart, NULL }; - #define TS72XX_BOOTROM_PART_SIZE (SZ_16K) #define TS72XX_REDBOOT_PART_SIZE (SZ_2M + SZ_1M) @@ -134,7 +132,6 @@ static struct platform_nand_data ts72xx_nand_data = { .nr_chips = 1, .chip_offset= 0, .chip_delay = 15, - .part_probe_types = ts72xx_nand_part_probes, .partitions = ts72xx_nand_parts, .nr_partitions = ARRAY_SIZE(ts72xx_nand_parts), }, diff --git a/arch/arm/mach-ixp4xx/ixdp425-setup.c b/arch/arm/mach-ixp4xx/ixdp425-setup.c index 3d742ae..fccfc73 100644 --- a/arch/arm/mach-ixp4xx/ixdp425-setup.c +++ b/arch/arm/mach-ixp4xx/ixdp425-setup.c @@ -60,8 +60,6 @@ static struct platform_device ixdp425_flash = { #if defined(CONFIG_MTD_NAND_PLATFORM) || \ defined(CONFIG_MTD_NAND_PLATFORM_MODULE) -const char *part_probes[] = { cmdlinepart, NULL }; - static struct mtd_partition ixdp425_partitions[] = { { .name = ixp400 NAND FS 0, @@ -101,7 +99,6 @@ static struct platform_nand_data ixdp425_flash_nand_data = { .nr_chips = 1, .chip_delay = 30, .options= NAND_NO_AUTOINCR, - .part_probe_types = part_probes, .partitions = ixdp425_partitions, .nr_partitions = ARRAY_SIZE(ixdp425_partitions), }, diff --git a/arch/arm/mach-omap1/board-fsample.c b/arch/arm/mach-omap1/board-fsample.c index 80bd43c..62a1e11 100644 --- a/arch/arm/mach-omap1/board-fsample.c +++ b/arch/arm/mach-omap1/board-fsample.c @@ -206,14 +206,11 @@ static int nand_dev_ready(struct mtd_info *mtd) return gpio_get_value(FSAMPLE_NAND_RB_GPIO_PIN); } -static const char *part_probes[] = { cmdlinepart, NULL }; - static struct platform_nand_data nand_data = { .chip = { .nr_chips = 1, .chip_offset= 0, .options= NAND_SAMSUNG_LP_OPTIONS, - .part_probe_types = part_probes, }, .ctrl = { .cmd_ctrl = nand_cmd_ctl, diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c index c306862..a914a7d 100644 --- a/arch/arm/mach-omap1/board-h2.c +++ b/arch/arm/mach-omap1/board-h2.c @@ -200,8 +200,6 @@ static int h2_nand_dev_ready(struct mtd_info *mtd) return gpio_get_value(H2_NAND_RB_GPIO_PIN); } -static const char *h2_part_probes[] = { cmdlinepart, NULL }; - static struct platform_nand_data h2_nand_platdata = { .chip = { .nr_chips = 1, @@ -209,7 +207,6 @@ static struct platform_nand_data h2_nand_platdata = { .nr_partitions = ARRAY_SIZE(h2_nand_partitions), .partitions = h2_nand_partitions, .options= NAND_SAMSUNG_LP_OPTIONS, - .part_probe_types = h2_part_probes, }, .ctrl = { .cmd_ctrl = h2_nand_cmd_ctl, diff --git
RE: [PATCH 24/31] ARM: amba: ep93xx: use common amba device initializers
On Friday, January 20, 2012 2:31 AM, Russell King wrote: Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- arch/arm/mach-ep93xx/core.c | 46 +- 1 files changed, 6 insertions(+), 40 deletions(-) Acked-by: H Hartley Sweeten hswee...@visionengravers.com -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 18/31] ARM: amba: provide common initializers for static amba devices
On Friday, January 20, 2012 2:29 AM, Russell King wrote: Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- include/linux/amba/bus.h | 33 + 1 files changed, 33 insertions(+), 0 deletions(-) Acked-by: H Hartley Sweeten hswee...@visionengravers.com -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 11/13] ARM: gpio: consolidate trivial gpiolib implementations
On Tuesday, August 09, 2011 1:08 AM, Russell King wrote: Consolidate 24 trivial gpiolib implementions out of mach/gpio.h into asm/gpio.h. This is basically the include of asm-generic/gpio.h and the definition of gpio_get_value, gpio_set_value, and gpio_cansleep as described in Documentation/gpio.txt Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- arch/arm/include/asm/gpio.h | 10 ++ arch/arm/mach-ep93xx/include/mach/gpio.h|7 +-- diff --git a/arch/arm/include/asm/gpio.h b/arch/arm/include/asm/gpio.h index 166a7a3..15e8970 100644 --- a/arch/arm/include/asm/gpio.h +++ b/arch/arm/include/asm/gpio.h @@ -4,4 +4,14 @@ /* not all ARM platforms necessarily support this API ... */ #include mach/gpio.h +#ifdef __ARM_GPIOLIB_TRIVIAL +/* Note: this may rely upon the value of ARCH_NR_GPIOS set in mach/gpio.h */ +#include asm-generic/gpio.h + +/* The trivial gpiolib dispatchers */ +#define gpio_get_value __gpio_get_value +#define gpio_set_value __gpio_set_value +#define gpio_cansleep __gpio_cansleep +#endif + #endif /* _ARCH_ARM_GPIO_H */ diff --git a/arch/arm/mach-ep93xx/include/mach/gpio.h b/arch/arm/mach-ep93xx/include/mach/gpio.h index c57152c..fbc770e 100644 --- a/arch/arm/mach-ep93xx/include/mach/gpio.h +++ b/arch/arm/mach-ep93xx/include/mach/gpio.h @@ -100,12 +100,7 @@ #define EP93XX_GPIO_LINE_MAX_IRQ EP93XX_GPIO_LINE_F(7) /* new generic GPIO API - see Documentation/gpio.txt */ - -#include asm-generic/gpio.h - -#define gpio_get_value __gpio_get_value -#define gpio_set_value __gpio_set_value -#define gpio_cansleep__gpio_cansleep +#define __ARM_GPIOLIB_TRIVIAL /* * Map GPIO A0..A7 (0..7) to irq 64..71, For ep93xx: Acked-by: H Hartley Sweeten hswee...@visionengravers.com Thanks! -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 13/13] ARM: gpio: make trivial GPIOLIB implementation the default
On Tuesday, August 09, 2011 1:09 AM, Russell King wrote: Rather than marking the mach/gpio.h header files which want to use the trivial GPIOLIB implementation, mark those which do not want to use it instead. This means that by default, you get the trivial implementation and only have to do something extra if you need to. This should encourage the use of the trivial default implementation. As an additional bonus, several gpio.h header files become empty. Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk --- arch/arm/include/asm/gpio.h |2 +- arch/arm/include/asm/hardware/iop3xx-gpio.h |2 ++ diff --git a/arch/arm/include/asm/gpio.h b/arch/arm/include/asm/gpio.h index 5032224..11ad0bf 100644 --- a/arch/arm/include/asm/gpio.h +++ b/arch/arm/include/asm/gpio.h @@ -4,7 +4,7 @@ /* not all ARM platforms necessarily support this API ... */ #include mach/gpio.h -#ifdef __ARM_GPIOLIB_TRIVIAL +#ifndef __ARM_GPIOLIB_COMPLEX /* Note: this may rely upon the value of ARCH_NR_GPIOS set in mach/gpio.h */ #include asm-generic/gpio.h diff --git a/arch/arm/mach-ep93xx/include/mach/gpio.h b/arch/arm/mach-ep93xx/include/mach/gpio.h index fbc770e..071f676 100644 --- a/arch/arm/mach-ep93xx/include/mach/gpio.h +++ b/arch/arm/mach-ep93xx/include/mach/gpio.h @@ -99,9 +99,6 @@ /* maximum value for irq capable line identifiers */ #define EP93XX_GPIO_LINE_MAX_IRQ EP93XX_GPIO_LINE_F(7) -/* new generic GPIO API - see Documentation/gpio.txt */ -#define __ARM_GPIOLIB_TRIVIAL - /* * Map GPIO A0..A7 (0..7) to irq 64..71, * B0..B7 (7..15) to irq 72..79, and For ep93xx: Acked-by: H Hartley Sweeten hswee...@visionengravers.com Thanks! -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html