#include <mach/irqs.h>
+#include "board-stingray.h"
#include "gpio-names.h"
static struct cpcap_device *cpcap_di;
.cpcap_duty_cycle = 0x2A0,
.cpcap_current = 0x0,
.class_name = LD_DISP_BUTTON_DEV,
- .led_regulator = "sw5",
};
static struct platform_device cpcap_disp_button_led = {
.cpcap_duty_cycle = 0x41,
.cpcap_current = 0x0,
.class_name = LD_PRIVACY_LED_DEV,
- .led_regulator = "sw5",
};
static struct platform_device cpcap_privacy_led = {
.min_uV = 5050000,
.max_uV = 5050000,
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
- .boot_on = 1, /* Temporary for M1 */
.apply_uV = 1,
},
.num_consumer_supplies = ARRAY_SIZE(cpcap_sw5_consumers),
{
int i;
+ if (stingray_revision() <= STINGRAY_REVISION_M1) {
+ cpcap_regulator[CPCAP_SW5].constraints.boot_on = 1;
+
+ stingray_display_led.led_regulator = "sw5";
+ stingray_privacy_led.led_regulator = "sw5";
+ }
+
tegra_gpio_enable(TEGRA_GPIO_PT2);
gpio_request(TEGRA_GPIO_PT2, "usb_host_pwr_en");
gpio_direction_output(TEGRA_GPIO_PT2, 0);
/* bq24617 charger */
static struct resource bq24617_resources[] = {
+ [0] = {
+ .name = "stat1",
+ .flags = IORESOURCE_IRQ,
+ .start = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_PV5),
+ .end = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_PV5),
+ },
+ [1] = {
+ .name = "stat2",
+ .flags = IORESOURCE_IRQ,
+ .start = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_PD1),
+ .end = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_PD1),
+ },
+ [2] = {
+ .name = "detect",
+ .flags = IORESOURCE_IRQ,
+ .start = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_PV6),
+ .end = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_PV6),
+ },
+};
+
+static struct resource bq24617_resources_m1_p0[] = {
[0] = {
.name = "stat1",
.flags = IORESOURCE_IRQ,
/* Enable charging */
tegra_gpio_enable(TEGRA_GPIO_PV5);
tegra_gpio_enable(TEGRA_GPIO_PV6);
- tegra_gpio_enable(TEGRA_GPIO_PJ0);
- gpio_request(TEGRA_GPIO_PJ0, "chg_disable");
- gpio_direction_output(TEGRA_GPIO_PJ0, 0);
+ if (stingray_revision() <= STINGRAY_REVISION_P0) {
+ bq24617_device.resource = bq24617_resources_m1_p0;
+
+ tegra_gpio_enable(TEGRA_GPIO_PJ0);
+ gpio_request(TEGRA_GPIO_PJ0, "chg_disable");
+ gpio_direction_output(TEGRA_GPIO_PJ0, 0);
+ } else
+ tegra_gpio_enable(TEGRA_GPIO_PD1);
stingray_pinmux_init();