diff options
-rw-r--r-- | drivers/mfd/twl4030-power.c | 6 | ||||
-rw-r--r-- | include/linux/i2c/twl4030.h | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/drivers/mfd/twl4030-power.c b/drivers/mfd/twl4030-power.c index 3e41e0c0e4c6..9f98c36273d8 100644 --- a/drivers/mfd/twl4030-power.c +++ b/drivers/mfd/twl4030-power.c | |||
@@ -352,7 +352,7 @@ static int __init twl4030_configure_resource(struct twl4030_resconfig *rconfig) | |||
352 | return err; | 352 | return err; |
353 | } | 353 | } |
354 | 354 | ||
355 | if (rconfig->devgroup >= 0) { | 355 | if (rconfig->devgroup != TWL4030_RESCONFIG_UNDEF) { |
356 | grp &= ~DEV_GRP_MASK; | 356 | grp &= ~DEV_GRP_MASK; |
357 | grp |= rconfig->devgroup << DEV_GRP_SHIFT; | 357 | grp |= rconfig->devgroup << DEV_GRP_SHIFT; |
358 | err = twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, | 358 | err = twl4030_i2c_write_u8(TWL4030_MODULE_PM_RECEIVER, |
@@ -372,12 +372,12 @@ static int __init twl4030_configure_resource(struct twl4030_resconfig *rconfig) | |||
372 | return err; | 372 | return err; |
373 | } | 373 | } |
374 | 374 | ||
375 | if (rconfig->type >= 0) { | 375 | if (rconfig->type != TWL4030_RESCONFIG_UNDEF) { |
376 | type &= ~TYPE_MASK; | 376 | type &= ~TYPE_MASK; |
377 | type |= rconfig->type << TYPE_SHIFT; | 377 | type |= rconfig->type << TYPE_SHIFT; |
378 | } | 378 | } |
379 | 379 | ||
380 | if (rconfig->type2 >= 0) { | 380 | if (rconfig->type2 != TWL4030_RESCONFIG_UNDEF) { |
381 | type &= ~TYPE2_MASK; | 381 | type &= ~TYPE2_MASK; |
382 | type |= rconfig->type2 << TYPE2_SHIFT; | 382 | type |= rconfig->type2 << TYPE2_SHIFT; |
383 | } | 383 | } |
diff --git a/include/linux/i2c/twl4030.h b/include/linux/i2c/twl4030.h index e87cb270d8a1..8a4a58ff8dad 100644 --- a/include/linux/i2c/twl4030.h +++ b/include/linux/i2c/twl4030.h | |||
@@ -400,6 +400,7 @@ struct twl4030_power_data { | |||
400 | struct twl4030_script **scripts; | 400 | struct twl4030_script **scripts; |
401 | unsigned num; | 401 | unsigned num; |
402 | struct twl4030_resconfig *resource_config; | 402 | struct twl4030_resconfig *resource_config; |
403 | #define TWL4030_RESCONFIG_UNDEF ((u8)-1) | ||
403 | }; | 404 | }; |
404 | 405 | ||
405 | extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts); | 406 | extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts); |