Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d0d665a8 authored by Charulatha V's avatar Charulatha V Committed by Tarun Kanti DebBarma
Browse files

gpio/omap: remove bank->method & METHOD_* macros



The only bank->type (method) used in the OMAP GPIO driver is MPUIO type as they
need to be handled separately. Identify the same using a flag and remove all
METHOD_* macros.

mpuio_init() function is defined under #ifdefs. It is required only in case
of MPUIO bank type and only when PM operations are supported by it.
This is applicable only in case of OMAP16xx SoC's MPUIO GPIO bank type.
For all the other cases it is a dummy function. Hence clean up the same
and remove all the OMAP SoC specific #ifdefs.

Signed-off-by: default avatarCharulatha V <charu@ti.com>
Signed-off-by: default avatarTarun Kanti DebBarma <tarun.kanti@ti.com>
Reviewed-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
Acked-by: default avatarTony Lindgren <tony@atomide.com>
Reviewed-by: default avatarKevin Hilman <khilman@ti.com>
Signed-off-by: default avatarKevin Hilman <khilman@ti.com>
parent d3901eaf
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ static struct omap_gpio_reg_offs omap15xx_mpuio_regs = {

static struct __initdata omap_gpio_platform_data omap15xx_mpu_gpio_config = {
	.virtual_irq_start	= IH_MPUIO_BASE,
	.bank_type		= METHOD_MPUIO,
	.is_mpuio		= true,
	.bank_width		= 16,
	.bank_stride		= 1,
	.regs			= &omap15xx_mpuio_regs,
@@ -90,7 +90,6 @@ static struct omap_gpio_reg_offs omap15xx_gpio_regs = {

static struct __initdata omap_gpio_platform_data omap15xx_gpio_config = {
	.virtual_irq_start	= IH_GPIO_BASE,
	.bank_type		= METHOD_GPIO_1510,
	.bank_width		= 16,
	.regs                   = &omap15xx_gpio_regs,
};
+1 −5
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ static struct omap_gpio_reg_offs omap16xx_mpuio_regs = {

static struct __initdata omap_gpio_platform_data omap16xx_mpu_gpio_config = {
	.virtual_irq_start	= IH_MPUIO_BASE,
	.bank_type		= METHOD_MPUIO,
	.is_mpuio		= true,
	.bank_width		= 16,
	.bank_stride		= 1,
	.regs                   = &omap16xx_mpuio_regs,
@@ -100,7 +100,6 @@ static struct omap_gpio_reg_offs omap16xx_gpio_regs = {

static struct __initdata omap_gpio_platform_data omap16xx_gpio1_config = {
	.virtual_irq_start	= IH_GPIO_BASE,
	.bank_type		= METHOD_GPIO_1610,
	.bank_width		= 16,
	.regs                   = &omap16xx_gpio_regs,
};
@@ -130,7 +129,6 @@ static struct __initdata resource omap16xx_gpio2_resources[] = {

static struct __initdata omap_gpio_platform_data omap16xx_gpio2_config = {
	.virtual_irq_start	= IH_GPIO_BASE + 16,
	.bank_type		= METHOD_GPIO_1610,
	.bank_width		= 16,
	.regs                   = &omap16xx_gpio_regs,
};
@@ -160,7 +158,6 @@ static struct __initdata resource omap16xx_gpio3_resources[] = {

static struct __initdata omap_gpio_platform_data omap16xx_gpio3_config = {
	.virtual_irq_start	= IH_GPIO_BASE + 32,
	.bank_type		= METHOD_GPIO_1610,
	.bank_width		= 16,
	.regs                   = &omap16xx_gpio_regs,
};
@@ -190,7 +187,6 @@ static struct __initdata resource omap16xx_gpio4_resources[] = {

static struct __initdata omap_gpio_platform_data omap16xx_gpio4_config = {
	.virtual_irq_start	= IH_GPIO_BASE + 48,
	.bank_type		= METHOD_GPIO_1610,
	.bank_width		= 16,
	.regs                   = &omap16xx_gpio_regs,
};
+1 −7
Original line number Diff line number Diff line
@@ -52,8 +52,8 @@ static struct omap_gpio_reg_offs omap7xx_mpuio_regs = {

static struct __initdata omap_gpio_platform_data omap7xx_mpu_gpio_config = {
	.virtual_irq_start	= IH_MPUIO_BASE,
	.bank_type		= METHOD_MPUIO,
	.bank_width		= 32,
	.is_mpuio		= true,
	.bank_stride		= 2,
	.regs                   = &omap7xx_mpuio_regs,
};
@@ -94,7 +94,6 @@ static struct omap_gpio_reg_offs omap7xx_gpio_regs = {

static struct __initdata omap_gpio_platform_data omap7xx_gpio1_config = {
	.virtual_irq_start	= IH_GPIO_BASE,
	.bank_type		= METHOD_GPIO_7XX,
	.bank_width		= 32,
	.regs			= &omap7xx_gpio_regs,
};
@@ -124,7 +123,6 @@ static struct __initdata resource omap7xx_gpio2_resources[] = {

static struct __initdata omap_gpio_platform_data omap7xx_gpio2_config = {
	.virtual_irq_start	= IH_GPIO_BASE + 32,
	.bank_type		= METHOD_GPIO_7XX,
	.bank_width		= 32,
	.regs			= &omap7xx_gpio_regs,
};
@@ -154,7 +152,6 @@ static struct __initdata resource omap7xx_gpio3_resources[] = {

static struct __initdata omap_gpio_platform_data omap7xx_gpio3_config = {
	.virtual_irq_start	= IH_GPIO_BASE + 64,
	.bank_type		= METHOD_GPIO_7XX,
	.bank_width		= 32,
	.regs			= &omap7xx_gpio_regs,
};
@@ -184,7 +181,6 @@ static struct __initdata resource omap7xx_gpio4_resources[] = {

static struct __initdata omap_gpio_platform_data omap7xx_gpio4_config = {
	.virtual_irq_start	= IH_GPIO_BASE + 96,
	.bank_type		= METHOD_GPIO_7XX,
	.bank_width		= 32,
	.regs			= &omap7xx_gpio_regs,
};
@@ -214,7 +210,6 @@ static struct __initdata resource omap7xx_gpio5_resources[] = {

static struct __initdata omap_gpio_platform_data omap7xx_gpio5_config = {
	.virtual_irq_start	= IH_GPIO_BASE + 128,
	.bank_type		= METHOD_GPIO_7XX,
	.bank_width		= 32,
	.regs			= &omap7xx_gpio_regs,
};
@@ -244,7 +239,6 @@ static struct __initdata resource omap7xx_gpio6_resources[] = {

static struct __initdata omap_gpio_platform_data omap7xx_gpio6_config = {
	.virtual_irq_start	= IH_GPIO_BASE + 160,
	.bank_type		= METHOD_GPIO_7XX,
	.bank_width		= 32,
	.regs			= &omap7xx_gpio_regs,
};
+0 −2
Original line number Diff line number Diff line
@@ -74,7 +74,6 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
		/* fall through */

	case 1:
		pdata->bank_type = METHOD_GPIO_24XX;
		pdata->regs->revision = OMAP24XX_GPIO_REVISION;
		pdata->regs->direction = OMAP24XX_GPIO_OE;
		pdata->regs->datain = OMAP24XX_GPIO_DATAIN;
@@ -97,7 +96,6 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
		pdata->regs->fallingdetect = OMAP24XX_GPIO_FALLINGDETECT;
		break;
	case 2:
		pdata->bank_type = METHOD_GPIO_44XX;
		pdata->regs->revision = OMAP4_GPIO_REVISION;
		pdata->regs->direction = OMAP4_GPIO_OE;
		pdata->regs->datain = OMAP4_GPIO_DATAIN;
+1 −7
Original line number Diff line number Diff line
@@ -162,13 +162,6 @@
				 IH_MPUIO_BASE + ((nr) & 0x0f) : \
				 IH_GPIO_BASE + (nr))

#define METHOD_MPUIO		0
#define METHOD_GPIO_1510	1
#define METHOD_GPIO_1610	2
#define METHOD_GPIO_7XX		3
#define METHOD_GPIO_24XX	5
#define METHOD_GPIO_44XX	6

struct omap_gpio_dev_attr {
	int bank_width;		/* GPIO bank width */
	bool dbck_flag;		/* dbck required or not - True for OMAP3&4 */
@@ -210,6 +203,7 @@ struct omap_gpio_platform_data {
	int bank_stride;	/* Only needed for omap1 MPUIO */
	bool dbck_flag;		/* dbck required or not - True for OMAP3&4 */
	bool loses_context;	/* whether the bank would ever lose context */
	bool is_mpuio;		/* whether the bank is of type MPUIO */
	u32 non_wakeup_gpios;

	struct omap_gpio_reg_offs *regs;
Loading