Commit 3a8067f7 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Simon Horman

ARM: shmobile: mackerel: Use pinconf API to configure pin pull-down

The USB0 and USB1 VBUS pins must be pulled down. Add corresponding
configuration entries in the pinctrl map table instead of manually
poking the pin control registers.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: default avatarSimon Horman <horms+renesas@verge.net.au>
parent 24cf82f4
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include <linux/mtd/physmap.h> #include <linux/mtd/physmap.h>
#include <linux/mtd/sh_flctl.h> #include <linux/mtd/sh_flctl.h>
#include <linux/pinctrl/machine.h> #include <linux/pinctrl/machine.h>
#include <linux/pinctrl/pinconf-generic.h>
#include <linux/platform_data/gpio_backlight.h> #include <linux/platform_data/gpio_backlight.h>
#include <linux/pm_clock.h> #include <linux/pm_clock.h>
#include <linux/regulator/fixed.h> #include <linux/regulator/fixed.h>
...@@ -1311,6 +1312,10 @@ static struct i2c_board_info i2c1_devices[] = { ...@@ -1311,6 +1312,10 @@ static struct i2c_board_info i2c1_devices[] = {
}, },
}; };
static unsigned long pin_pulldown_conf[] = {
PIN_CONF_PACKED(PIN_CONFIG_BIAS_PULL_DOWN, 0),
};
static const struct pinctrl_map mackerel_pinctrl_map[] = { static const struct pinctrl_map mackerel_pinctrl_map[] = {
/* ADXL34X */ /* ADXL34X */
PIN_MAP_MUX_GROUP_DEFAULT("1-0053", "pfc-sh7372", PIN_MAP_MUX_GROUP_DEFAULT("1-0053", "pfc-sh7372",
...@@ -1396,17 +1401,19 @@ static const struct pinctrl_map mackerel_pinctrl_map[] = { ...@@ -1396,17 +1401,19 @@ static const struct pinctrl_map mackerel_pinctrl_map[] = {
/* USBHS0 */ /* USBHS0 */
PIN_MAP_MUX_GROUP_DEFAULT("renesas_usbhs.0", "pfc-sh7372", PIN_MAP_MUX_GROUP_DEFAULT("renesas_usbhs.0", "pfc-sh7372",
"usb0_vbus", "usb0"), "usb0_vbus", "usb0"),
PIN_MAP_CONFIGS_GROUP_DEFAULT("renesas_usbhs.0", "pfc-sh7372",
"usb0_vbus", pin_pulldown_conf),
/* USBHS1 */ /* USBHS1 */
PIN_MAP_MUX_GROUP_DEFAULT("renesas_usbhs.1", "pfc-sh7372", PIN_MAP_MUX_GROUP_DEFAULT("renesas_usbhs.1", "pfc-sh7372",
"usb1_vbus", "usb1"), "usb1_vbus", "usb1"),
PIN_MAP_CONFIGS_GROUP_DEFAULT("renesas_usbhs.&", "pfc-sh7372",
"usb1_vbus", pin_pulldown_conf),
PIN_MAP_MUX_GROUP_DEFAULT("renesas_usbhs.1", "pfc-sh7372", PIN_MAP_MUX_GROUP_DEFAULT("renesas_usbhs.1", "pfc-sh7372",
"usb1_otg_id_0", "usb1"), "usb1_otg_id_0", "usb1"),
}; };
#define GPIO_PORT9CR IOMEM(0xE6051009) #define GPIO_PORT9CR IOMEM(0xE6051009)
#define GPIO_PORT10CR IOMEM(0xE605100A) #define GPIO_PORT10CR IOMEM(0xE605100A)
#define GPIO_PORT167CR IOMEM(0xE60520A7)
#define GPIO_PORT168CR IOMEM(0xE60520A8)
#define SRCR4 IOMEM(0xe61580bc) #define SRCR4 IOMEM(0xe61580bc)
#define USCCR1 IOMEM(0xE6058144) #define USCCR1 IOMEM(0xE6058144)
static void __init mackerel_init(void) static void __init mackerel_init(void)
...@@ -1446,12 +1453,6 @@ static void __init mackerel_init(void) ...@@ -1446,12 +1453,6 @@ static void __init mackerel_init(void)
gpio_request_one(151, GPIOF_OUT_INIT_HIGH, NULL); /* LCDDON */ gpio_request_one(151, GPIOF_OUT_INIT_HIGH, NULL); /* LCDDON */
/* USBHS0 */
gpio_request_pulldown(GPIO_PORT168CR); /* VBUS0_0 pull down */
/* USBHS1 */
gpio_request_pulldown(GPIO_PORT167CR); /* VBUS0_1 pull down */
/* FSI2 port A (ak4643) */ /* FSI2 port A (ak4643) */
gpio_request_one(161, GPIOF_OUT_INIT_LOW, NULL); /* slave */ gpio_request_one(161, GPIOF_OUT_INIT_LOW, NULL); /* slave */
......
...@@ -26,23 +26,4 @@ static inline void __init gpio_direction_none(void __iomem * addr) ...@@ -26,23 +26,4 @@ static inline void __init gpio_direction_none(void __iomem * addr)
__raw_writeb(0x00, addr); __raw_writeb(0x00, addr);
} }
static inline void __init gpio_request_pullup(void __iomem * addr)
{
u8 data = __raw_readb(addr);
data &= 0x0F;
data |= 0xC0;
__raw_writeb(data, addr);
}
static inline void __init gpio_request_pulldown(void __iomem * addr)
{
u8 data = __raw_readb(addr);
data &= 0x0F;
data |= 0xA0;
__raw_writeb(data, addr);
}
#endif /* __ASM_ARCH_GPIO_H */ #endif /* __ASM_ARCH_GPIO_H */
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