summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/arm/boot/dts/tegra124-platforms/tegra124-pm359-camera-a00.dtsi30
-rw-r--r--arch/arm/mach-tegra/board-ardbeg-sensors.c96
-rw-r--r--drivers/media/platform/tegra/ar0330.c1
-rw-r--r--include/media/ar0330.h1
4 files changed, 39 insertions, 89 deletions
diff --git a/arch/arm/boot/dts/tegra124-platforms/tegra124-pm359-camera-a00.dtsi b/arch/arm/boot/dts/tegra124-platforms/tegra124-pm359-camera-a00.dtsi
index 5fed467695d9..d911161e020a 100644
--- a/arch/arm/boot/dts/tegra124-platforms/tegra124-pm359-camera-a00.dtsi
+++ b/arch/arm/boot/dts/tegra124-platforms/tegra124-pm359-camera-a00.dtsi
@@ -178,7 +178,7 @@
CAMERA_END
>;
};
- ar0330_1: ar0330@2_0010 {
+ ar0330_1: ar0330@2_0018 {
index = <4>;
chipname = "pcl_AR0330";
type = "sensor";
@@ -186,7 +186,7 @@
position = <0>;
bustype = "i2c";
busnum = <2>;
- addr = <0x10>;
+ addr = <0x18>;
datalen = <2>;
pinmuxgrp = <0xFFFF>;
gpios = <3>;
@@ -197,18 +197,22 @@
devid = <0x0330>;
poweron = <
CAMERA_IND_CLK_SET(10000)
- CAMERA_GPIO_CLR(219)
+ CAMERA_GPIO_CLR(221)
+ CAMERA_GPIO_CLR(222)
CAMERA_REGULATOR_ON(0)
+ CAMERA_WAITMS(10)
CAMERA_REGULATOR_ON(1)
CAMERA_REGULATOR_ON(2)
CAMERA_WAITMS(40)
- CAMERA_GPIO_SET(219)
+ CAMERA_GPIO_SET(221)
+ CAMERA_GPIO_SET(222)
CAMERA_WAITMS(20)
CAMERA_END
>;
poweroff = <
CAMERA_IND_CLK_CLR
- CAMERA_GPIO_CLR(219)
+ CAMERA_GPIO_CLR(221)
+ CAMERA_GPIO_CLR(222)
CAMERA_WAITUS(10)
CAMERA_REGULATOR_OFF(2)
CAMERA_REGULATOR_OFF(1)
@@ -216,7 +220,7 @@
CAMERA_END
>;
};
- ar0330_2: ar0330@2_0018 {
+ ar0330_2: ar0330@2_0010 {
index = <5>;
chipname = "pcl_AR0330";
type = "sensor";
@@ -224,29 +228,33 @@
position = <1>;
bustype = "i2c";
busnum = <2>;
- addr = <0x18>;
+ addr = <0x10>;
datalen = <2>;
pinmuxgrp = <0xFFFF>;
gpios = <3>;
regulators = "vana", "vdig", "vif";
- clocks = "mclk";
+ clocks = "mclk2";
drivername = "ar0330";
detect = <0x0002 0x3000 0xFFFF 0x2604>;
devid = <0x0330>;
poweron = <
CAMERA_IND_CLK_SET(10000)
- CAMERA_GPIO_CLR(219)
+ CAMERA_GPIO_CLR(221)
+ CAMERA_GPIO_CLR(222)
CAMERA_REGULATOR_ON(0)
+ CAMERA_WAITMS(10)
CAMERA_REGULATOR_ON(1)
CAMERA_REGULATOR_ON(2)
CAMERA_WAITMS(40)
- CAMERA_GPIO_SET(219)
+ CAMERA_GPIO_SET(221)
+ CAMERA_GPIO_SET(222)
CAMERA_WAITMS(20)
CAMERA_END
>;
poweroff = <
CAMERA_IND_CLK_CLR
- CAMERA_GPIO_CLR(219)
+ CAMERA_GPIO_CLR(221)
+ CAMERA_GPIO_CLR(222)
CAMERA_WAITUS(10)
CAMERA_REGULATOR_OFF(2)
CAMERA_REGULATOR_OFF(1)
diff --git a/arch/arm/mach-tegra/board-ardbeg-sensors.c b/arch/arm/mach-tegra/board-ardbeg-sensors.c
index 55dd519bd10c..b8ea94d1c086 100644
--- a/arch/arm/mach-tegra/board-ardbeg-sensors.c
+++ b/arch/arm/mach-tegra/board-ardbeg-sensors.c
@@ -300,56 +300,31 @@ static int ardbeg_ar0330_front_power_on(struct ar0330_power_rail *pw)
{
int err;
- if (unlikely(WARN_ON(!pw || !pw->avdd || !pw->iovdd || !pw->dvdd)))
+ if (unlikely(WARN_ON(!pw || !pw->avdd || !pw->iovdd)))
return -EFAULT;
- pr_info("!!! mach-tegra front power on\n");
/* disable CSIE IOs DPD mode to turn on front camera for ardbeg */
tegra_io_dpd_disable(&csie_io);
- if (ardbeg_get_extra_regulators())
- goto ardbeg_ar0330_front_poweron_fail;
-
- gpio_set_value(CAM_RSTN, 0);
- gpio_set_value(CAM_AF_PWDN, 1);
-
-
- err = regulator_enable(ardbeg_vcmvdd);
- if (unlikely(err))
- goto ar0330_front_vcm_fail;
+ gpio_set_value(CAM2_PWDN, 0);
- err = regulator_enable(pw->dvdd);
+ err = regulator_enable(pw->iovdd);
if (unlikely(err))
- goto ar0330_front_dvdd_fail;
+ goto ar0330_front_iovdd_fail;
+ usleep_range(1000, 1100);
err = regulator_enable(pw->avdd);
if (unlikely(err))
goto ar0330_front_avdd_fail;
- err = regulator_enable(pw->iovdd);
- if (unlikely(err))
- goto ar0330_front_iovdd_fail;
-
usleep_range(1, 2);
gpio_set_value(CAM2_PWDN, 1);
- gpio_set_value(CAM_RSTN, 1);
-
return 0;
-ar0330_front_iovdd_fail:
- regulator_disable(pw->dvdd);
-
-ar0330_front_dvdd_fail:
- regulator_disable(pw->avdd);
-
ar0330_front_avdd_fail:
- regulator_disable(ardbeg_vcmvdd);
-
-ar0330_front_vcm_fail:
- pr_err("%s vcmvdd failed.\n", __func__);
- return -ENODEV;
+ regulator_disable(pw->iovdd);
-ardbeg_ar0330_front_poweron_fail:
+ar0330_front_iovdd_fail:
/* put CSIE IOs into DPD mode to save additional power for ardbeg */
tegra_io_dpd_enable(&csie_io);
pr_err("%s failed.\n", __func__);
@@ -358,8 +333,7 @@ ardbeg_ar0330_front_poweron_fail:
static int ardbeg_ar0330_front_power_off(struct ar0330_power_rail *pw)
{
- if (unlikely(WARN_ON(!pw || !pw->avdd || !pw->iovdd || !pw->dvdd ||
- !ardbeg_vcmvdd))) {
+ if (unlikely(WARN_ON(!pw || !pw->avdd || !pw->iovdd))) {
/* put CSIE IOs into DPD mode to
* save additional power for ardbeg
*/
@@ -367,14 +341,12 @@ static int ardbeg_ar0330_front_power_off(struct ar0330_power_rail *pw)
return -EFAULT;
}
- gpio_set_value(CAM_RSTN, 0);
+ gpio_set_value(CAM2_PWDN, 0);
usleep_range(1, 2);
regulator_disable(pw->iovdd);
- regulator_disable(pw->dvdd);
regulator_disable(pw->avdd);
- regulator_disable(ardbeg_vcmvdd);
/* put CSIE IOs into DPD mode to save additional power for ardbeg */
tegra_io_dpd_enable(&csie_io);
return 0;
@@ -384,64 +356,39 @@ struct ar0330_platform_data ardbeg_ar0330_front_data = {
.power_on = ardbeg_ar0330_front_power_on,
.power_off = ardbeg_ar0330_front_power_off,
.dev_name = "ar0330.1",
- .mclk_name = "mclk",
+ .mclk_name = "mclk2",
};
static int ardbeg_ar0330_power_on(struct ar0330_power_rail *pw)
{
int err;
- if (unlikely(WARN_ON(!pw || !pw->avdd || !pw->iovdd || !pw->dvdd)))
+ if (unlikely(WARN_ON(!pw || !pw->avdd || !pw->iovdd)))
return -EFAULT;
- pr_info("!!! mach-tegra rear power on\n");
/* disable CSIE IOs DPD mode to turn on front camera for ardbeg */
tegra_io_dpd_disable(&csia_io);
tegra_io_dpd_disable(&csib_io);
- if (ardbeg_get_extra_regulators())
- goto ardbeg_ar0330_poweron_fail;
-
- gpio_set_value(CAM_RSTN, 0);
- gpio_set_value(CAM_AF_PWDN, 1);
-
-
- err = regulator_enable(ardbeg_vcmvdd);
- if (unlikely(err))
- goto ar0330_vcm_fail;
+ gpio_set_value(CAM1_PWDN, 0);
- err = regulator_enable(pw->dvdd);
+ err = regulator_enable(pw->iovdd);
if (unlikely(err))
- goto ar0330_dvdd_fail;
+ goto ar0330_iovdd_fail;
+ usleep_range(1000, 1100);
err = regulator_enable(pw->avdd);
if (unlikely(err))
goto ar0330_avdd_fail;
- err = regulator_enable(pw->iovdd);
- if (unlikely(err))
- goto ar0330_iovdd_fail;
-
usleep_range(1, 2);
- gpio_set_value(CAM2_PWDN, 1);
-
- gpio_set_value(CAM_RSTN, 1);
+ gpio_set_value(CAM1_PWDN, 1);
return 0;
-ar0330_iovdd_fail:
- regulator_disable(pw->dvdd);
-
-ar0330_dvdd_fail:
- regulator_disable(pw->avdd);
-
ar0330_avdd_fail:
- regulator_disable(ardbeg_vcmvdd);
-
-ar0330_vcm_fail:
- pr_err("%s vcmvdd failed.\n", __func__);
- return -ENODEV;
+ regulator_disable(pw->iovdd);
-ardbeg_ar0330_poweron_fail:
+ar0330_iovdd_fail:
/* put CSIE IOs into DPD mode to save additional power for ardbeg */
tegra_io_dpd_enable(&csia_io);
tegra_io_dpd_enable(&csib_io);
@@ -451,8 +398,7 @@ ardbeg_ar0330_poweron_fail:
static int ardbeg_ar0330_power_off(struct ar0330_power_rail *pw)
{
- if (unlikely(WARN_ON(!pw || !pw->avdd || !pw->iovdd || !pw->dvdd ||
- !ardbeg_vcmvdd))) {
+ if (unlikely(WARN_ON(!pw || !pw->avdd || !pw->iovdd))) {
/* put CSIE IOs into DPD mode to
* save additional power for ardbeg
*/
@@ -461,14 +407,12 @@ static int ardbeg_ar0330_power_off(struct ar0330_power_rail *pw)
return -EFAULT;
}
- gpio_set_value(CAM_RSTN, 0);
+ gpio_set_value(CAM1_PWDN, 0);
usleep_range(1, 2);
regulator_disable(pw->iovdd);
- regulator_disable(pw->dvdd);
regulator_disable(pw->avdd);
- regulator_disable(ardbeg_vcmvdd);
/* put CSIE IOs into DPD mode to save additional power for ardbeg */
tegra_io_dpd_enable(&csia_io);
tegra_io_dpd_enable(&csib_io);
diff --git a/drivers/media/platform/tegra/ar0330.c b/drivers/media/platform/tegra/ar0330.c
index cb16a2faaf00..dd612d08bc87 100644
--- a/drivers/media/platform/tegra/ar0330.c
+++ b/drivers/media/platform/tegra/ar0330.c
@@ -1262,7 +1262,6 @@ static int ar0330_power_get(struct ar0330_info *info)
err |= ar0330_regulator_get(info, &pw->avdd, "vana"); /* ananlog 2.7v */
err |= ar0330_regulator_get(info, &pw->dvdd, "vdig"); /* digital 1.2v */
err |= ar0330_regulator_get(info, &pw->iovdd, "vif"); /* IO 1.8v */
- err |= ar0330_regulator_get(info, &pw->vdd_af, "avdd_af1_cam"); /* IO 1.8v */
return err;
}
diff --git a/include/media/ar0330.h b/include/media/ar0330.h
index 1af6ea44917b..3451e81c7764 100644
--- a/include/media/ar0330.h
+++ b/include/media/ar0330.h
@@ -69,7 +69,6 @@ struct ar0330_power_rail {
struct regulator *dvdd;
struct regulator *avdd;
struct regulator *iovdd;
- struct regulator *vdd_af;
};
struct ar0330_platform_data {