Commit 3821d10a authored by Cyril Chemparathy's avatar Cyril Chemparathy Committed by Kevin Hilman

Davinci: promote da8xx_pinmux_setup()

Rename da8xx_pinmux_setup() to davinci_cfg_reg_list() and promote it for use in
other SOCs that may need the ability to configure multiple pins in one shot.
Signed-off-by: default avatarCyril Chemparathy <cyril@ti.com>
Signed-off-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
parent 52958be3
...@@ -157,7 +157,7 @@ static __init void da830_evm_usb_init(void) ...@@ -157,7 +157,7 @@ static __init void da830_evm_usb_init(void)
__func__, ret); __func__, ret);
} }
ret = da8xx_pinmux_setup(da830_evm_usb11_pins); ret = davinci_cfg_reg_list(da830_evm_usb11_pins);
if (ret) { if (ret) {
pr_warning("%s: USB 1.1 PinMux setup failed: %d\n", pr_warning("%s: USB 1.1 PinMux setup failed: %d\n",
__func__, ret); __func__, ret);
...@@ -254,7 +254,7 @@ static inline void da830_evm_init_mmc(void) ...@@ -254,7 +254,7 @@ static inline void da830_evm_init_mmc(void)
{ {
int ret; int ret;
ret = da8xx_pinmux_setup(da830_evm_mmc_sd_pins); ret = davinci_cfg_reg_list(da830_evm_mmc_sd_pins);
if (ret) { if (ret) {
pr_warning("da830_evm_init: mmc/sd mux setup failed: %d\n", pr_warning("da830_evm_init: mmc/sd mux setup failed: %d\n",
ret); ret);
...@@ -407,7 +407,7 @@ static inline void da830_evm_init_nand(int mux_mode) ...@@ -407,7 +407,7 @@ static inline void da830_evm_init_nand(int mux_mode)
return; return;
} }
ret = da8xx_pinmux_setup(da830_evm_emif25_pins); ret = davinci_cfg_reg_list(da830_evm_emif25_pins);
if (ret) if (ret)
pr_warning("da830_evm_init: emif25 mux setup failed: %d\n", pr_warning("da830_evm_init: emif25 mux setup failed: %d\n",
ret); ret);
...@@ -427,7 +427,7 @@ static inline void da830_evm_init_lcdc(int mux_mode) ...@@ -427,7 +427,7 @@ static inline void da830_evm_init_lcdc(int mux_mode)
{ {
int ret; int ret;
ret = da8xx_pinmux_setup(da830_lcdcntl_pins); ret = davinci_cfg_reg_list(da830_lcdcntl_pins);
if (ret) if (ret)
pr_warning("da830_evm_init: lcdcntl mux setup failed: %d\n", pr_warning("da830_evm_init: lcdcntl mux setup failed: %d\n",
ret); ret);
...@@ -507,7 +507,7 @@ static __init void da830_evm_init(void) ...@@ -507,7 +507,7 @@ static __init void da830_evm_init(void)
pr_warning("da830_evm_init: edma registration failed: %d\n", pr_warning("da830_evm_init: edma registration failed: %d\n",
ret); ret);
ret = da8xx_pinmux_setup(da830_i2c0_pins); ret = davinci_cfg_reg_list(da830_i2c0_pins);
if (ret) if (ret)
pr_warning("da830_evm_init: i2c0 mux setup failed: %d\n", pr_warning("da830_evm_init: i2c0 mux setup failed: %d\n",
ret); ret);
...@@ -523,7 +523,7 @@ static __init void da830_evm_init(void) ...@@ -523,7 +523,7 @@ static __init void da830_evm_init(void)
soc_info->emac_pdata->mdio_max_freq = DA830_EVM_MDIO_FREQUENCY; soc_info->emac_pdata->mdio_max_freq = DA830_EVM_MDIO_FREQUENCY;
soc_info->emac_pdata->rmii_en = 1; soc_info->emac_pdata->rmii_en = 1;
ret = da8xx_pinmux_setup(da830_cpgmac_pins); ret = davinci_cfg_reg_list(da830_cpgmac_pins);
if (ret) if (ret)
pr_warning("da830_evm_init: cpgmac mux setup failed: %d\n", pr_warning("da830_evm_init: cpgmac mux setup failed: %d\n",
ret); ret);
...@@ -542,7 +542,7 @@ static __init void da830_evm_init(void) ...@@ -542,7 +542,7 @@ static __init void da830_evm_init(void)
i2c_register_board_info(1, da830_evm_i2c_devices, i2c_register_board_info(1, da830_evm_i2c_devices,
ARRAY_SIZE(da830_evm_i2c_devices)); ARRAY_SIZE(da830_evm_i2c_devices));
ret = da8xx_pinmux_setup(da830_evm_mcasp1_pins); ret = davinci_cfg_reg_list(da830_evm_mcasp1_pins);
if (ret) if (ret)
pr_warning("da830_evm_init: mcasp1 mux setup failed: %d\n", pr_warning("da830_evm_init: mcasp1 mux setup failed: %d\n",
ret); ret);
......
...@@ -206,12 +206,12 @@ static __init void da850_evm_setup_nor_nand(void) ...@@ -206,12 +206,12 @@ static __init void da850_evm_setup_nor_nand(void)
int ret = 0; int ret = 0;
if (ui_card_detected & !HAS_MMC) { if (ui_card_detected & !HAS_MMC) {
ret = da8xx_pinmux_setup(da850_nand_pins); ret = davinci_cfg_reg_list(da850_nand_pins);
if (ret) if (ret)
pr_warning("da850_evm_init: nand mux setup failed: " pr_warning("da850_evm_init: nand mux setup failed: "
"%d\n", ret); "%d\n", ret);
ret = da8xx_pinmux_setup(da850_nor_pins); ret = davinci_cfg_reg_list(da850_nor_pins);
if (ret) if (ret)
pr_warning("da850_evm_init: nor mux setup failed: %d\n", pr_warning("da850_evm_init: nor mux setup failed: %d\n",
ret); ret);
...@@ -568,12 +568,12 @@ static int __init da850_evm_config_emac(void) ...@@ -568,12 +568,12 @@ static int __init da850_evm_config_emac(void)
if (rmii_en) { if (rmii_en) {
val |= BIT(8); val |= BIT(8);
ret = da8xx_pinmux_setup(da850_rmii_pins); ret = davinci_cfg_reg_list(da850_rmii_pins);
pr_info("EMAC: RMII PHY configured, MII PHY will not be" pr_info("EMAC: RMII PHY configured, MII PHY will not be"
" functional\n"); " functional\n");
} else { } else {
val &= ~BIT(8); val &= ~BIT(8);
ret = da8xx_pinmux_setup(da850_cpgmac_pins); ret = davinci_cfg_reg_list(da850_cpgmac_pins);
pr_info("EMAC: MII PHY configured, RMII PHY will not be" pr_info("EMAC: MII PHY configured, RMII PHY will not be"
" functional\n"); " functional\n");
} }
...@@ -626,7 +626,7 @@ static __init void da850_evm_init(void) ...@@ -626,7 +626,7 @@ static __init void da850_evm_init(void)
pr_warning("da850_evm_init: edma registration failed: %d\n", pr_warning("da850_evm_init: edma registration failed: %d\n",
ret); ret);
ret = da8xx_pinmux_setup(da850_i2c0_pins); ret = davinci_cfg_reg_list(da850_i2c0_pins);
if (ret) if (ret)
pr_warning("da850_evm_init: i2c0 mux setup failed: %d\n", pr_warning("da850_evm_init: i2c0 mux setup failed: %d\n",
ret); ret);
...@@ -643,7 +643,7 @@ static __init void da850_evm_init(void) ...@@ -643,7 +643,7 @@ static __init void da850_evm_init(void)
ret); ret);
if (HAS_MMC) { if (HAS_MMC) {
ret = da8xx_pinmux_setup(da850_mmcsd0_pins); ret = davinci_cfg_reg_list(da850_mmcsd0_pins);
if (ret) if (ret)
pr_warning("da850_evm_init: mmcsd0 mux setup failed:" pr_warning("da850_evm_init: mmcsd0 mux setup failed:"
" %d\n", ret); " %d\n", ret);
...@@ -679,20 +679,20 @@ static __init void da850_evm_init(void) ...@@ -679,20 +679,20 @@ static __init void da850_evm_init(void)
__raw_writel(0, IO_ADDRESS(DA8XX_UART1_BASE) + 0x30); __raw_writel(0, IO_ADDRESS(DA8XX_UART1_BASE) + 0x30);
__raw_writel(0, IO_ADDRESS(DA8XX_UART0_BASE) + 0x30); __raw_writel(0, IO_ADDRESS(DA8XX_UART0_BASE) + 0x30);
ret = da8xx_pinmux_setup(da850_mcasp_pins); ret = davinci_cfg_reg_list(da850_mcasp_pins);
if (ret) if (ret)
pr_warning("da850_evm_init: mcasp mux setup failed: %d\n", pr_warning("da850_evm_init: mcasp mux setup failed: %d\n",
ret); ret);
da8xx_register_mcasp(0, &da850_evm_snd_data); da8xx_register_mcasp(0, &da850_evm_snd_data);
ret = da8xx_pinmux_setup(da850_lcdcntl_pins); ret = davinci_cfg_reg_list(da850_lcdcntl_pins);
if (ret) if (ret)
pr_warning("da850_evm_init: lcdcntl mux setup failed: %d\n", pr_warning("da850_evm_init: lcdcntl mux setup failed: %d\n",
ret); ret);
/* Handle board specific muxing for LCD here */ /* Handle board specific muxing for LCD here */
ret = da8xx_pinmux_setup(da850_evm_lcdc_pins); ret = davinci_cfg_reg_list(da850_evm_lcdc_pins);
if (ret) if (ret)
pr_warning("da850_evm_init: evm specific lcd mux setup " pr_warning("da850_evm_init: evm specific lcd mux setup "
"failed: %d\n", ret); "failed: %d\n", ret);
......
...@@ -146,10 +146,4 @@ extern const short da850_mmcsd0_pins[]; ...@@ -146,10 +146,4 @@ extern const short da850_mmcsd0_pins[];
extern const short da850_nand_pins[]; extern const short da850_nand_pins[];
extern const short da850_nor_pins[]; extern const short da850_nor_pins[];
#ifdef CONFIG_DAVINCI_MUX
int da8xx_pinmux_setup(const short pins[]);
#else
static inline int da8xx_pinmux_setup(const short pins[]) { return 0; }
#endif
#endif /* __ASM_ARCH_DAVINCI_DA8XX_H */ #endif /* __ASM_ARCH_DAVINCI_DA8XX_H */
...@@ -907,9 +907,14 @@ enum davinci_da850_index { ...@@ -907,9 +907,14 @@ enum davinci_da850_index {
#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);
extern int davinci_cfg_reg_list(const short pins[]);
#else #else
/* boot loader does it all (no warnings from CONFIG_DAVINCI_MUX_WARNINGS) */ /* boot loader does it all (no warnings from CONFIG_DAVINCI_MUX_WARNINGS) */
static inline int davinci_cfg_reg(unsigned long reg_cfg) { return 0; } static inline int davinci_cfg_reg(unsigned long reg_cfg) { return 0; }
static inline int davinci_cfg_reg_list(const short pins[])
{
return 0;
}
#endif #endif
#endif /* __INC_MACH_MUX_H */ #endif /* __INC_MACH_MUX_H */
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include <mach/mux.h> #include <mach/mux.h>
#include <mach/common.h> #include <mach/common.h>
#include <mach/da8xx.h>
/* /*
* Sets the DAVINCI MUX register based on the table * Sets the DAVINCI MUX register based on the table
...@@ -92,7 +91,7 @@ int __init_or_module davinci_cfg_reg(const unsigned long index) ...@@ -92,7 +91,7 @@ int __init_or_module davinci_cfg_reg(const unsigned long index)
} }
EXPORT_SYMBOL(davinci_cfg_reg); EXPORT_SYMBOL(davinci_cfg_reg);
int da8xx_pinmux_setup(const short pins[]) int __init_or_module davinci_cfg_reg_list(const short pins[])
{ {
int i, error = -EINVAL; int i, error = -EINVAL;
......
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