Commit 5ad27d6c authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'gpio-fixes-for-v3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio

Pull last minute GPIO fixes from Linus Walleij:

 - Disable blinking on the Orion GPIO driver

 - Two Kconfig-style fixes to avoid broken builds

* tag 'gpio-fixes-for-v3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
  gpio-mcp23s08: Build I2C support even when CONFIG_I2C=m
  gpio: adnp: Depend on OF_GPIO instead of OF
  mvebu-gpio: Disable blinking when enabling a GPIO for output
parents d28d3730 cbf24fad
...@@ -466,7 +466,7 @@ config GPIO_ADP5588_IRQ ...@@ -466,7 +466,7 @@ config GPIO_ADP5588_IRQ
config GPIO_ADNP config GPIO_ADNP
tristate "Avionic Design N-bit GPIO expander" tristate "Avionic Design N-bit GPIO expander"
depends on I2C && OF depends on I2C && OF_GPIO
help help
This option enables support for N GPIOs found on Avionic Design This option enables support for N GPIOs found on Avionic Design
I2C GPIO expanders. The register space will be extended by powers I2C GPIO expanders. The register space will be extended by powers
......
...@@ -77,7 +77,7 @@ struct mcp23s08_driver_data { ...@@ -77,7 +77,7 @@ struct mcp23s08_driver_data {
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
#ifdef CONFIG_I2C #if IS_ENABLED(CONFIG_I2C)
static int mcp23008_read(struct mcp23s08 *mcp, unsigned reg) static int mcp23008_read(struct mcp23s08 *mcp, unsigned reg)
{ {
...@@ -399,7 +399,7 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev, ...@@ -399,7 +399,7 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev,
break; break;
#endif /* CONFIG_SPI_MASTER */ #endif /* CONFIG_SPI_MASTER */
#ifdef CONFIG_I2C #if IS_ENABLED(CONFIG_I2C)
case MCP_TYPE_008: case MCP_TYPE_008:
mcp->ops = &mcp23008_ops; mcp->ops = &mcp23008_ops;
mcp->chip.ngpio = 8; mcp->chip.ngpio = 8;
...@@ -473,7 +473,7 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev, ...@@ -473,7 +473,7 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev,
/*----------------------------------------------------------------------*/ /*----------------------------------------------------------------------*/
#ifdef CONFIG_I2C #if IS_ENABLED(CONFIG_I2C)
static int __devinit mcp230xx_probe(struct i2c_client *client, static int __devinit mcp230xx_probe(struct i2c_client *client,
const struct i2c_device_id *id) const struct i2c_device_id *id)
......
...@@ -92,6 +92,11 @@ static inline void __iomem *mvebu_gpioreg_out(struct mvebu_gpio_chip *mvchip) ...@@ -92,6 +92,11 @@ static inline void __iomem *mvebu_gpioreg_out(struct mvebu_gpio_chip *mvchip)
return mvchip->membase + GPIO_OUT_OFF; return mvchip->membase + GPIO_OUT_OFF;
} }
static inline void __iomem *mvebu_gpioreg_blink(struct mvebu_gpio_chip *mvchip)
{
return mvchip->membase + GPIO_BLINK_EN_OFF;
}
static inline void __iomem *mvebu_gpioreg_io_conf(struct mvebu_gpio_chip *mvchip) static inline void __iomem *mvebu_gpioreg_io_conf(struct mvebu_gpio_chip *mvchip)
{ {
return mvchip->membase + GPIO_IO_CONF_OFF; return mvchip->membase + GPIO_IO_CONF_OFF;
...@@ -206,6 +211,23 @@ static int mvebu_gpio_get(struct gpio_chip *chip, unsigned pin) ...@@ -206,6 +211,23 @@ static int mvebu_gpio_get(struct gpio_chip *chip, unsigned pin)
return (u >> pin) & 1; return (u >> pin) & 1;
} }
static void mvebu_gpio_blink(struct gpio_chip *chip, unsigned pin, int value)
{
struct mvebu_gpio_chip *mvchip =
container_of(chip, struct mvebu_gpio_chip, chip);
unsigned long flags;
u32 u;
spin_lock_irqsave(&mvchip->lock, flags);
u = readl_relaxed(mvebu_gpioreg_blink(mvchip));
if (value)
u |= 1 << pin;
else
u &= ~(1 << pin);
writel_relaxed(u, mvebu_gpioreg_blink(mvchip));
spin_unlock_irqrestore(&mvchip->lock, flags);
}
static int mvebu_gpio_direction_input(struct gpio_chip *chip, unsigned pin) static int mvebu_gpio_direction_input(struct gpio_chip *chip, unsigned pin)
{ {
struct mvebu_gpio_chip *mvchip = struct mvebu_gpio_chip *mvchip =
...@@ -244,6 +266,7 @@ static int mvebu_gpio_direction_output(struct gpio_chip *chip, unsigned pin, ...@@ -244,6 +266,7 @@ static int mvebu_gpio_direction_output(struct gpio_chip *chip, unsigned pin,
if (ret) if (ret)
return ret; return ret;
mvebu_gpio_blink(chip, pin, 0);
mvebu_gpio_set(chip, pin, value); mvebu_gpio_set(chip, pin, value);
spin_lock_irqsave(&mvchip->lock, flags); spin_lock_irqsave(&mvchip->lock, flags);
......
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