Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/voltage-2.6:
davinci: da850/omap-l138 evm: account for DEFDCDC{2,3} being tied high
regulator: tps6507x: allow driver to use DEFDCDC{2,3}_HIGH register
wm8350-regulator: fix wm8350_register_regulator error handling
ab3100: fix off-by-one value range checking for voltage selector

+72 -10
+8
arch/arm/mach-davinci/board-da850-evm.c
··· 25 25 #include <linux/mtd/partitions.h> 26 26 #include <linux/mtd/physmap.h> 27 27 #include <linux/regulator/machine.h> 28 + #include <linux/regulator/tps6507x.h> 28 29 #include <linux/mfd/tps6507x.h> 29 30 #include <linux/input/tps6507x-ts.h> 30 31 ··· 470 469 }, 471 470 }; 472 471 472 + /* We take advantage of the fact that both defdcdc{2,3} are tied high */ 473 + static struct tps6507x_reg_platform_data tps6507x_platform_data = { 474 + .defdcdc_default = true, 475 + }; 476 + 473 477 struct regulator_init_data tps65070_regulator_data[] = { 474 478 /* dcdc1 */ 475 479 { ··· 500 494 }, 501 495 .num_consumer_supplies = ARRAY_SIZE(tps65070_dcdc2_consumers), 502 496 .consumer_supplies = tps65070_dcdc2_consumers, 497 + .driver_data = &tps6507x_platform_data, 503 498 }, 504 499 505 500 /* dcdc3 */ ··· 514 507 }, 515 508 .num_consumer_supplies = ARRAY_SIZE(tps65070_dcdc3_consumers), 516 509 .consumer_supplies = tps65070_dcdc3_consumers, 510 + .driver_data = &tps6507x_platform_data, 517 511 }, 518 512 519 513 /* ldo1 */
+2 -2
drivers/regulator/ab3100.c
··· 286 286 { 287 287 struct ab3100_regulator *abreg = reg->reg_data; 288 288 289 - if (selector > abreg->voltages_len) 289 + if (selector >= abreg->voltages_len) 290 290 return -EINVAL; 291 291 return abreg->typ_voltages[selector]; 292 292 } ··· 318 318 regval &= 0xE0; 319 319 regval >>= 5; 320 320 321 - if (regval > abreg->voltages_len) { 321 + if (regval >= abreg->voltages_len) { 322 322 dev_err(&reg->dev, 323 323 "regulator register %02x contains an illegal voltage setting\n", 324 324 abreg->regreg);
+29 -7
drivers/regulator/tps6507x-regulator.c
··· 22 22 #include <linux/platform_device.h> 23 23 #include <linux/regulator/driver.h> 24 24 #include <linux/regulator/machine.h> 25 + #include <linux/regulator/tps6507x.h> 25 26 #include <linux/delay.h> 26 27 #include <linux/slab.h> 27 28 #include <linux/mfd/tps6507x.h> ··· 102 101 unsigned max_uV; 103 102 u8 table_len; 104 103 const u16 *table; 104 + 105 + /* Does DCDC high or the low register defines output voltage? */ 106 + bool defdcdc_default; 105 107 }; 106 108 107 - static const struct tps_info tps6507x_pmic_regs[] = { 109 + static struct tps_info tps6507x_pmic_regs[] = { 108 110 { 109 111 .name = "VDCDC1", 110 112 .min_uV = 725000, ··· 149 145 struct regulator_desc desc[TPS6507X_NUM_REGULATOR]; 150 146 struct tps6507x_dev *mfd; 151 147 struct regulator_dev *rdev[TPS6507X_NUM_REGULATOR]; 152 - const struct tps_info *info[TPS6507X_NUM_REGULATOR]; 148 + struct tps_info *info[TPS6507X_NUM_REGULATOR]; 153 149 struct mutex io_lock; 154 150 }; 155 151 static inline int tps6507x_pmic_read(struct tps6507x_pmic *tps, u8 reg) ··· 345 341 reg = TPS6507X_REG_DEFDCDC1; 346 342 break; 347 343 case TPS6507X_DCDC_2: 348 - reg = TPS6507X_REG_DEFDCDC2_LOW; 344 + if (tps->info[dcdc]->defdcdc_default) 345 + reg = TPS6507X_REG_DEFDCDC2_HIGH; 346 + else 347 + reg = TPS6507X_REG_DEFDCDC2_LOW; 349 348 break; 350 349 case TPS6507X_DCDC_3: 351 - reg = TPS6507X_REG_DEFDCDC3_LOW; 350 + if (tps->info[dcdc]->defdcdc_default) 351 + reg = TPS6507X_REG_DEFDCDC3_HIGH; 352 + else 353 + reg = TPS6507X_REG_DEFDCDC3_LOW; 352 354 break; 353 355 default: 354 356 return -EINVAL; ··· 380 370 reg = TPS6507X_REG_DEFDCDC1; 381 371 break; 382 372 case TPS6507X_DCDC_2: 383 - reg = TPS6507X_REG_DEFDCDC2_LOW; 373 + if (tps->info[dcdc]->defdcdc_default) 374 + reg = TPS6507X_REG_DEFDCDC2_HIGH; 375 + else 376 + reg = TPS6507X_REG_DEFDCDC2_LOW; 384 377 break; 385 378 case TPS6507X_DCDC_3: 386 - reg = TPS6507X_REG_DEFDCDC3_LOW; 379 + if (tps->info[dcdc]->defdcdc_default) 380 + reg = TPS6507X_REG_DEFDCDC3_HIGH; 381 + else 382 + reg = TPS6507X_REG_DEFDCDC3_LOW; 387 383 break; 388 384 default: 389 385 return -EINVAL; ··· 548 532 { 549 533 struct tps6507x_dev *tps6507x_dev = dev_get_drvdata(pdev->dev.parent); 550 534 static int desc_id; 551 - const struct tps_info *info = &tps6507x_pmic_regs[0]; 535 + struct tps_info *info = &tps6507x_pmic_regs[0]; 552 536 struct regulator_init_data *init_data; 553 537 struct regulator_dev *rdev; 554 538 struct tps6507x_pmic *tps; ··· 585 569 for (i = 0; i < TPS6507X_NUM_REGULATOR; i++, info++, init_data++) { 586 570 /* Register the regulators */ 587 571 tps->info[i] = info; 572 + if (init_data->driver_data) { 573 + struct tps6507x_reg_platform_data *data = 574 + init_data->driver_data; 575 + tps->info[i]->defdcdc_default = data->defdcdc_default; 576 + } 577 + 588 578 tps->desc[i].name = info->name; 589 579 tps->desc[i].id = desc_id++; 590 580 tps->desc[i].n_voltages = num_voltages[i];
+1 -1
drivers/regulator/wm8350-regulator.c
··· 1495 1495 if (ret != 0) { 1496 1496 dev_err(wm8350->dev, "Failed to register regulator %d: %d\n", 1497 1497 reg, ret); 1498 - platform_device_del(pdev); 1498 + platform_device_put(pdev); 1499 1499 wm8350->pmic.pdev[reg] = NULL; 1500 1500 } 1501 1501
+32
include/linux/regulator/tps6507x.h
··· 1 + /* 2 + * tps6507x.h -- Voltage regulation for the Texas Instruments TPS6507X 3 + * 4 + * Copyright (C) 2010 Texas Instruments, Inc. 5 + * 6 + * This program is free software; you can redistribute it and/or modify 7 + * it under the terms of the GNU General Public License version 2 as 8 + * published by the Free Software Foundation 9 + * 10 + * This program is distributed in the hope that it will be useful, 11 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 + * GNU General Public License for more details. 14 + * 15 + * You should have received a copy of the GNU General Public License 16 + * along with this program; if not, write to the Free Software 17 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 18 + */ 19 + 20 + #ifndef REGULATOR_TPS6507X 21 + #define REGULATOR_TPS6507X 22 + 23 + /** 24 + * tps6507x_reg_platform_data - platform data for tps6507x 25 + * @defdcdc_default: Defines whether DCDC high or the low register controls 26 + * output voltage by default. Valid for DCDC2 and DCDC3 outputs only. 27 + */ 28 + struct tps6507x_reg_platform_data { 29 + bool defdcdc_default; 30 + }; 31 + 32 + #endif