projects/linux·commit 2dfea380

Merge tag 'mfd-3.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6

2dfea380 · Linus Torvalds <[email protected]> · 2012-12-16 18:55:20 -08:00

Pull MFS update from Samuel Ortiz:
 "This is the MFD patch set for the 3.8 merge window.

  We have several new drivers, most of the time coming with their sub
  devices drivers:

   - Austria Microsystem's AS3711
   - Nano River's viperboard
   - TI's TPS80031, AM335x TS/ADC,
   - Realtek's MMC/memstick card reader
   - Nokia's retu

  We also got some notable cleanups and improvements:

   - tps6586x got converted to IRQ domains.
   - tps65910 and tps65090 moved to the regmap IRQ API.
   - STMPE is now Device Tree aware.
   - A general twl6040 and twl-core cleanup, with moves to the regmap
     I/O and IRQ APIs and a conversion to the recently added PWM
     framework.
   - sta2x11 gained regmap support.

  Then the rest is mostly tiny cleanups and fixes, among which we have
  Mark's wm5xxx and wm8xxx patchset."

Far amount of annoying but largely trivial conflicts.  Many due to
__devinit/exit removal, others due to one or two of the new drivers also
having come in through another tree.

* tag 'mfd-3.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (119 commits)
  mfd: tps6507x: Convert to devm_kzalloc
  mfd: stmpe: Update DT support for stmpe driver
  mfd: wm5102: Add readback of DSP status 3 register
  mfd: arizona: Log if we fail to create the primary IRQ domain
  mfd: tps80031: MFD_TPS80031 needs to select REGMAP_IRQ
  mfd: tps80031: Add terminating entry for tps80031_id_table
  mfd: sta2x11: Fix potential NULL pointer dereference in __sta2x11_mfd_mask()
  mfd: wm5102: Add tuning for revision B
  mfd: arizona: Defer patch initialistation until after first device boot
  mfd: tps65910: Fix wrong ack_base register
  mfd: tps65910: Remove unused data
  mfd: stmpe: Get rid of irq_invert_polarity
  mfd: ab8500-core: Fix invalid free of devm_ allocated data
  mfd: wm5102: Mark DSP memory regions as volatile
  mfd: wm5102: Correct default for LDO1_CONTROL_2
  mfd: arizona: Register haptics devices
  mfd: wm8994: Make current device behaviour the default
  mfd: tps65090: MFD_TPS65090 needs to select REGMAP_IRQ
  mfd: Fix stmpe.c build when OF is not enabled
  mfd: jz4740-adc: Use devm_kzalloc
  ...
Commit
2dfea3803dcf70983d14ce1dcbb3e97a7459a28b
Parents
aed606e3 · 1881b68b

Merge commit. Changes below are compared with the first parent: aed606e3.

Changes

86 files changed · +6766 −2441

