mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-30 18:41:11 +00:00
Lars: Add PWM keyboard backlight support
+ pwm settings BUG=None BRANCH=lars TEST=`make BOARD=lars -j`, OS can boot up normally Change-Id: I8703261736802a81323077a85262da7d7a80cbc1 Signed-off-by: Ryan Zhang <Ryan.Zhang@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/315911 Reviewed-by: Shawn N <shawnn@chromium.org>
This commit is contained in:
@@ -26,6 +26,8 @@
|
||||
#include "pi3usb9281.h"
|
||||
#include "power.h"
|
||||
#include "power_button.h"
|
||||
#include "pwm.h"
|
||||
#include "pwm_chip.h"
|
||||
#include "spi.h"
|
||||
#include "switch.h"
|
||||
#include "system.h"
|
||||
@@ -103,6 +105,12 @@ const struct adc_t adc_channels[] = {
|
||||
};
|
||||
BUILD_ASSERT(ARRAY_SIZE(adc_channels) == ADC_CH_COUNT);
|
||||
|
||||
/* PWM channels. Must be in the exactly same order as in enum pwm_channel. */
|
||||
const struct pwm_t pwm_channels[] = {
|
||||
{1, 0},
|
||||
};
|
||||
BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT);
|
||||
|
||||
const struct i2c_port_t i2c_ports[] = {
|
||||
{"pmic", MEC1322_I2C0_0, 400, GPIO_I2C0_0_SCL, GPIO_I2C0_0_SDA},
|
||||
{"muxes", MEC1322_I2C0_1, 400, GPIO_I2C0_1_SCL, GPIO_I2C0_1_SDA},
|
||||
|
||||
@@ -59,6 +59,8 @@
|
||||
#define CONFIG_POWER_BUTTON_X86
|
||||
#define CONFIG_POWER_COMMON
|
||||
#define CONFIG_POWER_SHUTDOWN_PAUSE_IN_S5
|
||||
#define CONFIG_PWM
|
||||
#define CONFIG_PWM_KBLIGHT
|
||||
/* All data won't fit in data RAM. So, moving boundary slightly. */
|
||||
#undef CONFIG_RO_SIZE
|
||||
#define CONFIG_RO_SIZE (104 * 1024)
|
||||
@@ -150,6 +152,12 @@ enum als_id {
|
||||
ALS_COUNT,
|
||||
};
|
||||
|
||||
enum pwm_channel {
|
||||
PWM_CH_KBLIGHT,
|
||||
/* Number of PWM channels */
|
||||
PWM_CH_COUNT,
|
||||
};
|
||||
|
||||
/* power signal definitions */
|
||||
enum power_signal {
|
||||
X86_RSMRST_L_PWRGD = 0,
|
||||
|
||||
@@ -50,7 +50,6 @@ GPIO(WLAN_OFF_L, PIN(132), GPIO_OUT_HIGH) /* Empty */
|
||||
GPIO(PWRLED_L, PIN(133), GPIO_OUT_LOW)
|
||||
/* RCIN# line to PCH for 8042 emulation */
|
||||
GPIO(PCH_RCIN_L, PIN(135), GPIO_ODR_HIGH)
|
||||
GPIO(NC_136, PIN(136), GPIO_INPUT | GPIO_PULL_UP)
|
||||
GPIO(LDO_EN, PIN(211), GPIO_OUT_LOW)
|
||||
GPIO(NC_145, PIN(145), GPIO_INPUT | GPIO_PULL_UP)
|
||||
GPIO(NC_147, PIN(147), GPIO_INPUT | GPIO_PULL_UP)
|
||||
@@ -140,6 +139,9 @@ ALTERNATE(PIN_MASK(14, 0x01), 3, MODULE_PWM, 0)
|
||||
/* TACH2PWM_OUT - GPIO034 */
|
||||
ALTERNATE(PIN_MASK(3, 0x10), 3, MODULE_PWM, 0)
|
||||
|
||||
/* PWM for KBLight */
|
||||
ALTERNATE(PIN_MASK(13, 0x40), 1, MODULE_PWM_KBLIGHT, 0) /* GP136 PWM1 */
|
||||
|
||||
/* ADC pins */
|
||||
/* ADC1 - GPIO057 / PPVAR_BOOSTIN_SENSE */
|
||||
ALTERNATE(PIN_MASK(5, 0x80), 1, MODULE_ADC, GPIO_ANALOG)
|
||||
|
||||
Reference in New Issue
Block a user