diff options
Diffstat (limited to 'drivers/regulator/max77686.c')
-rw-r--r-- | drivers/regulator/max77686.c | 47 |
1 files changed, 33 insertions, 14 deletions
diff --git a/drivers/regulator/max77686.c b/drivers/regulator/max77686.c index ebb2954..936afb1 100644 --- a/drivers/regulator/max77686.c +++ b/drivers/regulator/max77686.c @@ -316,7 +316,7 @@ static int max77686_reg_enable(struct regulator_dev *rdev) if (ret) return ret; - pr_info("%s: id=%d, pattern=%x\n", + printk(PMIC_DEBUG "%s: id=%d, pattern=%x\n", __func__, rdev_get_id(rdev), pattern); return max77686_update_reg(i2c, reg, pattern, mask); @@ -332,7 +332,7 @@ static int max77686_reg_disable(struct regulator_dev *rdev) if (ret) return ret; - pr_info("%s: id=%d, pattern=%x\n", + printk(PMIC_DEBUG "%s: id=%d, pattern=%x\n", __func__, rdev_get_id(rdev), pattern); return max77686_update_reg(i2c, reg, ~mask, mask); @@ -401,7 +401,7 @@ static int max77686_get_voltage(struct regulator_dev *rdev) val >>= shift; val &= mask; - pr_debug("%s: id=%d, val=%x\n", + printk(PMIC_REG_DEBUG "%s: id=%d, val=%x\n", __func__, rid, val); return max77686_list_voltage(rdev, val); @@ -467,12 +467,19 @@ static int max77686_set_voltage(struct regulator_dev *rdev, org = (org & mask) >> shift; #if defined(CONFIG_MACH_M0) || defined(CONFIG_MACH_C1) || \ - defined(CONFIG_MACH_C1VZW) || defined(CONFIG_MACH_P4NOTE) || \ - defined(CONFIG_MACH_GC1) + defined(CONFIG_MACH_M3) || \ + defined(CONFIG_MACH_P4NOTE) || \ + defined(CONFIG_MACH_GC1) || defined(CONFIG_MACH_T0) || \ + defined(CONFIG_MACH_GRANDE) || defined(CONFIG_MACH_IRON) +#if !defined(CONFIG_MACH_T0_CHN_CU_DUOS) || \ + !defined(CONFIG_MACH_T0_CHN_CMCC) || \ + !defined(CONFIG_MACH_T0_CHN_OPEN_DUOS) || \ + !defined(CONFIG_MACH_T0_CHN_CTC) /* Test code for HDMI debug */ if (!gpio_get_value(GPIO_HDMI_EN)) #endif - pr_debug("max77686: id=%d, org=%x, val=%x", +#endif + printk(PMIC_REG_DEBUG "max77686: id=%d, org=%x, val=%x", rdev_get_id(rdev), org, i); ret = max77686_update_reg(i2c, reg, i << shift, mask << shift); @@ -633,7 +640,7 @@ static int max77686_set_ramp_rate(struct i2c_client *i2c, int rate) break; } - pr_debug("%s: ramp_delay=%d, data=0x%x\n", __func__, ramp_delay, data); + printk(PMIC_DEBUG "%s: ramp_delay=%d, data=0x%x\n", __func__, ramp_delay, data); max77686_update_reg(i2c, MAX77686_REG_BUCK2CTRL1, data, 0xC0); max77686_update_reg(i2c, MAX77686_REG_BUCK3CTRL1, data, 0xC0); @@ -649,10 +656,10 @@ static __devinit int max77686_pmic_probe(struct platform_device *pdev) struct regulator_dev **rdev; struct max77686_data *max77686; struct i2c_client *i2c; - int i, ret, size; + int i, ret, size, err; u8 data = 0; - pr_info("%s\n", __func__); + printk(PMIC_DEBUG "%s\n", __func__); if (!pdata) { dev_err(pdev->dev.parent, "No platform init data supplied.\n"); @@ -682,7 +689,7 @@ static __devinit int max77686_pmic_probe(struct platform_device *pdev) max77686_read_reg(i2c, MAX77686_REG_DEVICE_ID, &data); max77686->device_id = (data & 0x7); - pr_info("%s: DEVICE ID=0x%x\n", __func__, data); + printk(PMIC_DEBUG "%s: DEVICE ID=0x%x\n", __func__, data); /* * TODO @@ -700,7 +707,11 @@ static __devinit int max77686_pmic_probe(struct platform_device *pdev) if (gpio_is_valid(pdata->buck234_gpio_dvs[i].gpio)) { max77686->buck234_gpios_dvs[i] = pdata->buck234_gpio_dvs[i].gpio; - gpio_request(pdata->buck234_gpio_dvs[i].gpio, buf); + err = gpio_request( + pdata->buck234_gpio_dvs[i].gpio, buf); + if (err) + pr_warn( + "failed to request MAX77686 DVS%d\n", i); gpio_direction_output(pdata->buck234_gpio_dvs[i].gpio, pdata->buck234_gpio_dvs[i].data); } else { @@ -714,7 +725,11 @@ static __devinit int max77686_pmic_probe(struct platform_device *pdev) int data = (max77686->device_id <= MAX77686_DEVICE_PASS1) ? 1 : 0; max77686->buck234_gpios_selb[i] = pdata->buck234_gpio_selb[i]; - gpio_request(pdata->buck234_gpio_selb[i], buf); + err = gpio_request( + pdata->buck234_gpio_selb[i], buf); + if (err) + pr_warn( + "failed to request MAX77686 SELB%d\n", i); gpio_direction_output(pdata->buck234_gpio_selb[i], data); } else { dev_info(&pdev->dev, "GPIO %s ignored (%d)\n", @@ -776,7 +791,7 @@ static __devinit int max77686_pmic_probe(struct platform_device *pdev) regulators[id].n_voltages = (desc->max - desc->min) / desc->step + 1; - pr_info("%s: desc=%p, id=%d, n_vol=%d, max=%d, min=%d, step=%d\n", + printk(PMIC_DEBUG "%s: desc=%p, id=%d, n_vol=%d, max=%d, min=%d, step=%d\n", __func__, desc, id, regulators[id].n_voltages, desc->max, desc->min, desc->step); } @@ -852,11 +867,15 @@ static struct platform_driver max77686_pmic_driver = { static int __init max77686_pmic_init(void) { - pr_info("%s\n", __func__); + printk(PMIC_DEBUG "%s\n", __func__); return platform_driver_register(&max77686_pmic_driver); } +#ifdef CONFIG_FAST_RESUME +beforeresume_initcall(max77686_pmic_init); +#else subsys_initcall(max77686_pmic_init); +#endif static void __exit max77686_pmic_cleanup(void) { |