/*
* arch/arm/mach-tegra/board-ardbeg-sensors.c
*
- * Copyright (c) 2013, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2013-2014, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
if (unlikely(WARN_ON(!pw || !pw->avdd || !pw->iovdd)))
return -EFAULT;
+ /* disable CSIE IOs DPD mode to turn on front camera for ardbeg */
+ tegra_io_dpd_disable(&csie_io);
+
gpio_set_value(CAM2_PWDN, 0);
usleep_range(1000, 1020);
regulator_disable(pw->avdd);
ov7695_avdd_fail:
-
gpio_set_value(CAM_RSTN, 0);
+ /* put CSIE IOs into DPD mode to save additional power for ardbeg */
+ tegra_io_dpd_enable(&csie_io);
return -ENODEV;
}
static int ardbeg_ov7695_power_off(struct ov7695_power_rail *pw)
{
- if (unlikely(WARN_ON(!pw || !pw->avdd || !pw->iovdd)))
+ if (unlikely(WARN_ON(!pw || !pw->avdd || !pw->iovdd))) {
+ /* put CSIE IOs into DPD mode to
+ * save additional power for ardbeg
+ */
+ tegra_io_dpd_enable(&csie_io);
return -EFAULT;
+ }
usleep_range(100, 120);
gpio_set_value(CAM2_PWDN, 0);
usleep_range(100, 120);
regulator_disable(pw->avdd);
+
+ /* put CSIE IOs into DPD mode to save additional power for ardbeg */
+ tegra_io_dpd_enable(&csie_io);
return 0;
}
if (unlikely(!pw || !pw->avdd || !pw->iovdd))
return -EFAULT;
+ /* disable CSIE IOs DPD mode to turn on front camera for ardbeg */
+ tegra_io_dpd_disable(&csie_io);
+
gpio_set_value(CAM_RSTN, 0);
gpio_set_value(CAM2_PWDN, 1);
usleep_range(1000, 1020);
mt9m114_iovdd_fail:
gpio_set_value(CAM_RSTN, 0);
+ /* put CSIE IOs into DPD mode to save additional power for ardbeg */
+ tegra_io_dpd_enable(&csie_io);
return -ENODEV;
}
static int ardbeg_mt9m114_power_off(struct mt9m114_power_rail *pw)
{
- if (unlikely(!pw || !pw->avdd || !pw->iovdd))
+ if (unlikely(!pw || !pw->avdd || !pw->iovdd)) {
+ /* put CSIE IOs into DPD mode to
+ * save additional power for ardbeg
+ */
+ tegra_io_dpd_enable(&csie_io);
return -EFAULT;
+ }
usleep_range(100, 120);
gpio_set_value(CAM_RSTN, 0);
usleep_range(100, 120);
regulator_disable(pw->iovdd);
+ /* put CSIE IOs into DPD mode to save additional power for ardbeg */
+ tegra_io_dpd_enable(&csie_io);
return 1;
}
if (unlikely(WARN_ON(!pw || !pw->dovdd || !pw->avdd)))
return -EFAULT;
+ /* disable CSIA/B IOs DPD mode to turn on camera for ardbeg */
+ tegra_io_dpd_disable(&csia_io);
+ tegra_io_dpd_disable(&csib_io);
+
if (ardbeg_get_extra_regulators())
goto ov5693_poweron_fail;
gpio_set_value(CAM1_PWDN, 0);
ov5693_poweron_fail:
+ /* put CSIA/B IOs into DPD mode to save additional power for ardbeg */
+ tegra_io_dpd_enable(&csia_io);
+ tegra_io_dpd_enable(&csib_io);
pr_err("%s FAILED\n", __func__);
return -ENODEV;
}
static int ardbeg_ov5693_power_off(struct ov5693_power_rail *pw)
{
- if (unlikely(WARN_ON(!pw || !pw->dovdd || !pw->avdd)))
+ if (unlikely(WARN_ON(!pw || !pw->dovdd || !pw->avdd))) {
+ /* put CSIA/B IOs into DPD mode to
+ * save additional power for ardbeg
+ */
+ tegra_io_dpd_enable(&csia_io);
+ tegra_io_dpd_enable(&csib_io);
return -EFAULT;
+ }
usleep_range(21, 25);
gpio_set_value(CAM1_PWDN, 0);
regulator_disable(pw->dovdd);
regulator_disable(pw->avdd);
+ /* put CSIA/B IOs into DPD mode to save additional power for ardbeg */
+ tegra_io_dpd_enable(&csia_io);
+ tegra_io_dpd_enable(&csib_io);
return 0;
}
{
pr_debug("%s: ++\n", __func__);
- if (!of_machine_is_compatible("nvidia,tn8")) {
- /* put CSIA/B/E IOs into DPD mode to
- * save additional power for ardbeg
- */
- tegra_io_dpd_enable(&csia_io);
- tegra_io_dpd_enable(&csib_io);
- tegra_io_dpd_enable(&csie_io);
- }
+ /* put CSIA/B/E IOs into DPD mode to
+ * save additional power for ardbeg
+ */
+ tegra_io_dpd_enable(&csia_io);
+ tegra_io_dpd_enable(&csib_io);
+ tegra_io_dpd_enable(&csie_io);
platform_device_add_data(&ardbeg_camera_generic,
&ardbeg_pcl_pdata, sizeof(ardbeg_pcl_pdata));
/*
* arch/arm/mach-tegra/board-loki-sensors.c
*
- * Copyright (c) 2013, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2013-2014, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
#include <media/ov7695.h>
#include <mach/gpio-tegra.h>
#include <mach/edp.h>
+#include <mach/io_dpd.h>
#include <linux/gpio.h>
#include <linux/therm_est.h>
#include <linux/iio/light/jsa1127.h>
ARRAY_SIZE(loki_i2c_jsa1127_board_info));
}
+static struct tegra_io_dpd csia_io = {
+ .name = "CSIA",
+ .io_dpd_reg_index = 0,
+ .io_dpd_bit = 0,
+};
+
+static struct tegra_io_dpd csib_io = {
+ .name = "CSIB",
+ .io_dpd_reg_index = 0,
+ .io_dpd_bit = 1,
+};
+
+static struct tegra_io_dpd csie_io = {
+ .name = "CSIE",
+ .io_dpd_reg_index = 1,
+ .io_dpd_bit = 12,
+};
+
static int loki_mt9m114_power_on(struct mt9m114_power_rail *pw)
{
int err;
if (unlikely(!pw || !pw->avdd || !pw->iovdd))
return -EFAULT;
+ /* disable CSIA IOs DPD mode to turn on front camera for ardbeg */
+ tegra_io_dpd_disable(&csia_io);
+
gpio_set_value(CAM_RSTN, 0);
gpio_set_value(CAM2_PWDN, 1);
usleep_range(1000, 1020);
mt9m114_iovdd_fail:
gpio_set_value(CAM_RSTN, 0);
+ /* put CSIA IOs into DPD mode to save additional power for ardbeg */
+ tegra_io_dpd_enable(&csia_io);
return -ENODEV;
}
static int loki_mt9m114_power_off(struct mt9m114_power_rail *pw)
{
- if (unlikely(!pw || !pw->avdd || !pw->iovdd))
+ if (unlikely(!pw || !pw->avdd || !pw->iovdd)) {
+ /* put CSIA IOs into DPD mode to
+ * save additional power for ardbeg
+ */
+ tegra_io_dpd_enable(&csia_io);
return -EFAULT;
+ }
usleep_range(100, 120);
gpio_set_value(CAM_RSTN, 0);
usleep_range(100, 120);
regulator_disable(pw->iovdd);
+ /* put CSIA IOs into DPD mode to save additional power for ardbeg */
+ tegra_io_dpd_enable(&csia_io);
return 1;
}
if (unlikely(WARN_ON(!pw || !pw->avdd || !pw->iovdd)))
return -EFAULT;
+ /* disable CSIA IOs DPD mode to turn on front camera for ardbeg */
+ tegra_io_dpd_disable(&csia_io);
+
gpio_set_value(CAM2_PWDN, 0);
usleep_range(1000, 1020);
regulator_disable(pw->avdd);
ov7695_avdd_fail:
-
gpio_set_value(CAM_RSTN, 0);
+ /* put CSIA IOs into DPD mode to save additional power for ardbeg */
+ tegra_io_dpd_enable(&csia_io);
return -ENODEV;
}
static int loki_ov7695_power_off(struct ov7695_power_rail *pw)
{
- if (unlikely(WARN_ON(!pw || !pw->avdd || !pw->iovdd)))
+ if (unlikely(WARN_ON(!pw || !pw->avdd || !pw->iovdd))) {
+ /* put CSIA IOs into DPD mode to
+ * save additional power for ardbeg
+ */
+ tegra_io_dpd_enable(&csia_io);
return -EFAULT;
+ }
+
usleep_range(100, 120);
regulator_disable(pw->iovdd);
usleep_range(100, 120);
gpio_set_value(CAM2_PWDN, 0);
+
+ /* put CSIA IOs into DPD mode to save additional power for ardbeg */
+ tegra_io_dpd_enable(&csia_io);
return 0;
}
{
pr_debug("%s: ++\n", __func__);
+ /* put CSIA/B/E IOs into DPD mode to
+ * save additional power
+ */
+ tegra_io_dpd_enable(&csia_io);
+ tegra_io_dpd_enable(&csib_io);
+ tegra_io_dpd_enable(&csie_io);
+
platform_device_add_data(&loki_camera_generic,
&loki_pcl_pdata, sizeof(loki_pcl_pdata));
platform_device_register(&loki_camera_generic);