diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-11-18 13:32:59 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-11-18 13:32:59 -0500 |
commit | 5ad27d6ca5d4278120833f1d3e24acdb57afff0b (patch) | |
tree | 306b23139a8cbc66256a0d0fc4e46e3c00bf0c50 /drivers | |
parent | d28d3730fd377cf275a7ac00457ff5012841ee96 (diff) | |
parent | cbf24fad8e6e97b7cd7dd1099f5b801689dc234a (diff) |
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
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpio/Kconfig | 2 | ||||
-rw-r--r-- | drivers/gpio/gpio-mcp23s08.c | 6 | ||||
-rw-r--r-- | drivers/gpio/gpio-mvebu.c | 23 |
3 files changed, 27 insertions, 4 deletions
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index f11d8e3b4041..47150f5ded04 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig | |||
@@ -466,7 +466,7 @@ config GPIO_ADP5588_IRQ | |||
466 | 466 | ||
467 | config GPIO_ADNP | 467 | config GPIO_ADNP |
468 | tristate "Avionic Design N-bit GPIO expander" | 468 | tristate "Avionic Design N-bit GPIO expander" |
469 | depends on I2C && OF | 469 | depends on I2C && OF_GPIO |
470 | help | 470 | help |
471 | This option enables support for N GPIOs found on Avionic Design | 471 | This option enables support for N GPIOs found on Avionic Design |
472 | I2C GPIO expanders. The register space will be extended by powers | 472 | I2C GPIO expanders. The register space will be extended by powers |
diff --git a/drivers/gpio/gpio-mcp23s08.c b/drivers/gpio/gpio-mcp23s08.c index 0f425189de11..ce1c84760076 100644 --- a/drivers/gpio/gpio-mcp23s08.c +++ b/drivers/gpio/gpio-mcp23s08.c | |||
@@ -77,7 +77,7 @@ struct mcp23s08_driver_data { | |||
77 | 77 | ||
78 | /*----------------------------------------------------------------------*/ | 78 | /*----------------------------------------------------------------------*/ |
79 | 79 | ||
80 | #ifdef CONFIG_I2C | 80 | #if IS_ENABLED(CONFIG_I2C) |
81 | 81 | ||
82 | static int mcp23008_read(struct mcp23s08 *mcp, unsigned reg) | 82 | static int mcp23008_read(struct mcp23s08 *mcp, unsigned reg) |
83 | { | 83 | { |
@@ -399,7 +399,7 @@ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev, | |||
399 | break; | 399 | break; |
400 | #endif /* CONFIG_SPI_MASTER */ | 400 | #endif /* CONFIG_SPI_MASTER */ |
401 | 401 | ||
402 | #ifdef CONFIG_I2C | 402 | #if IS_ENABLED(CONFIG_I2C) |
403 | case MCP_TYPE_008: | 403 | case MCP_TYPE_008: |
404 | mcp->ops = &mcp23008_ops; | 404 | mcp->ops = &mcp23008_ops; |
405 | mcp->chip.ngpio = 8; | 405 | mcp->chip.ngpio = 8; |
@@ -473,7 +473,7 @@ fail: | |||
473 | 473 | ||
474 | /*----------------------------------------------------------------------*/ | 474 | /*----------------------------------------------------------------------*/ |
475 | 475 | ||
476 | #ifdef CONFIG_I2C | 476 | #if IS_ENABLED(CONFIG_I2C) |
477 | 477 | ||
478 | static int __devinit mcp230xx_probe(struct i2c_client *client, | 478 | static int __devinit mcp230xx_probe(struct i2c_client *client, |
479 | const struct i2c_device_id *id) | 479 | const struct i2c_device_id *id) |
diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c index cf7afb9eb61a..be65c0451ad5 100644 --- a/drivers/gpio/gpio-mvebu.c +++ b/drivers/gpio/gpio-mvebu.c | |||
@@ -92,6 +92,11 @@ static inline void __iomem *mvebu_gpioreg_out(struct mvebu_gpio_chip *mvchip) | |||
92 | return mvchip->membase + GPIO_OUT_OFF; | 92 | return mvchip->membase + GPIO_OUT_OFF; |
93 | } | 93 | } |
94 | 94 | ||
95 | static inline void __iomem *mvebu_gpioreg_blink(struct mvebu_gpio_chip *mvchip) | ||
96 | { | ||
97 | return mvchip->membase + GPIO_BLINK_EN_OFF; | ||
98 | } | ||
99 | |||
95 | static inline void __iomem *mvebu_gpioreg_io_conf(struct mvebu_gpio_chip *mvchip) | 100 | static inline void __iomem *mvebu_gpioreg_io_conf(struct mvebu_gpio_chip *mvchip) |
96 | { | 101 | { |
97 | return mvchip->membase + GPIO_IO_CONF_OFF; | 102 | return mvchip->membase + GPIO_IO_CONF_OFF; |
@@ -206,6 +211,23 @@ static int mvebu_gpio_get(struct gpio_chip *chip, unsigned pin) | |||
206 | return (u >> pin) & 1; | 211 | return (u >> pin) & 1; |
207 | } | 212 | } |
208 | 213 | ||
214 | static void mvebu_gpio_blink(struct gpio_chip *chip, unsigned pin, int value) | ||
215 | { | ||
216 | struct mvebu_gpio_chip *mvchip = | ||
217 | container_of(chip, struct mvebu_gpio_chip, chip); | ||
218 | unsigned long flags; | ||
219 | u32 u; | ||
220 | |||
221 | spin_lock_irqsave(&mvchip->lock, flags); | ||
222 | u = readl_relaxed(mvebu_gpioreg_blink(mvchip)); | ||
223 | if (value) | ||
224 | u |= 1 << pin; | ||
225 | else | ||
226 | u &= ~(1 << pin); | ||
227 | writel_relaxed(u, mvebu_gpioreg_blink(mvchip)); | ||
228 | spin_unlock_irqrestore(&mvchip->lock, flags); | ||
229 | } | ||
230 | |||
209 | static int mvebu_gpio_direction_input(struct gpio_chip *chip, unsigned pin) | 231 | static int mvebu_gpio_direction_input(struct gpio_chip *chip, unsigned pin) |
210 | { | 232 | { |
211 | struct mvebu_gpio_chip *mvchip = | 233 | struct mvebu_gpio_chip *mvchip = |
@@ -244,6 +266,7 @@ static int mvebu_gpio_direction_output(struct gpio_chip *chip, unsigned pin, | |||
244 | if (ret) | 266 | if (ret) |
245 | return ret; | 267 | return ret; |
246 | 268 | ||
269 | mvebu_gpio_blink(chip, pin, 0); | ||
247 | mvebu_gpio_set(chip, pin, value); | 270 | mvebu_gpio_set(chip, pin, value); |
248 | 271 | ||
249 | spin_lock_irqsave(&mvchip->lock, flags); | 272 | spin_lock_irqsave(&mvchip->lock, flags); |