};
static struct regulator_consumer_supply palmas_ldo4_supply[] = {
+ REGULATOR_SUPPLY("vdd_1v2_cam", NULL),
+ REGULATOR_SUPPLY("dvdd", "2-0010"),
+ REGULATOR_SUPPLY("vdig", "2-0036"),
};
static struct regulator_consumer_supply palmas_ldo5_supply[] = {
+ REGULATOR_SUPPLY("avdd_cam2", NULL),
+ REGULATOR_SUPPLY("avdd", "2-0010"),
};
static struct regulator_consumer_supply palmas_ldo6_supply[] = {
};
static struct regulator_consumer_supply palmas_ldo7_supply[] = {
+ REGULATOR_SUPPLY("avdd_2v8_cam_af", NULL),
REGULATOR_SUPPLY("vdd_af_cam1", NULL),
+ REGULATOR_SUPPLY("avdd_cam1", NULL),
+ REGULATOR_SUPPLY("vana", "2-0036"),
+ REGULATOR_SUPPLY("vdd", "2-000e"),
};
+
static struct regulator_consumer_supply palmas_ldo8_supply[] = {
REGULATOR_SUPPLY("vdd_rtc", NULL),
};
PALMAS_PDATA_INIT(ldo7, 2700, 2700, palmas_rails(smps9), 0, 0, 1);
PALMAS_PDATA_INIT(ldo8, 1100, 1100, NULL, 1, 1, 1);
PALMAS_PDATA_INIT(ldo9, 1800, 2900, palmas_rails(smps9), 0, 0, 1);
-PALMAS_PDATA_INIT(ldoln, 3300, 3300, NULL, 0, 0, 1);
+PALMAS_PDATA_INIT(ldoln, 3300, 3300, NULL, 0, 0, 1);
PALMAS_PDATA_INIT(ldousb, 3300, 3300, NULL, 0, 0, 1);
PALMAS_PDATA_INIT(regen1, 4200, 4200, NULL, 0, 0, 0);
PALMAS_PDATA_INIT(regen2, 4200, 4200, palmas_rails(smps8), 0, 0, 0);
REGULATOR_SUPPLY("vddio_sd_slot", "sdhci-tegra.2"),
};
+static struct regulator_consumer_supply fixed_reg_vd_cam_1v8_supply[] = {
+ REGULATOR_SUPPLY("vdd_cam_1v8", NULL),
+ REGULATOR_SUPPLY("vi2c", "2-0030"),
+ REGULATOR_SUPPLY("vif", "2-0036"),
+ REGULATOR_SUPPLY("dovdd", "2-0010"),
+ REGULATOR_SUPPLY("vdd_i2c", "2-000e"),
+};
/* Macro for defining fixed regulator sub device data */
#define FIXED_SUPPLY(_name) "fixed_reg_"#_name
palmas_rails(smps9), 0, 0,
TEGRA_GPIO_PK1, false, true, 0, 2900);
+FIXED_REG(6, vd_cam_1v8, vd_cam_1v8,
+ palmas_rails(smps8), 0, 0,
+ PALMAS_TEGRA_GPIO_BASE + PALMAS_GPIO6, false, true, 0, 1800);
+
#define ADD_FIXED_REG(_name) (&fixed_reg_##_name##_dev)
/* Gpio switch regulator platform data for Macallan E1545 */
ADD_FIXED_REG(dvdd_ts),
ADD_FIXED_REG(vdd_hdmi_5v0),
ADD_FIXED_REG(vddio_sd_slot),
+ ADD_FIXED_REG(vd_cam_1v8),
};
static struct nvc_gpio_pdata imx091_gpio_pdata[] = {
{IMX091_GPIO_RESET, CAM_RSTN, true, false},
{IMX091_GPIO_PWDN, CAM1_POWER_DWN_GPIO, true, false},
- {IMX091_GPIO_GP1, CAM_GPIO1, true, false}
};
static struct board_info board_info;
static struct tegra_pingroup_config pbb0_enable =
VI_PINMUX(GPIO_PBB0, VI_ALT3, NORMAL, NORMAL, OUTPUT, DEFAULT, DEFAULT);
-/*
- * As a workaround, macallan_vcmvdd need to be allocated to activate the
- * sensor devices. This is due to the focuser device(AD5816) will hook up
- * the i2c bus if it is not powered up.
-*/
-static struct regulator *macallan_vcmvdd;
-
-static int macallan_get_vcmvdd(void)
-{
- if (!macallan_vcmvdd) {
- macallan_vcmvdd = regulator_get(NULL, "vdd_af_cam1");
- if (unlikely(WARN_ON(IS_ERR(macallan_vcmvdd)))) {
- pr_err("%s: can't get regulator vcmvdd: %ld\n",
- __func__, PTR_ERR(macallan_vcmvdd));
- macallan_vcmvdd = NULL;
- return -ENODEV;
- }
- }
- return 0;
-}
-
static int macallan_imx091_power_on(struct nvc_regulator *vreg)
{
int err;
if (unlikely(WARN_ON(!vreg)))
return -EFAULT;
- if (macallan_get_vcmvdd())
- goto imx091_poweron_fail;
-
gpio_set_value(CAM1_POWER_DWN_GPIO, 0);
usleep_range(10, 20);
usleep_range(1, 2);
gpio_set_value(CAM1_POWER_DWN_GPIO, 1);
- err = regulator_enable(macallan_vcmvdd);
- if (unlikely(err))
- goto imx091_vcmvdd_fail;
-
tegra_pinmux_config_table(&mclk_enable, 1);
usleep_range(300, 310);
return 1;
-imx091_vcmvdd_fail:
- regulator_disable(vreg[IMX091_VREG_IOVDD].vreg);
-
imx091_iovdd_fail:
regulator_disable(vreg[IMX091_VREG_AVDD].vreg);
imx091_avdd_fail:
gpio_set_value(CAM1_POWER_DWN_GPIO, 0);
-imx091_poweron_fail:
pr_err("%s FAILED\n", __func__);
return -ENODEV;
}
gpio_set_value(CAM1_POWER_DWN_GPIO, 0);
usleep_range(1, 2);
- regulator_disable(macallan_vcmvdd);
regulator_disable(vreg[IMX091_VREG_IOVDD].vreg);
regulator_disable(vreg[IMX091_VREG_AVDD].vreg);
if (unlikely(!pw || !pw->avdd || !pw->dovdd))
return -EFAULT;
- if (macallan_get_vcmvdd())
- goto ov9772_get_vcmvdd_fail;
-
gpio_set_value(CAM2_POWER_DWN_GPIO, 0);
gpio_set_value(CAM_RSTN, 0);
gpio_set_value(CAM_RSTN, 1);
gpio_set_value(CAM2_POWER_DWN_GPIO, 1);
- err = regulator_enable(macallan_vcmvdd);
- if (unlikely(err))
- goto ov9772_vcmvdd_fail;
-
tegra_pinmux_config_table(&pbb0_enable, 1);
usleep_range(340, 380);
/* return 1 to skip the in-driver power_on sequence */
return 1;
-ov9772_vcmvdd_fail:
- regulator_disable(pw->dovdd);
-
ov9772_dovdd_fail:
regulator_disable(pw->avdd);
gpio_set_value(CAM_RSTN, 0);
gpio_set_value(CAM2_POWER_DWN_GPIO, 0);
-ov9772_get_vcmvdd_fail:
pr_err("%s FAILED\n", __func__);
return -ENODEV;
}
static int macallan_ov9772_power_off(struct ov9772_power_rail *pw)
{
- if (unlikely(!pw || !macallan_vcmvdd || !pw->avdd || !pw->dovdd))
+ if (unlikely(!pw || !pw->avdd || !pw->dovdd))
return -EFAULT;
usleep_range(21, 25);
gpio_set_value(CAM2_POWER_DWN_GPIO, 0);
gpio_set_value(CAM_RSTN, 0);
- regulator_disable(macallan_vcmvdd);
regulator_disable(pw->dovdd);
regulator_disable(pw->avdd);
.power_off = macallan_ov9772_power_off,
};
-static int macallan_as3648_power_on(struct as364x_power_rail *pw)
-{
- int err = macallan_get_vcmvdd();
-
- if (err)
- return err;
-
- return regulator_enable(macallan_vcmvdd);
-}
-
-static int macallan_as3648_power_off(struct as364x_power_rail *pw)
-{
- if (!macallan_vcmvdd)
- return -ENODEV;
-
- return regulator_disable(macallan_vcmvdd);
-}
-
static struct as364x_platform_data macallan_as3648_pdata = {
.config = {
.led_mask = 3,
.dev_name = "torch",
.type = AS3648,
.gpio_strobe = CAM_FLASH_STROBE,
-
- .power_on_callback = macallan_as3648_power_on,
- .power_off_callback = macallan_as3648_power_off,
};
static struct ad5816_platform_data macallan_ad5816_pdata = {