FileStatusAddDelContent
Documentation/devicetree/bindings/mfd/stmpe.txtadded+28−0View file
Documentation/devicetree/bindings/regulator/tps65217.txtmodified+4−0View file
drivers/gpio/Kconfigmodified+13−0View file
drivers/gpio/Makefilemodified+1−0View file
drivers/gpio/gpio-da9052.cmodified+5−1View file
drivers/gpio/gpio-tps6586x.cmodified+9−0View file
drivers/gpio/gpio-twl4030.cmodified+6−6View file
drivers/gpio/gpio-viperboard.cadded+517−0View file
drivers/i2c/busses/Kconfigmodified+10−0View file
drivers/i2c/busses/Makefilemodified+1−0View file
drivers/i2c/busses/i2c-viperboard.cadded+480−0View file
drivers/iio/adc/Kconfigmodified+14−0View file
drivers/iio/adc/Makefilemodified+2−1View file
drivers/iio/adc/ti_am335x_adc.cadded+260−0View file
drivers/iio/adc/viperboard_adc.cadded+181−0View file
drivers/input/misc/da9052_onkey.cmodified+5−17View file
drivers/input/touchscreen/Kconfigmodified+3−3View file
drivers/input/touchscreen/Makefilemodified+1−1View file
drivers/input/touchscreen/da9052_tsi.cmodified+20−39View file
drivers/input/touchscreen/ti_am335x_tsc.cadded+398−0View file
drivers/input/touchscreen/ti_tscadc.cdeleted+0−486View before deletion
drivers/mfd/Kconfigmodified+61−2View file
drivers/mfd/Makefilemodified+8−2View file
drivers/mfd/ab8500-core.cmodified+28−79View file
drivers/mfd/arizona-core.cmodified+12−5View file
drivers/mfd/arizona-irq.cmodified+1−0View file
drivers/mfd/as3711.cadded+217−0View file
drivers/mfd/da9052-core.cmodified+11−262View file
drivers/mfd/da9052-irq.cadded+288−0View file
drivers/mfd/db8500-prcmu.cmodified+6−2View file
drivers/mfd/jz4740-adc.cmodified+6−14View file
drivers/mfd/lpc_ich.cmodified+10−6View file
drivers/mfd/mc13xxx-core.cmodified+46−48View file
drivers/mfd/mc13xxx-i2c.cmodified+16−6View file
drivers/mfd/mc13xxx-spi.cmodified+16−13View file
drivers/mfd/mc13xxx.hmodified+12−6View file
drivers/mfd/mfd-core.cmodified+13−2View file
drivers/mfd/rc5t583-irq.cmodified+1−1View file
drivers/mfd/retu-mfd.cadded+264−0View file
drivers/mfd/rtsx_pcr.cmodified+1−0View file
drivers/mfd/sec-irq.cmodified+51−51View file
drivers/mfd/sta2x11-mfd.cmodified+380−156View file
drivers/mfd/stmpe-i2c.cmodified+5−3View file
drivers/mfd/stmpe.cmodified+121−85View file
drivers/mfd/ti_am335x_tscadc.cadded+274−0View file
drivers/mfd/tps6507x.cmodified+4−17View file
drivers/mfd/tps65090.cmodified+104−208View file
drivers/mfd/tps65217.cmodified+12−0View file
drivers/mfd/tps6586x.cmodified+77−26View file
drivers/mfd/tps65910-irq.cdeleted+0−260View before deletion
drivers/mfd/tps65910.cmodified+225−9View file
drivers/mfd/tps80031.cadded+574−0View file
drivers/mfd/twl-core.cmodified+118−109View file
drivers/mfd/twl4030-irq.cmodified+5−5View file
drivers/mfd/twl4030-madc.cmodified+7−7View file
drivers/mfd/twl4030-power.cmodified+51−73View file
drivers/mfd/twl6030-irq.cmodified+2−2View file
drivers/mfd/twl6040-irq.cdeleted+0−205View before deletion
drivers/mfd/twl6040-core.c → drivers/mfd/twl6040.crenamed+84−54View file
drivers/mfd/viperboard.cadded+137−0View file
drivers/mfd/wm5102-tables.cmodified+32−3View file
drivers/mfd/wm8994-core.cmodified+4−13View file
drivers/mmc/host/Makefilemodified+2−0View file
drivers/mmc/host/rtsx_pci_sdmmc.cmodified+2−2View file
drivers/power/da9052-battery.cmodified+25−19View file
drivers/rtc/rtc-twl.cmodified+16−16View file
include/linux/i2c/twl.hmodified+36−37View file
include/linux/input/ti_tscadc.h → include/linux/input/ti_am335x_tsc.hrenamed+8−2View file
include/linux/mfd/arizona/registers.hmodified+1−0View file
include/linux/mfd/as3711.hadded+126−0View file
include/linux/mfd/da9052/da9052.hmodified+10−0View file
include/linux/mfd/da9055/core.hmodified+1−1View file
include/linux/mfd/da9055/pdata.hmodified+1−1View file
include/linux/mfd/da9055/reg.hmodified+1−1View file
include/linux/mfd/rc5t583.hmodified+2−1View file
include/linux/mfd/retu.hadded+22−0View file
include/linux/mfd/sta2x11-mfd.hmodified+196−2View file
include/linux/mfd/stmpe.hmodified+2−2View file
include/linux/mfd/ti_am335x_tscadc.hadded+152−0View file
include/linux/mfd/tps65090.hmodified+55−18View file
include/linux/mfd/tps6586x.hmodified+1−0View file
include/linux/mfd/tps65910.hmodified+99−46View file
include/linux/mfd/tps80031.hadded+637−0View file
include/linux/mfd/twl6040.hmodified+5−5View file
include/linux/mfd/viperboard.hadded+110−0View file
include/linux/platform_data/ti_am335x_adc.hadded+14−0View file

Only the first 600 diff lines are shown. Download the complete patch.

Documentation/devicetree/bindings/mfd/stmpe.txt

