Re: [PATCH v10] Regulator: Add Anatop regulator driver

2012-03-09 Thread Ying-Chun Liu (PaulLiu)
(2012年03月08日 22:18), Jean-Christophe PLAGNIOL-VILLARD wrote: +static int __devexit anatop_regulator_remove(struct platform_device *pdev) +{ +struct regulator_dev *rdev = platform_get_drvdata(pdev); +struct anatop_regulator *sreg = rdev_get_drvdata(rdev); +kfree(sreg-name); +

Re: [PATCH v10] Regulator: Add Anatop regulator driver

2012-03-09 Thread Axel Lin
+       if (anatop_reg-control_reg) { +               sel = (uv - anatop_reg-min_voltage) / 25000; sel = DIV_ROUND_UP(uv - anatop_reg-min_voltage, 25000); Use DIV_ROUND_UP to avoid the possible truncate of integer division. This ensures the selected volatge falls within the specified range.

Re: [PATCH v10] Regulator: Add Anatop regulator driver

2012-03-09 Thread Jean-Christophe PLAGNIOL-VILLARD
On 16:00 Fri 09 Mar , Ying-Chun Liu (PaulLiu) wrote: (2012年03月08日 22:18), Jean-Christophe PLAGNIOL-VILLARD wrote: +static int __devexit anatop_regulator_remove(struct platform_device *pdev) +{ + struct regulator_dev *rdev = platform_get_drvdata(pdev); + struct anatop_regulator *sreg

Re: [PATCH v10] Regulator: Add Anatop regulator driver

2012-03-09 Thread Axel Lin
--- a/drivers/regulator/Kconfig +++ b/drivers/regulator/Kconfig @@ -213,6 +213,14 @@ config REGULATOR_PCAP         This driver provides support for the voltage regulators of the         PCAP2 PMIC. +config REGULATOR_ANATOP +       tristate Freescale i.MX on-chip ANATOP LDO regulators +    

Re: [PATCH v10] Regulator: Add Anatop regulator driver

2012-03-09 Thread Mark Brown
On Fri, Mar 09, 2012 at 10:58:34AM +0100, Jean-Christophe PLAGNIOL-VILLARD wrote: I've modify the patch based on your review. However, the last one cannot be made because regulator_unregister is void return. so we have a issue here regulator_unregister MUST return an error conde The error

[PATCH v10] Regulator: Add Anatop regulator driver

2012-03-08 Thread Ying-Chun Liu (PaulLiu)
From: Ying-Chun Liu (PaulLiu) paul@linaro.org Anatop is an integrated regulator inside i.MX6 SoC. There are 3 digital regulators which controls PU, CORE (ARM), and SOC. And 3 analog regulators which controls 1P1, 2P5, 3P0 (USB). This patch adds the Anatop regulator driver. Signed-off-by:

Re: [PATCH v10] Regulator: Add Anatop regulator driver

2012-03-08 Thread Jean-Christophe PLAGNIOL-VILLARD
On 17:59 Thu 08 Mar , Ying-Chun Liu (PaulLiu) wrote: From: Ying-Chun Liu (PaulLiu) paul@linaro.org Anatop is an integrated regulator inside i.MX6 SoC. There are 3 digital regulators which controls PU, CORE (ARM), and SOC. And 3 analog regulators which controls 1P1, 2P5, 3P0 (USB).