mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-10 17:41:54 +00:00
Add some ifdefs to distinguish between Link and Slippy
I'll still need to decide what to do differently for Slippy, but for now let's just identify the places where there will likely be a difference. BUG=chrome-os-partner:18825 BRANCH=slippy TEST=manual Link still works. Change-Id: I950f0e5356ccf9838f2140d853122235f884e34f Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/49931
This commit is contained in:
committed by
ChromeBot
parent
a182372cbd
commit
9d2b32aabf
@@ -217,13 +217,18 @@ void gpio_pre_init(void)
|
||||
}
|
||||
}
|
||||
|
||||
/* List of GPIO IRQs to enable */
|
||||
/* List of GPIO IRQs to enable. Don't automatically enable interrupts for
|
||||
* the keyboard input GPIO bank - that's handled separately. Of course the
|
||||
* bank is different for different systems. */
|
||||
static const uint8_t gpio_irqs[] = {
|
||||
LM4_IRQ_GPIOA, LM4_IRQ_GPIOB, LM4_IRQ_GPIOC, LM4_IRQ_GPIOD,
|
||||
LM4_IRQ_GPIOE, LM4_IRQ_GPIOF, LM4_IRQ_GPIOG, LM4_IRQ_GPIOH,
|
||||
LM4_IRQ_GPIOJ, LM4_IRQ_GPIOK, LM4_IRQ_GPIOL, LM4_IRQ_GPIOM,
|
||||
LM4_IRQ_GPIOJ,
|
||||
#if defined(KB_SCAN_ROW_IRQ) && (KB_SCAN_ROW_IRQ != LM4_IRQ_GPIOK)
|
||||
LM4_IRQ_GPIOK,
|
||||
#endif
|
||||
LM4_IRQ_GPIOL, LM4_IRQ_GPIOM,
|
||||
#if defined(KB_SCAN_ROW_IRQ) && (KB_SCAN_ROW_IRQ != LM4_IRQ_GPION)
|
||||
/* Don't enable interrupts for the keyboard input GPIO bank */
|
||||
LM4_IRQ_GPION,
|
||||
#endif
|
||||
LM4_IRQ_GPIOP, LM4_IRQ_GPIOQ
|
||||
@@ -280,7 +285,9 @@ GPIO_IRQ_FUNC(__gpio_f_interrupt, LM4_GPIO_F);
|
||||
GPIO_IRQ_FUNC(__gpio_g_interrupt, LM4_GPIO_G);
|
||||
GPIO_IRQ_FUNC(__gpio_h_interrupt, LM4_GPIO_H);
|
||||
GPIO_IRQ_FUNC(__gpio_j_interrupt, LM4_GPIO_J);
|
||||
#if defined(KB_SCAN_ROW_GPIO) && (KB_SCAN_ROW_GPIO != LM4_GPIO_K)
|
||||
GPIO_IRQ_FUNC(__gpio_k_interrupt, LM4_GPIO_K);
|
||||
#endif
|
||||
GPIO_IRQ_FUNC(__gpio_l_interrupt, LM4_GPIO_L);
|
||||
GPIO_IRQ_FUNC(__gpio_m_interrupt, LM4_GPIO_M);
|
||||
#if defined(KB_SCAN_ROW_GPIO) && (KB_SCAN_ROW_GPIO != LM4_GPIO_N)
|
||||
@@ -304,7 +311,9 @@ DECLARE_IRQ(LM4_IRQ_GPIOF, __gpio_f_interrupt, 1);
|
||||
DECLARE_IRQ(LM4_IRQ_GPIOG, __gpio_g_interrupt, 1);
|
||||
DECLARE_IRQ(LM4_IRQ_GPIOH, __gpio_h_interrupt, 1);
|
||||
DECLARE_IRQ(LM4_IRQ_GPIOJ, __gpio_j_interrupt, 1);
|
||||
#if defined(KB_SCAN_ROW_GPIO) && (KB_SCAN_ROW_GPIO != LM4_GPIO_K)
|
||||
DECLARE_IRQ(LM4_IRQ_GPIOK, __gpio_k_interrupt, 1);
|
||||
#endif
|
||||
DECLARE_IRQ(LM4_IRQ_GPIOL, __gpio_l_interrupt, 1);
|
||||
DECLARE_IRQ(LM4_IRQ_GPIOM, __gpio_m_interrupt, 1);
|
||||
#if defined(KB_SCAN_ROW_GPIO) && (KB_SCAN_ROW_GPIO != LM4_GPIO_N)
|
||||
|
||||
@@ -238,7 +238,7 @@ exit:
|
||||
*/
|
||||
static void configure_gpio(void)
|
||||
{
|
||||
#ifdef BOARD_link
|
||||
#ifdef BOARD_link /* HEY: Slippy? */
|
||||
/* PA6:7 = I2C1 SCL/SDA; PB2:3 = I2C0 SCL/SDA; PB6:7 = I2C5 SCL/SDA */
|
||||
gpio_set_alternate_function(LM4_GPIO_A, 0xc0, 3);
|
||||
gpio_set_alternate_function(LM4_GPIO_B, 0xcc, 3);
|
||||
|
||||
@@ -47,7 +47,7 @@ struct pwm_fan_state {
|
||||
*/
|
||||
static void configure_fan_gpios(void)
|
||||
{
|
||||
/* HEY: this is Link only */
|
||||
/* HEY: this is Link only. Slippy is PM2:3 */
|
||||
/* PM6:7 alternate function 1 = channel 0 PWM/tach */
|
||||
gpio_set_alternate_function(LM4_GPIO_M, 0xc0, 1);
|
||||
}
|
||||
@@ -164,8 +164,10 @@ static int command_fan_info(int argc, char **argv)
|
||||
(LM4_FAN_FANSTS >> (2 * FAN_CH_CPU)) & 0x03);
|
||||
ccprintf("Mode: %s\n", pwm_get_rpm_mode() ? "rpm" : "duty");
|
||||
ccprintf("Enable: %s\n", pwm_get_fan_enabled() ? "yes" : "no");
|
||||
#ifdef BOARD_link /* HEY: Slippy? */
|
||||
ccprintf("Power: %s\n",
|
||||
gpio_get_level(GPIO_PGOOD_5VALW) ? "yes" : "no");
|
||||
#endif
|
||||
|
||||
return EC_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -550,12 +550,14 @@ DECLARE_HOST_COMMAND(EC_CMD_SWITCH_ENABLE_BKLIGHT,
|
||||
|
||||
static int switch_command_enable_wireless(struct host_cmd_handler_args *args)
|
||||
{
|
||||
#ifdef BOARD_link /* HEY: Slippy? */
|
||||
const struct ec_params_switch_enable_wireless *p = args->params;
|
||||
|
||||
gpio_set_level(GPIO_RADIO_ENABLE_WLAN,
|
||||
p->enabled & EC_WIRELESS_SWITCH_WLAN);
|
||||
gpio_set_level(GPIO_RADIO_ENABLE_BT,
|
||||
p->enabled & EC_WIRELESS_SWITCH_BLUETOOTH);
|
||||
#endif
|
||||
|
||||
return EC_RES_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -341,6 +341,8 @@ void system_pre_init(void)
|
||||
|
||||
check_reset_cause();
|
||||
|
||||
/* HEY: read LM4_SYSTEM_BOOTCFG bit 4 to determine WRKEY value */
|
||||
|
||||
/* Initialize bootcfg if needed */
|
||||
if (LM4_SYSTEM_BOOTCFG != BOOTCFG_VALUE) {
|
||||
LM4_FLASH_FMD = BOOTCFG_VALUE;
|
||||
|
||||
@@ -437,7 +437,7 @@ int system_get_board_version(void)
|
||||
{
|
||||
int v = 0;
|
||||
|
||||
#ifdef BOARD_link
|
||||
#ifdef BOARD_link /* HEY: Slippy? */
|
||||
if (gpio_get_level(GPIO_BOARD_VERSION1))
|
||||
v |= 0x01;
|
||||
if (gpio_get_level(GPIO_BOARD_VERSION2))
|
||||
|
||||
Reference in New Issue
Block a user