diff options
author | ra43240 <Ann.Thornton@freescale.com> | 2009-01-30 18:07:05 -0600 |
---|---|---|
committer | Justin Waters <justin.waters@timesys.com> | 2009-10-13 11:01:54 -0400 |
commit | 1af0b875d847365e7704327542fb3ebffa749e19 (patch) | |
tree | 4c1e403096e01e5fcc2c19afdeda9cc589d10cc7 /drivers/media | |
parent | e848aef40bbf86465396d956c33a24ac2a72a6a7 (diff) |
ENGR00107844-2: regulator: update drivers to mainline regulator api
Update drivers for mainline regulator support.
Signed-off-by: Ann Thornton <Ann.Thornton@freescale.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/mxc/capture/adv7180.c | 18 | ||||
-rw-r--r-- | drivers/media/video/mxc/capture/emma_ov2640.c | 18 | ||||
-rw-r--r-- | drivers/media/video/mxc/capture/ov2640.c | 18 | ||||
-rw-r--r-- | drivers/media/video/mxc/capture/ov3640.c | 23 |
4 files changed, 40 insertions, 37 deletions
diff --git a/drivers/media/video/mxc/capture/adv7180.c b/drivers/media/video/mxc/capture/adv7180.c index 7e3b89a7f4ab..5dec852fffe3 100644 --- a/drivers/media/video/mxc/capture/adv7180.c +++ b/drivers/media/video/mxc/capture/adv7180.c @@ -30,7 +30,7 @@ #include <linux/wait.h> #include <linux/videodev2.h> #include <linux/workqueue.h> -#include <linux/regulator/regulator.h> +#include <linux/regulator/consumer.h> #include <media/v4l2-int-device.h> #include <linux/regulator/mcu_max8660-bus.h> #include "mxc_v4l2_capture.h" @@ -805,7 +805,7 @@ static int adv7180_probe(struct i2c_client *client, dvddio_regulator = regulator_get(&client->dev, plat_data->dvddio_reg); if (!IS_ERR_VALUE((unsigned long)dvddio_regulator)) { - regulator_set_voltage(dvddio_regulator, 3300000); + regulator_set_voltage(dvddio_regulator, 3300000, 3300000); if (regulator_enable(dvddio_regulator) != 0) return -ENODEV; } @@ -815,7 +815,7 @@ static int adv7180_probe(struct i2c_client *client, dvdd_regulator = regulator_get(&client->dev, plat_data->dvdd_reg); if (!IS_ERR_VALUE((unsigned long)dvdd_regulator)) { - regulator_set_voltage(dvdd_regulator, 1800000); + regulator_set_voltage(dvdd_regulator, 1800000, 1800000); if (regulator_enable(dvdd_regulator) != 0) return -ENODEV; } @@ -825,7 +825,7 @@ static int adv7180_probe(struct i2c_client *client, avdd_regulator = regulator_get(&client->dev, plat_data->avdd_reg); if (!IS_ERR_VALUE((unsigned long)avdd_regulator)) { - regulator_set_voltage(avdd_regulator, 1800000); + regulator_set_voltage(avdd_regulator, 1800000, 1800000); if (regulator_enable(avdd_regulator) != 0) return -ENODEV; } @@ -835,7 +835,7 @@ static int adv7180_probe(struct i2c_client *client, pvdd_regulator = regulator_get(&client->dev, plat_data->pvdd_reg); if (!IS_ERR_VALUE((unsigned long)pvdd_regulator)) { - regulator_set_voltage(pvdd_regulator, 1800000); + regulator_set_voltage(pvdd_regulator, 1800000, 1800000); if (regulator_enable(pvdd_regulator) != 0) return -ENODEV; } @@ -910,22 +910,22 @@ static int adv7180_detach(struct i2c_client *client) if (dvddio_regulator) { regulator_disable(dvddio_regulator); - regulator_put(dvddio_regulator, &client->dev); + regulator_put(dvddio_regulator); } if (dvdd_regulator) { regulator_disable(dvdd_regulator); - regulator_put(dvdd_regulator, &client->dev); + regulator_put(dvdd_regulator); } if (avdd_regulator) { regulator_disable(avdd_regulator); - regulator_put(avdd_regulator, &client->dev); + regulator_put(avdd_regulator); } if (pvdd_regulator) { regulator_disable(pvdd_regulator); - regulator_put(pvdd_regulator, &client->dev); + regulator_put(pvdd_regulator); } v4l2_int_device_unregister(&adv7180_int_device); diff --git a/drivers/media/video/mxc/capture/emma_ov2640.c b/drivers/media/video/mxc/capture/emma_ov2640.c index b593eb6ec402..ceffea4d52a9 100644 --- a/drivers/media/video/mxc/capture/emma_ov2640.c +++ b/drivers/media/video/mxc/capture/emma_ov2640.c @@ -1,5 +1,5 @@ /* - * Copyright 2005-2008 Freescale Semiconductor, Inc. All Rights Reserved. + * Copyright 2005-2009 Freescale Semiconductor, Inc. All Rights Reserved. */ /* @@ -18,7 +18,7 @@ #include <linux/delay.h> #include <linux/device.h> #include <linux/i2c.h> -#include <linux/regulator/regulator.h> +#include <linux/regulator/consumer.h> #include "mxc_v4l2_capture.h" @@ -210,22 +210,22 @@ static int ov2640_remove(struct i2c_client *client) if (!IS_ERR_VALUE((unsigned long)io_regulator)) { regulator_disable(io_regulator); - regulator_put(io_regulator, NULL); + regulator_put(io_regulator); } if (!IS_ERR_VALUE((unsigned long)core_regulator)) { regulator_disable(core_regulator); - regulator_put(core_regulator, NULL); + regulator_put(core_regulator); } if (!IS_ERR_VALUE((unsigned long)gpo_regulator)) { regulator_disable(gpo_regulator); - regulator_put(gpo_regulator, NULL); + regulator_put(gpo_regulator); } if (!IS_ERR_VALUE((unsigned long)analog_regulator)) { regulator_disable(analog_regulator); - regulator_put(analog_regulator, NULL); + regulator_put(analog_regulator); } return 0; @@ -323,7 +323,7 @@ static sensor_interface *ov2640_config(int *frame_rate, int high_quality) /*set io votage */ if (!IS_ERR_VALUE((unsigned long)io_regulator)) { - regulator_set_voltage(io_regulator, 2800000); + regulator_set_voltage(io_regulator, 2800000, 2800000); if (regulator_enable(io_regulator) != 0) { dev_dbg(&ov2640_i2c_client->dev, "%s:io set voltage error\n", __func__); @@ -336,7 +336,7 @@ static sensor_interface *ov2640_config(int *frame_rate, int high_quality) /*core votage */ if (!IS_ERR_VALUE((unsigned long)core_regulator)) { - regulator_set_voltage(core_regulator, 1300000); + regulator_set_voltage(core_regulator, 1300000, 1300000); if (regulator_enable(core_regulator) != 0) { dev_dbg(&ov2640_i2c_client->dev, "%s:core set voltage error\n", __func__); @@ -360,7 +360,7 @@ static sensor_interface *ov2640_config(int *frame_rate, int high_quality) } if (!IS_ERR_VALUE((unsigned long)analog_regulator)) { - regulator_set_voltage(analog_regulator, 2000000); + regulator_set_voltage(analog_regulator, 2000000, 2000000); if (regulator_enable(analog_regulator) != 0) { dev_dbg(&ov2640_i2c_client->dev, "%s:analog set voltage error\n", __func__); diff --git a/drivers/media/video/mxc/capture/ov2640.c b/drivers/media/video/mxc/capture/ov2640.c index a35444752d25..a0e6016bfa3e 100644 --- a/drivers/media/video/mxc/capture/ov2640.c +++ b/drivers/media/video/mxc/capture/ov2640.c @@ -26,7 +26,7 @@ #include <linux/delay.h> #include <linux/device.h> #include <linux/i2c.h> -#include <linux/regulator/regulator.h> +#include <linux/regulator/consumer.h> #include <media/v4l2-int-device.h> #include "mxc_v4l2_capture.h" @@ -598,12 +598,12 @@ static int ioctl_dev_init(struct v4l2_int_device *s) ov2640_data.on = true; if (!IS_ERR_VALUE((unsigned long)io_regulator)) { - regulator_set_voltage(io_regulator, 2800000); + regulator_set_voltage(io_regulator, 2800000, 2800000); if (regulator_enable(io_regulator) != 0) return -EIO; } if (!IS_ERR_VALUE((unsigned long)core_regulator)) { - regulator_set_voltage(core_regulator, 1300000); + regulator_set_voltage(core_regulator, 1300000, 1300000); if (regulator_enable(core_regulator) != 0) return -EIO; } @@ -614,8 +614,8 @@ static int ioctl_dev_init(struct v4l2_int_device *s) } } if (!IS_ERR_VALUE((unsigned long)analog_regulator)) { - /* regulator_set_voltage(analog_regulator, 2800000); */ - regulator_set_voltage(analog_regulator, 2000000); + /* regulator_set_voltage(analog_regulator, 2800000, 2800000); */ + regulator_set_voltage(analog_regulator, 2000000, 2000000); if (regulator_enable(analog_regulator) != 0) return -EIO; } @@ -731,22 +731,22 @@ static int ov2640_remove(struct i2c_client *client) if (!IS_ERR_VALUE((unsigned long)gpo_regulator)) { regulator_disable(gpo_regulator); - regulator_put(gpo_regulator, &client->dev); + regulator_put(gpo_regulator); } if (!IS_ERR_VALUE((unsigned long)analog_regulator)) { regulator_disable(analog_regulator); - regulator_put(analog_regulator, &client->dev); + regulator_put(analog_regulator); } if (!IS_ERR_VALUE((unsigned long)core_regulator)) { regulator_disable(core_regulator); - regulator_put(core_regulator, &client->dev); + regulator_put(core_regulator); } if (!IS_ERR_VALUE((unsigned long)io_regulator)) { regulator_disable(io_regulator); - regulator_put(io_regulator, &client->dev); + regulator_put(io_regulator); } return 0; diff --git a/drivers/media/video/mxc/capture/ov3640.c b/drivers/media/video/mxc/capture/ov3640.c index c9b2f45ec94a..7c2d3e3720e5 100644 --- a/drivers/media/video/mxc/capture/ov3640.c +++ b/drivers/media/video/mxc/capture/ov3640.c @@ -18,7 +18,7 @@ #include <linux/delay.h> #include <linux/device.h> #include <linux/i2c.h> -#include <linux/regulator/regulator.h> +#include <linux/regulator/consumer.h> #include <media/v4l2-int-device.h> #include "mxc_v4l2_capture.h" @@ -955,7 +955,8 @@ static int ov3640_probe(struct i2c_client *client, io_regulator = regulator_get(&client->dev, plat_data->io_regulator); if (!IS_ERR_VALUE((u32)io_regulator)) { - regulator_set_voltage(io_regulator, OV3640_VOLTAGE_DIGITAL_IO); + regulator_set_voltage(io_regulator, OV3640_VOLTAGE_DIGITAL_IO, + OV3640_VOLTAGE_DIGITAL_IO); if (regulator_enable(io_regulator) != 0) { pr_err("%s:io set voltage error\n", __func__); goto err1; @@ -968,6 +969,7 @@ static int ov3640_probe(struct i2c_client *client, core_regulator = regulator_get(&client->dev, plat_data->core_regulator); if (!IS_ERR_VALUE((u32)core_regulator)) { regulator_set_voltage(core_regulator, + OV3640_VOLTAGE_DIGITAL_CORE, OV3640_VOLTAGE_DIGITAL_CORE); if (regulator_enable(core_regulator) != 0) { pr_err("%s:core set voltage error\n", __func__); @@ -981,7 +983,8 @@ static int ov3640_probe(struct i2c_client *client, analog_regulator = regulator_get(&client->dev, plat_data->analog_regulator); if (!IS_ERR_VALUE((u32)analog_regulator)) { - regulator_set_voltage(analog_regulator, OV3640_VOLTAGE_ANALOG); + regulator_set_voltage(analog_regulator, OV3640_VOLTAGE_ANALOG, + OV3640_VOLTAGE_ANALOG); if (regulator_enable(analog_regulator) != 0) { pr_err("%s:analog set voltage error\n", __func__); goto err3; @@ -1010,17 +1013,17 @@ static int ov3640_probe(struct i2c_client *client, err4: if (!IS_ERR_VALUE((u32)analog_regulator)) { regulator_disable(analog_regulator); - regulator_put(analog_regulator, &client->dev); + regulator_put(analog_regulator); } err3: if (!IS_ERR_VALUE((u32)core_regulator)) { regulator_disable(core_regulator); - regulator_put(core_regulator, &client->dev); + regulator_put(core_regulator); } err2: if (!IS_ERR_VALUE((u32)io_regulator)) { regulator_disable(io_regulator); - regulator_put(io_regulator, &client->dev); + regulator_put(io_regulator); } err1: return -1; @@ -1040,22 +1043,22 @@ static int ov3640_remove(struct i2c_client *client) if (!IS_ERR_VALUE((unsigned long)gpo_regulator)) { regulator_disable(gpo_regulator); - regulator_put(gpo_regulator, &client->dev); + regulator_put(gpo_regulator); } if (!IS_ERR_VALUE((unsigned long)analog_regulator)) { regulator_disable(analog_regulator); - regulator_put(analog_regulator, &client->dev); + regulator_put(analog_regulator); } if (!IS_ERR_VALUE((unsigned long)core_regulator)) { regulator_disable(core_regulator); - regulator_put(core_regulator, &client->dev); + regulator_put(core_regulator); } if (!IS_ERR_VALUE((unsigned long)io_regulator)) { regulator_disable(io_regulator); - regulator_put(io_regulator, &client->dev); + regulator_put(io_regulator); } return 0; |