View file
diff --git a/Documentation/devicetree/bindings/mfd/stmpe.txt b/Documentation/devicetree/bindings/mfd/stmpe.txt
new file mode 100644
index 0000000..56edb55
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/stmpe.txt
@@ -0,0 +1,28 @@
+* ST Microelectronics STMPE Multi-Functional Device
+
+STMPE is an MFD device which may expose the following inbuilt devices: gpio,
+keypad, touchscreen, adc, pwm, rotator.
+
+Required properties:
+ - compatible : "st,stmpe[610|801|811|1601|2401|2403]"
+ - reg : I2C/SPI address of the device
+
+Optional properties:
+ - interrupts : The interrupt outputs from the controller
+ - interrupt-controller : Marks the device node as an interrupt controller
+ - interrupt-parent : Specifies which IRQ controller we're connected to
+ - wakeup-source : Marks the input device as wakable
+ - st,autosleep-timeout : Valid entries (ms); 4, 16, 32, 64, 128, 256, 512 and 1024
+
+Example:
+
+ stmpe1601: stmpe1601@40 {
+ compatible = "st,stmpe1601";
+ reg = <0x40>;
+ interrupts = <26 0x4>;
+ interrupt-parent = <&gpio6>;
+ interrupt-controller;
+
+ wakeup-source;
+ st,autosleep-timeout = <1024>;
+ };

Documentation/devicetree/bindings/regulator/tps65217.txt

View file
diff --git a/Documentation/devicetree/bindings/regulator/tps65217.txt b/Documentation/devicetree/bindings/regulator/tps65217.txt
index d316fb8..4f05d20 100644
--- a/Documentation/devicetree/bindings/regulator/tps65217.txt
+++ b/Documentation/devicetree/bindings/regulator/tps65217.txt
@@ -11,6 +11,9 @@ Required properties:
using the standard binding for regulators found at
Documentation/devicetree/bindings/regulator/regulator.txt.
+Optional properties:
+- ti,pmic-shutdown-controller: Telling the PMIC to shutdown on PWR_EN toggle.
+
The valid names for regulators are:
tps65217: dcdc1, dcdc2, dcdc3, ldo1, ldo2, ldo3 and ldo4
@@ -20,6 +23,7 @@ Example:
tps: tps@24 {
compatible = "ti,tps65217";
+ ti,pmic-shutdown-controller;
regulators {
dcdc1_reg: dcdc1 {

drivers/gpio/Kconfig

View file
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index bf892bd..8ae1f5b 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -683,4 +683,17 @@ config GPIO_MSIC
Enable support for GPIO on intel MSIC controllers found in
intel MID devices
+comment "USB GPIO expanders:"
+
+config GPIO_VIPERBOARD
+ tristate "Viperboard GPIO a & b support"
+ depends on MFD_VIPERBOARD && USB
+ help
+ Say yes here to access the GPIO signals of Nano River
+ Technologies Viperboard. There are two GPIO chips on the
+ board: gpioa and gpiob.
+ See viperboard API specification and Nano
+ River Tech's viperboard.h for detailed meaning
+ of the module parameters.
+
endif

drivers/gpio/Makefile

View file
diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
index 76b3446..c5aebd0 100644
--- a/drivers/gpio/Makefile
+++ b/drivers/gpio/Makefile
@@ -76,6 +76,7 @@ obj-$(CONFIG_GPIO_TS5500) += gpio-ts5500.o
obj-$(CONFIG_GPIO_TWL4030) += gpio-twl4030.o
obj-$(CONFIG_GPIO_TWL6040) += gpio-twl6040.o
obj-$(CONFIG_GPIO_UCB1400) += gpio-ucb1400.o
+obj-$(CONFIG_GPIO_VIPERBOARD) += gpio-viperboard.o
obj-$(CONFIG_GPIO_VR41XX) += gpio-vr41xx.o
obj-$(CONFIG_GPIO_VT8500) += gpio-vt8500.o
obj-$(CONFIG_GPIO_VX855) += gpio-vx855.o

drivers/gpio/gpio-da9052.c

View file
diff --git a/drivers/gpio/gpio-da9052.c b/drivers/gpio/gpio-da9052.c
index a05aacd..29b11e9 100644
--- a/drivers/gpio/gpio-da9052.c
+++ b/drivers/gpio/gpio-da9052.c
@@ -185,7 +185,11 @@ static int da9052_gpio_to_irq(struct gpio_chip *gc, u32 offset)
struct da9052_gpio *gpio = to_da9052_gpio(gc);
struct da9052 *da9052 = gpio->da9052;
- return da9052->irq_base + DA9052_IRQ_GPI0 + offset;
+ int irq;
+
+ irq = regmap_irq_get_virq(da9052->irq_data, DA9052_IRQ_GPI0 + offset);
+
+ return irq;
}
static struct gpio_chip reference_gp = {

drivers/gpio/gpio-tps6586x.c

View file
diff --git a/drivers/gpio/gpio-tps6586x.c b/drivers/gpio/gpio-tps6586x.c
index c1b82da..29e8e75 100644
--- a/drivers/gpio/gpio-tps6586x.c
+++ b/drivers/gpio/gpio-tps6586x.c
@@ -80,6 +80,14 @@ static int tps6586x_gpio_output(struct gpio_chip *gc, unsigned offset,
val, mask);
}
+static int tps6586x_gpio_to_irq(struct gpio_chip *gc, unsigned offset)
+{
+ struct tps6586x_gpio *tps6586x_gpio = to_tps6586x_gpio(gc);
+
+ return tps6586x_irq_get_virq(tps6586x_gpio->parent,
+ TPS6586X_INT_PLDO_0 + offset);
+}
+
static int tps6586x_gpio_probe(struct platform_device *pdev)
{
struct tps6586x_platform_data *pdata;
@@ -106,6 +114,7 @@ static int tps6586x_gpio_probe(struct platform_device *pdev)
tps6586x_gpio->gpio_chip.direction_output = tps6586x_gpio_output;
tps6586x_gpio->gpio_chip.set = tps6586x_gpio_set;
tps6586x_gpio->gpio_chip.get = tps6586x_gpio_get;
+ tps6586x_gpio->gpio_chip.to_irq = tps6586x_gpio_to_irq;
#ifdef CONFIG_OF_GPIO
tps6586x_gpio->gpio_chip.of_node = pdev->dev.parent->of_node;

drivers/gpio/gpio-twl4030.c

View file
diff --git a/drivers/gpio/gpio-twl4030.c b/drivers/gpio/gpio-twl4030.c
index 00329f2..9572aa1 100644
--- a/drivers/gpio/gpio-twl4030.c
+++ b/drivers/gpio/gpio-twl4030.c
@@ -355,13 +355,13 @@ static struct gpio_chip twl_gpiochip = {
static int gpio_twl4030_pulls(u32 ups, u32 downs)
{
- u8 message[6];
+ u8 message[5];
unsigned i, gpio_bit;
/* For most pins, a pulldown was enabled by default.
* We should have data that's specific to this board.
*/
- for (gpio_bit = 1, i = 1; i < 6; i++) {
+ for (gpio_bit = 1, i = 0; i < 5; i++) {
u8 bit_mask;
unsigned j;
@@ -380,16 +380,16 @@ static int gpio_twl4030_pulls(u32 ups, u32 downs)
static int gpio_twl4030_debounce(u32 debounce, u8 mmc_cd)
{
- u8 message[4];
+ u8 message[3];
/* 30 msec of debouncing is always used for MMC card detect,
* and is optional for everything else.
*/
- message[1] = (debounce & 0xff) | (mmc_cd & 0x03);
+ message[0] = (debounce & 0xff) | (mmc_cd & 0x03);
debounce >>= 8;
- message[2] = (debounce & 0xff);
+ message[1] = (debounce & 0xff);
debounce >>= 8;
- message[3] = (debounce & 0x03);
+ message[2] = (debounce & 0x03);
return twl_i2c_write(TWL4030_MODULE_GPIO, message,
REG_GPIO_DEBEN1, 3);

drivers/gpio/gpio-viperboard.c

View file
diff --git a/drivers/gpio/gpio-viperboard.c b/drivers/gpio/gpio-viperboard.c
new file mode 100644
index 0000000..1377299
--- /dev/null
+++ b/drivers/gpio/gpio-viperboard.c
@@ -0,0 +1,517 @@
+/*
+ * Nano River Technologies viperboard GPIO lib driver
+ *
+ * (C) 2012 by Lemonage GmbH
+ * Author: Lars Poeschel <[email protected]>
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ */
+
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/module.h>
+#include <linux/slab.h>
+#include <linux/types.h>
+#include <linux/mutex.h>
+#include <linux/platform_device.h>
+
+#include <linux/usb.h>
+#include <linux/gpio.h>
+
+#include <linux/mfd/viperboard.h>
+
+#define VPRBRD_GPIOA_CLK_1MHZ 0
+#define VPRBRD_GPIOA_CLK_100KHZ 1
+#define VPRBRD_GPIOA_CLK_10KHZ 2
+#define VPRBRD_GPIOA_CLK_1KHZ 3
+#define VPRBRD_GPIOA_CLK_100HZ 4
+#define VPRBRD_GPIOA_CLK_10HZ 5
+
+#define VPRBRD_GPIOA_FREQ_DEFAULT 1000
+
+#define VPRBRD_GPIOA_CMD_CONT 0x00
+#define VPRBRD_GPIOA_CMD_PULSE 0x01
+#define VPRBRD_GPIOA_CMD_PWM 0x02
+#define VPRBRD_GPIOA_CMD_SETOUT 0x03
+#define VPRBRD_GPIOA_CMD_SETIN 0x04
+#define VPRBRD_GPIOA_CMD_SETINT 0x05
+#define VPRBRD_GPIOA_CMD_GETIN 0x06
+
+#define VPRBRD_GPIOB_CMD_SETDIR 0x00
+#define VPRBRD_GPIOB_CMD_SETVAL 0x01
+
+struct vprbrd_gpioa_msg {
+ u8 cmd;
+ u8 clk;
+ u8 offset;
+ u8 t1;
+ u8 t2;
+ u8 invert;
+ u8 pwmlevel;
+ u8 outval;
+ u8 risefall;
+ u8 answer;
+ u8 __fill;
+} __packed;
+
+struct vprbrd_gpiob_msg {
+ u8 cmd;
+ u16 val;
+ u16 mask;
+} __packed;
+
+struct vprbrd_gpio {
+ struct gpio_chip gpioa; /* gpio a related things */
+ u32 gpioa_out;
+ u32 gpioa_val;
+ struct gpio_chip gpiob; /* gpio b related things */
+ u32 gpiob_out;
+ u32 gpiob_val;
+ struct vprbrd *vb;
+};
+
+/* gpioa sampling clock module parameter */
+static unsigned char gpioa_clk;
+static unsigned int gpioa_freq = VPRBRD_GPIOA_FREQ_DEFAULT;
+module_param(gpioa_freq, uint, 0);
+MODULE_PARM_DESC(gpioa_freq,
+ "gpio-a sampling freq in Hz (default is 1000Hz) valid values: 10, 100, 1000, 10000, 100000, 1000000");
+
+/* ----- begin of gipo a chip -------------------------------------------- */
+
+static int vprbrd_gpioa_get(struct gpio_chip *chip,
+ unsigned offset)
+{
+ int ret, answer, error = 0;
+ struct vprbrd_gpio *gpio =
+ container_of(chip, struct vprbrd_gpio, gpioa);
+ struct vprbrd *vb = gpio->vb;
+ struct vprbrd_gpioa_msg *gamsg = (struct vprbrd_gpioa_msg *)vb->buf;
+
+ /* if io is set to output, just return the saved value */
+ if (gpio->gpioa_out & (1 << offset))
+ return gpio->gpioa_val & (1 << offset);
+
+ mutex_lock(&vb->lock);
+
+ gamsg->cmd = VPRBRD_GPIOA_CMD_GETIN;
+ gamsg->clk = 0x00;
+ gamsg->offset = offset;
+ gamsg->t1 = 0x00;
+ gamsg->t2 = 0x00;
+ gamsg->invert = 0x00;
+ gamsg->pwmlevel = 0x00;
+ gamsg->outval = 0x00;
+ gamsg->risefall = 0x00;
+ gamsg->answer = 0x00;
+ gamsg->__fill = 0x00;
+
+ ret = usb_control_msg(vb->usb_dev, usb_sndctrlpipe(vb->usb_dev, 0),
+ VPRBRD_USB_REQUEST_GPIOA, VPRBRD_USB_TYPE_OUT, 0x0000,
+ 0x0000, gamsg, sizeof(struct vprbrd_gpioa_msg),
+ VPRBRD_USB_TIMEOUT_MS);
+ if (ret != sizeof(struct vprbrd_gpioa_msg))
+ error = -EREMOTEIO;
+
+ ret = usb_control_msg(vb->usb_dev, usb_rcvctrlpipe(vb->usb_dev, 0),
+ VPRBRD_USB_REQUEST_GPIOA, VPRBRD_USB_TYPE_IN, 0x0000,
+ 0x0000, gamsg, sizeof(struct vprbrd_gpioa_msg),
+ VPRBRD_USB_TIMEOUT_MS);
+ answer = gamsg->answer & 0x01;
+
+ mutex_unlock(&vb->lock);
+
+ if (ret != sizeof(struct vprbrd_gpioa_msg))
+ error = -EREMOTEIO;
+
+ if (error)
+ return error;
+
+ return answer;
+}
+
+static void vprbrd_gpioa_set(struct gpio_chip *chip,
+ unsigned offset, int value)
+{
+ int ret;
+ struct vprbrd_gpio *gpio =
+ container_of(chip, struct vprbrd_gpio, gpioa);
+ struct vprbrd *vb = gpio->vb;
+ struct vprbrd_gpioa_msg *gamsg = (struct vprbrd_gpioa_msg *)vb->buf;
+
+ if (gpio->gpioa_out & (1 << offset)) {
+ if (value)
+ gpio->gpioa_val |= (1 << offset);
+ else
+ gpio->gpioa_val &= ~(1 << offset);
+
+ mutex_lock(&vb->lock);
+
+ gamsg->cmd = VPRBRD_GPIOA_CMD_SETOUT;
+ gamsg->clk = 0x00;
+ gamsg->offset = offset;
+ gamsg->t1 = 0x00;
+ gamsg->t2 = 0x00;
+ gamsg->invert = 0x00;
+ gamsg->pwmlevel = 0x00;
+ gamsg->outval = value;
+ gamsg->risefall = 0x00;
+ gamsg->answer = 0x00;
+ gamsg->__fill = 0x00;
+
+ ret = usb_control_msg(vb->usb_dev,
+ usb_sndctrlpipe(vb->usb_dev, 0),
+ VPRBRD_USB_REQUEST_GPIOA, VPRBRD_USB_TYPE_OUT,
+ 0x0000, 0x0000, gamsg,
+ sizeof(struct vprbrd_gpioa_msg), VPRBRD_USB_TIMEOUT_MS);
+
+ mutex_unlock(&vb->lock);
+
+ if (ret != sizeof(struct vprbrd_gpioa_msg))
+ dev_err(chip->dev, "usb error setting pin value\n");
+ }
+}
+
+static int vprbrd_gpioa_direction_input(struct gpio_chip *chip,
+ unsigned offset)
+{
+ int ret;
+ struct vprbrd_gpio *gpio =
+ container_of(chip, struct vprbrd_gpio, gpioa);
+ struct vprbrd *vb = gpio->vb;
+ struct vprbrd_gpioa_msg *gamsg = (struct vprbrd_gpioa_msg *)vb->buf;
+
+ gpio->gpioa_out &= ~(1 << offset);
+
+ mutex_lock(&vb->lock);
+
+ gamsg->cmd = VPRBRD_GPIOA_CMD_SETIN;
+ gamsg->clk = gpioa_clk;
+ gamsg->offset = offset;
+ gamsg->t1 = 0x00;
+ gamsg->t2 = 0x00;
+ gamsg->invert = 0x00;
+ gamsg->pwmlevel = 0x00;
+ gamsg->outval = 0x00;
+ gamsg->risefall = 0x00;
+ gamsg->answer = 0x00;
+ gamsg->__fill = 0x00;
+
+ ret = usb_control_msg(vb->usb_dev, usb_sndctrlpipe(vb->usb_dev, 0),
+ VPRBRD_USB_REQUEST_GPIOA, VPRBRD_USB_TYPE_OUT, 0x0000,
+ 0x0000, gamsg, sizeof(struct vprbrd_gpioa_msg),
+ VPRBRD_USB_TIMEOUT_MS);
+
+ mutex_unlock(&vb->lock);
+
+ if (ret != sizeof(struct vprbrd_gpioa_msg))
+ return -EREMOTEIO;
+
+ return 0;
+}
+
+static int vprbrd_gpioa_direction_output(struct gpio_chip *chip,
+ unsigned offset, int value)
+{
+ int ret;
+ struct vprbrd_gpio *gpio =
+ container_of(chip, struct vprbrd_gpio, gpioa);
+ struct vprbrd *vb = gpio->vb;
+ struct vprbrd_gpioa_msg *gamsg = (struct vprbrd_gpioa_msg *)vb->buf;
+
+ gpio->gpioa_out |= (1 << offset);
+ if (value)
+ gpio->gpioa_val |= (1 << offset);
+ else
+ gpio->gpioa_val &= ~(1 << offset);
+
+ mutex_lock(&vb->lock);
+
+ gamsg->cmd = VPRBRD_GPIOA_CMD_SETOUT;
+ gamsg->clk = 0x00;
+ gamsg->offset = offset;
+ gamsg->t1 = 0x00;
+ gamsg->t2 = 0x00;
+ gamsg->invert = 0x00;
+ gamsg->pwmlevel = 0x00;
+ gamsg->outval = value;
+ gamsg->risefall = 0x00;
+ gamsg->answer = 0x00;
+ gamsg->__fill = 0x00;
+
+ ret = usb_control_msg(vb->usb_dev, usb_sndctrlpipe(vb->usb_dev, 0),
+ VPRBRD_USB_REQUEST_GPIOA, VPRBRD_USB_TYPE_OUT, 0x0000,
+ 0x0000, gamsg, sizeof(struct vprbrd_gpioa_msg),
+ VPRBRD_USB_TIMEOUT_MS);
+
+ mutex_unlock(&vb->lock);
+
+ if (ret != sizeof(struct vprbrd_gpioa_msg))
+ return -EREMOTEIO;
+
+ return 0;
+}
+
+/* ----- end of gpio a chip ---------------------------------------------- */
+
+/* ----- begin of gipo b chip -------------------------------------------- */
+
+static int vprbrd_gpiob_setdir(struct vprbrd *vb, unsigned offset,
+ unsigned dir)
+{
+ struct vprbrd_gpiob_msg *gbmsg = (struct vprbrd_gpiob_msg *)vb->buf;
+ int ret;
+
+ gbmsg->cmd = VPRBRD_GPIOB_CMD_SETDIR;
+ gbmsg->val = cpu_to_be16(dir << offset);
+ gbmsg->mask = cpu_to_be16(0x0001 << offset);
+
+ ret = usb_control_msg(vb->usb_dev, usb_sndctrlpipe(vb->usb_dev, 0),
+ VPRBRD_USB_REQUEST_GPIOB, VPRBRD_USB_TYPE_OUT, 0x0000,
+ 0x0000, gbmsg, sizeof(struct vprbrd_gpiob_msg),
+ VPRBRD_USB_TIMEOUT_MS);
+
+ if (ret != sizeof(struct vprbrd_gpiob_msg))
+ return -EREMOTEIO;
+
+ return 0;
+}
+
+static int vprbrd_gpiob_get(struct gpio_chip *chip,
+ unsigned offset)
+{
+ int ret;
+ u16 val;
+ struct vprbrd_gpio *gpio =
+ container_of(chip, struct vprbrd_gpio, gpiob);
+ struct vprbrd *vb = gpio->vb;
+ struct vprbrd_gpiob_msg *gbmsg = (struct vprbrd_gpiob_msg *)vb->buf;
+
+ /* if io is set to output, just return the saved value */
+ if (gpio->gpiob_out & (1 << offset))
+ return gpio->gpiob_val & (1 << offset);
+
+ mutex_lock(&vb->lock);
+
+ ret = usb_control_msg(vb->usb_dev, usb_rcvctrlpipe(vb->usb_dev, 0),
+ VPRBRD_USB_REQUEST_GPIOB, VPRBRD_USB_TYPE_IN, 0x0000,
+ 0x0000, gbmsg, sizeof(struct vprbrd_gpiob_msg),
+ VPRBRD_USB_TIMEOUT_MS);
+ val = gbmsg->val;
+
+ mutex_unlock(&vb->lock);
+
+ if (ret != sizeof(struct vprbrd_gpiob_msg))
+ return ret;
+
+ /* cache the read values */
+ gpio->gpiob_val = be16_to_cpu(val);
+
+ return (gpio->gpiob_val >> offset) & 0x1;
+}
+
+static void vprbrd_gpiob_set(struct gpio_chip *chip,
+ unsigned offset, int value)
+{
+ int ret;
+ struct vprbrd_gpio *gpio =
+ container_of(chip, struct vprbrd_gpio, gpiob);
+ struct vprbrd *vb = gpio->vb;
+ struct vprbrd_gpiob_msg *gbmsg = (struct vprbrd_gpiob_msg *)vb->buf;
+
+ if (gpio->gpiob_out & (1 << offset)) {
+ if (value)
+ gpio->gpiob_val |= (1 << offset);
+ else
+ gpio->gpiob_val &= ~(1 << offset);
+
+ mutex_lock(&vb->lock);
+
+ gbmsg->cmd = VPRBRD_GPIOB_CMD_SETVAL;
+ gbmsg->val = cpu_to_be16(value << offset);
+ gbmsg->mask = cpu_to_be16(0x0001 << offset);
+
+ ret = usb_control_msg(vb->usb_dev,
+ usb_sndctrlpipe(vb->usb_dev, 0),
+ VPRBRD_USB_REQUEST_GPIOB, VPRBRD_USB_TYPE_OUT,
+ 0x0000, 0x0000, gbmsg,
+ sizeof(struct vprbrd_gpiob_msg), VPRBRD_USB_TIMEOUT_MS);
+
+ mutex_unlock(&vb->lock);
+
+ if (ret != sizeof(struct vprbrd_gpiob_msg))
+ dev_err(chip->dev, "usb error setting pin value\n");
+ }
+}
+
+static int vprbrd_gpiob_direction_input(struct gpio_chip *chip,
+ unsigned offset)
+{
+ int ret;
+ struct vprbrd_gpio *gpio =
+ container_of(chip, struct vprbrd_gpio, gpiob);
+ struct vprbrd *vb = gpio->vb;
+
+ gpio->gpiob_out &= ~(1 << offset);
+
+ mutex_lock(&vb->lock);
+
+ ret = vprbrd_gpiob_setdir(vb, offset, 0);
+
+ mutex_unlock(&vb->lock);
+
+ if (ret)
+ dev_err(chip->dev, "usb error setting pin to input\n");
+
+ return ret;
+}
+
+static int vprbrd_gpiob_direction_output(struct gpio_chip *chip,
+ unsigned offset, int value)
+{
+ int ret;
+ struct vprbrd_gpio *gpio =
+ container_of(chip, struct vprbrd_gpio, gpiob);
+ struct vprbrd *vb = gpio->vb;
+
+ gpio->gpiob_out |= (1 << offset);
+ if (value)
+ gpio->gpiob_val |= (1 << offset);
+ else
+ gpio->gpiob_val &= ~(1 << offset);
+
+ mutex_lock(&vb->lock);
+
+ ret = vprbrd_gpiob_setdir(vb, offset, 1);
+ if (ret)
+ dev_err(chip->dev, "usb error setting pin to output\n");
+
+ mutex_unlock(&vb->lock);
+
+ vprbrd_gpiob_set(chip, offset, value);
+
+ return ret;
+}
+
+/* ----- end of gpio b chip ---------------------------------------------- */
+
+static int __devinit vprbrd_gpio_probe(struct platform_device *pdev)
+{
+ struct vprbrd *vb = dev_get_drvdata(pdev->dev.parent);
+ struct vprbrd_gpio *vb_gpio;
+ int ret;
+
+ vb_gpio = devm_kzalloc(&pdev->dev, sizeof(*vb_gpio), GFP_KERNEL);
+ if (vb_gpio == NULL)
+ return -ENOMEM;
+
+ vb_gpio->vb = vb;
+ /* registering gpio a */
+ vb_gpio->gpioa.label = "viperboard gpio a";
+ vb_gpio->gpioa.dev = &pdev->dev;
+ vb_gpio->gpioa.owner = THIS_MODULE;
+ vb_gpio->gpioa.base = -1;
+ vb_gpio->gpioa.ngpio = 16;

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/i2c/busses/i2c-viperboard.c

View file

This diff is incomplete. Download the complete patch.

drivers/iio/adc/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/iio/adc/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/iio/adc/ti_am335x_adc.c

View file

This diff is incomplete. Download the complete patch.

drivers/iio/adc/viperboard_adc.c

View file

This diff is incomplete. Download the complete patch.

drivers/input/misc/da9052_onkey.c

View file

This diff is incomplete. Download the complete patch.

drivers/input/touchscreen/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/input/touchscreen/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/input/touchscreen/da9052_tsi.c

View file

This diff is incomplete. Download the complete patch.

drivers/input/touchscreen/ti_am335x_tsc.c

View file

This diff is incomplete. Download the complete patch.

drivers/input/touchscreen/ti_tscadc.c

View before deletion

This diff is incomplete. Download the complete patch.

drivers/mfd/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/ab8500-core.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/arizona-core.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/arizona-irq.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/as3711.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/da9052-core.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/da9052-irq.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/db8500-prcmu.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/jz4740-adc.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/lpc_ich.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/mc13xxx-core.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/mc13xxx-i2c.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/mc13xxx-spi.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/mc13xxx.h

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/mfd-core.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/rc5t583-irq.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/retu-mfd.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/rtsx_pcr.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/sec-irq.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/sta2x11-mfd.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/stmpe-i2c.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/stmpe.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/ti_am335x_tscadc.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/tps6507x.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/tps65090.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/tps65217.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/tps6586x.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/tps65910-irq.c

View before deletion

This diff is incomplete. Download the complete patch.

drivers/mfd/tps65910.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/tps80031.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/twl-core.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/twl4030-irq.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/twl4030-madc.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/twl4030-power.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/twl6030-irq.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/twl6040-irq.c

View before deletion

This diff is incomplete. Download the complete patch.

drivers/mfd/twl6040.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/viperboard.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/wm5102-tables.c

View file

This diff is incomplete. Download the complete patch.

drivers/mfd/wm8994-core.c

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/Makefile

View file

This diff is incomplete. Download the complete patch.

drivers/mmc/host/rtsx_pci_sdmmc.c

View file

This diff is incomplete. Download the complete patch.

drivers/power/da9052-battery.c

View file

This diff is incomplete. Download the complete patch.

drivers/rtc/rtc-twl.c

View file

This diff is incomplete. Download the complete patch.

include/linux/i2c/twl.h

View file

This diff is incomplete. Download the complete patch.

include/linux/input/ti_am335x_tsc.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mfd/arizona/registers.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mfd/as3711.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mfd/da9052/da9052.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mfd/da9055/core.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mfd/da9055/pdata.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mfd/da9055/reg.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mfd/rc5t583.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mfd/retu.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mfd/sta2x11-mfd.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mfd/stmpe.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mfd/ti_am335x_tscadc.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mfd/tps65090.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mfd/tps6586x.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mfd/tps65910.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mfd/tps80031.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mfd/twl6040.h

View file

This diff is incomplete. Download the complete patch.

include/linux/mfd/viperboard.h

View file

This diff is incomplete. Download the complete patch.

include/linux/platform_data/ti_am335x_adc.h

View file

This diff is incomplete. Download the complete patch.