Commit 5b3a05ca authored by Cyril Chemparathy's avatar Cyril Chemparathy Committed by Kevin Hilman

Davinci: eliminate pinmux offset verbosity

Pinmux registers are sequential, and do not need to be enumerated out as they
currently are.  This reduces code volume and keeps things simple.

If some future SoC comes up with a discontiguous register map, PINMUX() can
then be expanded with local token pasting.
Signed-off-by: default avatarCyril Chemparathy <cyril@ti.com>
Signed-off-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
parent b27b6d03
...@@ -450,11 +450,6 @@ void __init dm355_init_spi0(unsigned chipselect_mask, ...@@ -450,11 +450,6 @@ void __init dm355_init_spi0(unsigned chipselect_mask,
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
#define PINMUX0 0x00
#define PINMUX1 0x04
#define PINMUX2 0x08
#define PINMUX3 0x0c
#define PINMUX4 0x10
#define INTMUX 0x18 #define INTMUX 0x18
#define EVTMUX 0x1c #define EVTMUX 0x1c
......
...@@ -467,11 +467,6 @@ static struct clk_lookup dm365_clks[] = { ...@@ -467,11 +467,6 @@ static struct clk_lookup dm365_clks[] = {
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
#define PINMUX0 0x00
#define PINMUX1 0x04
#define PINMUX2 0x08
#define PINMUX3 0x0c
#define PINMUX4 0x10
#define INTMUX 0x18 #define INTMUX 0x18
#define EVTMUX 0x1c #define EVTMUX 0x1c
......
...@@ -350,9 +350,6 @@ static struct platform_device dm644x_emac_device = { ...@@ -350,9 +350,6 @@ static struct platform_device dm644x_emac_device = {
.resource = dm644x_emac_resources, .resource = dm644x_emac_resources,
}; };
#define PINMUX0 0x00
#define PINMUX1 0x04
/* /*
* Device specific mux setup * Device specific mux setup
* *
......
...@@ -401,9 +401,6 @@ static struct platform_device dm646x_emac_device = { ...@@ -401,9 +401,6 @@ static struct platform_device dm646x_emac_device = {
.resource = dm646x_emac_resources, .resource = dm646x_emac_resources,
}; };
#define PINMUX0 0x00
#define PINMUX1 0x04
/* /*
* Device specific mux setup * Device specific mux setup
* *
......
...@@ -71,11 +71,7 @@ static int __init davinci_gpio_irq_setup(void); ...@@ -71,11 +71,7 @@ static int __init davinci_gpio_irq_setup(void);
/*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/
/* /* board setup code *MUST* setup pinmux and enable the GPIO clock. */
* board setup code *MUST* set PINMUX0 and PINMUX1 as
* needed, and enable the GPIO clock.
*/
static inline int __davinci_direction(struct gpio_chip *chip, static inline int __davinci_direction(struct gpio_chip *chip,
unsigned offset, bool out, int value) unsigned offset, bool out, int value)
{ {
......
...@@ -64,27 +64,6 @@ extern void __iomem *da8xx_syscfg1_base; ...@@ -64,27 +64,6 @@ extern void __iomem *da8xx_syscfg1_base;
#define DA8XX_DDR2_CTL_BASE 0xb0000000 #define DA8XX_DDR2_CTL_BASE 0xb0000000
#define DA8XX_ARM_RAM_BASE 0xffff0000 #define DA8XX_ARM_RAM_BASE 0xffff0000
#define PINMUX0 0x00
#define PINMUX1 0x04
#define PINMUX2 0x08
#define PINMUX3 0x0c
#define PINMUX4 0x10
#define PINMUX5 0x14
#define PINMUX6 0x18
#define PINMUX7 0x1c
#define PINMUX8 0x20
#define PINMUX9 0x24
#define PINMUX10 0x28
#define PINMUX11 0x2c
#define PINMUX12 0x30
#define PINMUX13 0x34
#define PINMUX14 0x38
#define PINMUX15 0x3c
#define PINMUX16 0x40
#define PINMUX17 0x44
#define PINMUX18 0x48
#define PINMUX19 0x4c
void __init da830_init(void); void __init da830_init(void);
void __init da850_init(void); void __init da850_init(void);
......
...@@ -1174,6 +1174,8 @@ enum davinci_tnetv107x_index { ...@@ -1174,6 +1174,8 @@ enum davinci_tnetv107x_index {
TNETV107X_TDM0_RX, TNETV107X_TDM0_RX,
}; };
#define PINMUX(x) (4 * (x))
#ifdef CONFIG_DAVINCI_MUX #ifdef CONFIG_DAVINCI_MUX
/* setup pin muxing */ /* setup pin muxing */
extern int davinci_cfg_reg(unsigned long reg_cfg); extern int davinci_cfg_reg(unsigned long reg_cfg);
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
.name = #desc, \ .name = #desc, \
.debug = dbg, \ .debug = dbg, \
.mux_reg_name = "PINMUX"#muxreg, \ .mux_reg_name = "PINMUX"#muxreg, \
.mux_reg = PINMUX##muxreg, \ .mux_reg = PINMUX(muxreg), \
.mask_offset = mode_offset, \ .mask_offset = mode_offset, \
.mask = mode_mask, \ .mask = mode_mask, \
.mode = mux_mode, \ .mode = mux_mode, \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment