diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-15 00:58:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-10-15 00:58:16 -0400 |
commit | fcc3a5d277571bc6048e7b4ef8cd391b935de629 (patch) | |
tree | 143954c115011c657f747a0e1470973b94ab3690 /drivers/mfd/htc-i2cpld.c | |
parent | 50fa86172bec2769979b5eb0cd1a244391ae4bb0 (diff) | |
parent | d86c21fd31114e3ef9fae64be335c76aa22859dc (diff) |
Merge tag 'mfd-for-linus-3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd
Pull MFD updates from Lee Jones:
"Changes to existing drivers:
- DT clean-ups in da9055-core, max14577, rn5t618, arizona, hi6421, stmpe, twl4030
- Export symbols for use in modules in max14577
- Plenty of static code analysis/Coccinelle fixes throughout the SS
- Regmap clean-ups in arizona, wm5102, wm5110, da9052, tps65217, rk808
- Remove unused/duplicate code in da9052, 88pm860x, ti_ssp, lpc_sch, arizona
- Bug fixes in ti_am335x_tscadc, da9052, ti_am335x_tscadc, rtsx_pcr
- IRQ fixups in arizona, stmpe, max14577
- Regulator related changes in axp20x
- Pass DMA coherency information from parent => child in MFD core
- Rename DT document files for consistency
- Add ACPI support to the MFD core
- Add Andreas Werner to MAINTAINERS for MEN F21BMC
New drivers/supported devices:
- New driver for MEN 14F021P00 Board Management Controller
- New driver for Ricoh RN5T618 PMIC
- New driver for Rockchip RK808
- New driver for HiSilicon Hi6421 PMIC
- New driver for Qualcomm SPMI PMICs
- Add support for Intel Braswell in lpc_ich
- Add support for Intel 9 Series PCH in lpc_ich
- Add support for Intel Quark ILB in lpc_sch"
[ Delayed to after the poweer/reset pull due to Kconfig problems with
recursive Kconfig select/depends-on chains. - Linus ]
* tag 'mfd-for-linus-3.18' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (79 commits)
mfd: cros_ec: wait for completion of commands that return IN_PROGRESS
i2c: i2c-cros-ec-tunnel: Set retries to 3
mfd: cros_ec: move locking into cros_ec_cmd_xfer
mfd: cros_ec: stop calling ->cmd_xfer() directly
mfd: cros_ec: Delay for 50ms when we see EC_CMD_REBOOT_EC
MAINTAINERS: Adds Andreas Werner to maintainers list for MEN F21BMC
mfd: arizona: Correct mask to allow setting micbias external cap
mfd: Add ACPI support
Revert "mfd: wm5102: Manually apply register patch"
mfd: ti_am335x_tscadc: Update logic in CTRL register for 5-wire TS
mfd: dt-bindings: atmel-gpbr: Rename doc file to conform to naming convention
mfd: dt-bindings: qcom-pm8xxx: Rename doc file to conform to naming convention
mfd: Inherit coherent_dma_mask from parent device
mfd: Document DT bindings for Qualcomm SPMI PMICs
mfd: Add support for Qualcomm SPMI PMICs
mfd: dt-bindings: pm8xxx: Add new compatible string
mfd: axp209x: Drop the parent supplies field
mfd: twl4030-power: Use 'ti,system-power-controller' as alternative way to support system power off
mfd: dt-bindings: twl4030-power: Use the standard property to mark power control
mfd: syscon: Add Atmel GPBR DT bindings documention
...
Diffstat (limited to 'drivers/mfd/htc-i2cpld.c')
-rw-r--r-- | drivers/mfd/htc-i2cpld.c | 44 |
1 files changed, 14 insertions, 30 deletions
diff --git a/drivers/mfd/htc-i2cpld.c b/drivers/mfd/htc-i2cpld.c index adbbce0ff630..ebb9cf19e347 100644 --- a/drivers/mfd/htc-i2cpld.c +++ b/drivers/mfd/htc-i2cpld.c | |||
@@ -227,15 +227,12 @@ static irqreturn_t htcpld_handler(int irq, void *dev) | |||
227 | static void htcpld_chip_set(struct gpio_chip *chip, unsigned offset, int val) | 227 | static void htcpld_chip_set(struct gpio_chip *chip, unsigned offset, int val) |
228 | { | 228 | { |
229 | struct i2c_client *client; | 229 | struct i2c_client *client; |
230 | struct htcpld_chip *chip_data; | 230 | struct htcpld_chip *chip_data = |
231 | container_of(chip, struct htcpld_chip, chip_out); | ||
231 | unsigned long flags; | 232 | unsigned long flags; |
232 | 233 | ||
233 | chip_data = container_of(chip, struct htcpld_chip, chip_out); | ||
234 | if (!chip_data) | ||
235 | return; | ||
236 | |||
237 | client = chip_data->client; | 234 | client = chip_data->client; |
238 | if (client == NULL) | 235 | if (!client) |
239 | return; | 236 | return; |
240 | 237 | ||
241 | spin_lock_irqsave(&chip_data->lock, flags); | 238 | spin_lock_irqsave(&chip_data->lock, flags); |
@@ -261,31 +258,18 @@ static void htcpld_chip_set_ni(struct work_struct *work) | |||
261 | static int htcpld_chip_get(struct gpio_chip *chip, unsigned offset) | 258 | static int htcpld_chip_get(struct gpio_chip *chip, unsigned offset) |
262 | { | 259 | { |
263 | struct htcpld_chip *chip_data; | 260 | struct htcpld_chip *chip_data; |
264 | int val = 0; | 261 | u8 cache; |
265 | int is_input = 0; | ||
266 | |||
267 | /* Try out first */ | ||
268 | chip_data = container_of(chip, struct htcpld_chip, chip_out); | ||
269 | if (!chip_data) { | ||
270 | /* Try in */ | ||
271 | is_input = 1; | ||
272 | chip_data = container_of(chip, struct htcpld_chip, chip_in); | ||
273 | if (!chip_data) | ||
274 | return -EINVAL; | ||
275 | } | ||
276 | 262 | ||
277 | /* Determine if this is an input or output GPIO */ | 263 | if (!strncmp(chip->label, "htcpld-out", 10)) { |
278 | if (!is_input) | 264 | chip_data = container_of(chip, struct htcpld_chip, chip_out); |
279 | /* Use the output cache */ | 265 | cache = chip_data->cache_out; |
280 | val = (chip_data->cache_out >> offset) & 1; | 266 | } else if (!strncmp(chip->label, "htcpld-in", 9)) { |
281 | else | 267 | chip_data = container_of(chip, struct htcpld_chip, chip_in); |
282 | /* Use the input cache */ | 268 | cache = chip_data->cache_in; |
283 | val = (chip_data->cache_in >> offset) & 1; | 269 | } else |
270 | return -EINVAL; | ||
284 | 271 | ||
285 | if (val) | 272 | return (cache >> offset) & 1; |
286 | return 1; | ||
287 | else | ||
288 | return 0; | ||
289 | } | 273 | } |
290 | 274 | ||
291 | static int htcpld_direction_output(struct gpio_chip *chip, | 275 | static int htcpld_direction_output(struct gpio_chip *chip, |
@@ -376,7 +360,7 @@ static int htcpld_register_chip_i2c( | |||
376 | plat_chip_data = &pdata->chip[chip_index]; | 360 | plat_chip_data = &pdata->chip[chip_index]; |
377 | 361 | ||
378 | adapter = i2c_get_adapter(pdata->i2c_adapter_id); | 362 | adapter = i2c_get_adapter(pdata->i2c_adapter_id); |
379 | if (adapter == NULL) { | 363 | if (!adapter) { |
380 | /* Eek, no such I2C adapter! Bail out. */ | 364 | /* Eek, no such I2C adapter! Bail out. */ |
381 | dev_warn(dev, "Chip at i2c address 0x%x: Invalid i2c adapter %d\n", | 365 | dev_warn(dev, "Chip at i2c address 0x%x: Invalid i2c adapter %d\n", |
382 | plat_chip_data->addr, pdata->i2c_adapter_id); | 366 | plat_chip_data->addr, pdata->i2c_adapter_id); |