type
stringclasses
5 values
content
stringlengths
9
163k
defines
#define GPIO016_CHG_SCL (GPIO016_GPIO_16 | MFP_PULL_HIGH | MFP_LPM_DRIVE_HIGH)
defines
#define GPIO017_CHG_SDA (GPIO017_GPIO_17 | MFP_PULL_HIGH | MFP_LPM_DRIVE_HIGH)
defines
#define GPIO_GPS_TIMER_SYNC ANT_SW4_GPIO_28
defines
#define GPIO_RF_PDET_EN SM_ADV_GPIO_0 | MFP_LPM_FLOAT
defines
#define GPIO_LCD_RESET_N ND_RDY1_GPIO_1
defines
#define GPIO_LED_B_CTRL SM_ADVMUX_GPIO_2
defines
#define GPIO_LED_R_CTRL SM_BEN1_GPIO_127
defines
#define GPIO_LED_G_CTRL SM_CSN0_GPIO_103
defines
#define GPIO_VCM_PWDN ND_CS1N3_GPIO_102
defines
#define GPIO043_GPIO_DVC1_Ax (GPIO043_GPIO_43_Ax | MFP_PULL_FLOAT)
defines
#define GPIO044_GPIO_DVC2_Ax (GPIO044_GPIO_44_Ax | MFP_PULL_FLOAT)
defines
#define REG_INIT(_name, _min, _max, _always, _boot) \
defines
#define mV_to_uV(v) ((v) * 1000)
defines
#define uV_to_mV(v) ((v) / 1000)
defines
#define MAX_MILLI_VOLT (3300)
defines
#define TSP_SDA mfp_to_gpio(GPIO088_GPIO_88)
defines
#define TSP_SCL mfp_to_gpio(GPIO087_GPIO_87)
defines
#define TSP_INT mfp_to_gpio(GPIO094_GPIO_94)
defines
#define CYTTSP4_I2C_NAME "cyttsp4_i2c_adapter"
defines
#define CYTTSP4_I2C_TCH_ADR 0x24
defines
#define MFP_WIB_PDn (GPIO051_GPIO_51 | MFP_PULL_FLOAT)
defines
#define MFP_WIB_RESETn (GPIO034_GPIO_34 | MFP_PULL_FLOAT)
defines
#define SIRF_STATUS_LEN 16
defines
#define PM800_SW_PDOWN (1 << 5)
structs
struct tsp_callbacks { void (*inform_charger)(struct tsp_callbacks *tsp_cb, bool mode); };
functions
__init board_id_setup(char *str) { int n; if (!get_option(&str, &n)) return 0; system_rev = board_id = n; return 1; }
functions
int get_board_id() { return board_id; }
functions
__init recovery_mode_setup(char *str) { int n; if (!get_option(&str, &n)) return 0; recovery_mode = n; return 1; }
functions
int get_recoverymode() { return recovery_mode; }
functions
void d2199_dvctable_init(void) { unsigned int *vol_table; /* dvc only support 4 lvl voltage*/ unsigned int vol_tbsize = 4; unsigned int index, max_vl, lowest_rate; //printk("[WS][DVFS][%s]\n", __func__); vol_table = kmalloc(vol_tbsize * sizeof(unsigned int), GFP_KERNEL); if (!vol_table) { pr_err("%s failed t...
functions
void mic_set_power(int on) { static int mic_power_flag = 0; struct regulator *v_ldo = regulator_get(NULL, "v_micbias"); if (IS_ERR(v_ldo)) { v_ldo = NULL; pr_err("Get regulator error\n"); return; }
functions
int sync_time_to_soc(unsigned int ticks) { RCNR = ticks; udelay(200); return 0; }
functions
int pm800_plat_config(struct pm80x_chip *chip, struct pm80x_platform_data *pdata) { int data; u8 i; if (!chip || !pdata || !chip->regmap || !chip->subchip || !chip->subchip->regmap_power) { pr_err("%s:chip or pdata is not availiable!\n", __func__); return -EINVAL; }
functions
int vibrator_control_power(int on){ static struct regulator *vib_3_3; static bool bFirst=1; static int bStatus=0; #if defined(MOTOR_LDO_POWER) if(bFirst) { //LDO Power On============= if (!vib_3_3) { vib_3_3 = regulator_get(NULL, "v_motor_3v"); if (IS_ERR(vib_3_3)) { pr_err("%s regulator get err...
functions
int pm805_plat_config(struct pm80x_chip *chip, struct pm80x_platform_data *pdata) { int data; if (!chip || !pdata || !chip->regmap) { pr_err("%s:chip or pdata is not availiable!\n", __func__); return -EINVAL; }
functions
void pm800_dvctable_init(void) { unsigned int *vol_table; /* dvc only support 4 lvl voltage*/ unsigned int vol_tbsize = 4; unsigned int index, max_vl, lowest_rate; //printk("[WS][DVFS][%s]\n", __func__); vol_table = kmalloc(vol_tbsize * sizeof(unsigned int), GFP_KERNEL); if (!vol_table) { pr_err("%s failed t...
functions
int gp2a_device_power(bool on){ static struct regulator *prox_3_0; static struct regulator *proxLed; static bool bFirst=1; static bool bStatus=0; if(bFirst) { //LDO Power On============= if (!prox_3_0) { prox_3_0 = regulator_get(NULL, "v_proxy_3v"); if (IS_ERR(prox_3_0)) { pr_err("%s regulator get ...
functions
void gp2ap030_power_onoff(bool on) { static struct regulator *prox_3_0; static bool bpFirst=1; static bool bpStatus=0; if(bpFirst) { //LDO Power On============= if (!prox_3_0) { prox_3_0 = regulator_get(NULL, "v_proxy_3v"); if (IS_ERR(prox_3_0)) { pr_err("%s regulator get error!\n", __func...
functions
void gp2ap030_led_onoff(bool on) { static struct regulator *proxLed; static bool blFirst=1; static bool blStatus=0; if(blFirst) { //LDO Power On============= if (!proxLed) { proxLed = regulator_get(NULL, "v_proxy_led_3v3"); if (IS_ERR(proxLed)) { pr_err("%s regulator get error!\n", __func__); pr...
functions
if defined(CONFIG_BQ24157_CHARGER) { .type = "bq24157_6A", .addr = 0x6A, .platform_data = &bq24157_charger_info, }
functions
if defined(CONFIG_BQ24157_CHARGER) { .type = "bq24157_6A", .gpio = mfp_to_gpio(GPIO008_GPIO_8), }
functions
void usb_attach(uint8_t attached) { if (attached) { pxa_usb_notify(PXA_USB_DEV_OTG, EVENT_VBUS, 0); }
functions
void uart_attach(uint8_t attached) { printk(attached ? "UART attached\n" : "UART detached\n"); }
functions
void charger_attach(uint8_t attached) { }
functions
void jig_attach(uint8_t attached, uint8_t factory_mode) { int usb_on = 0; switch (factory_mode) { case RTMUSC_FM_BOOT_OFF_UART: printk(KERN_INFO "JIG BOOT OFF UART\n"); break; case RTMUSC_FM_BOOT_OFF_USB: usb_on = 1; printk(KERN_INFO "JIG BOOT OFF USB\n"); break; case RTMUSC_FM_BOOT_ON_UART: printk(KER...
functions
void over_temperature(uint8_t detected) { printk(KERN_INFO "over temperature detected = %d!\n", detected); }
functions
void over_voltage(uint8_t detected) { printk(KERN_INFO "over voltage detected = %d!\n", detected); }
functions
void otg_attach(uint8_t attached) { printk(attached ? "OTG attached\n" : "OTG detached\n"); }
functions
void ret8973_reset(void) { printk(KERN_INFO "RT8973 reset\n"); }
functions
if defined(CONFIG_TOUCHSCREEN_CYPRESS_TMA46X) { I2C_BOARD_INFO(CYTTSP4_I2C_NAME, CYTTSP4_I2C_TCH_ADR), .platform_data = CYTTSP4_I2C_NAME, }
functions
void i2c_pxa_bus_reset(int i2c_adap_id) { unsigned long mfp_pin[2]; int ccnt; unsigned long scl, sda; unsigned long i2c0_mfps[] = { GPIO079_GPIO_79, /* SCL */ GPIO080_GPIO_80, /* SDA */ }
functions
else if (i2c_adap_id == 1) { scl = MFP_PIN_GPIO87; sda = MFP_PIN_GPIO88; }
functions
void helan_dkb_set_bl(int intensity) { int gpio_bl, bl_level, p_num; unsigned long flags; /* * FIXME * the initial value of bl_level_last is the UBOOT backlight level, * It should be aligned with uboot. For example, * If uboot uses 100% backlight level, bl_level_last = 33; * If uboot uses 50% ba...
functions
void helandkb_sdcard_signal(unsigned int set) { int vol = set; pxa988_aib_mmc1_iodomain(vol); }
functions
void wlan_edge_wakeup(struct work_struct *work) { /* * it is handled in SDIO driver instead, so code not need now * but temparally keep the code here,it may be used for debug */ #if 0 unsigned int sec = 3; /* * Why use a workqueue to call this function? * * As now dat1_edge_wakeup is called just after C...
functions
void dat1_edge_wakeup(int irq, void *pRsv) { queue_work(system_wq, &wlan_wk); }
functions
void wlan_wakeup_init(void) { INIT_WORK(&wlan_wk, wlan_edge_wakeup); wakeup_source_init(&wlan_dat1_wakeup, "wifi_hs_wakeups"); }
functions
void helandkb_8787_set_power(unsigned int on) { static struct regulator *wib_3v3; static int enabled; if (!wib_3v3) { wib_3v3 = regulator_get(NULL, "v_wib_3v3"); if (IS_ERR(wib_3v3)) { wib_3v3 = NULL; printk(KERN_ERR "get v_wib_3v3 failed %s %d\n", __func__, __LINE__); return; }
functions
__init helandkb_init_mmc(void) { #ifdef CONFIG_SD8XXX_RFKILL int WIB_PDn = mfp_to_gpio(MFP_WIB_PDn); int WIB_RESETn = mfp_to_gpio(MFP_WIB_RESETn); if (!gpio_request(WIB_PDn, "WIB_PDn")) { gpio_direction_output(WIB_PDn, 0); gpio_free(WIB_PDn); }
functions
__init helandkb_init_mmc(void) { }
functions
int pxa988_cam_clk_init(struct device *dev) { struct mmp_cam_pdata *data = dev->platform_data; int ret; data->clk[0] = devm_clk_get(dev, "CCICFUNCLK"); if (IS_ERR(data->clk[0])) { dev_err(dev, "Could not get function clk\n"); ret = PTR_ERR(data->clk[0]); return ret; }
functions
void pxa988_cam_set_clk(struct device *dev, int on) { struct mmp_cam_pdata *data = dev->platform_data; int mipi = on & MIPI_ENABLE; on &= POWER_ON; if (on) { clk_enable(data->clk[2]); clk_enable(data->clk[1]); clk_enable(data->clk[0]); if (mipi) clk_enable(data->clk[3]); }
functions
int camera_sensor_power(struct device *dev, int on) { unsigned int cam_pwr; unsigned int cam_reset; static struct regulator *v_sensor; if (!v_sensor) { v_sensor = regulator_get(NULL, "v_cam_avdd"); if (IS_ERR(v_sensor)) { v_sensor = NULL; pr_err(KERN_ERR "Enable v_ldo16 failed!\n"); return -EIO; }
functions
int ov5640_sensor_power(struct device *dev, int on) { static struct regulator *af_vcc; static struct regulator *avdd; int cam_reset; int pwdn = mfp_to_gpio(GPIO080_GPIO_CAM_PD_MAIN); int ret = 0; cam_reset = mfp_to_gpio(GPIO081_GPIO_CAM_RST_MAIN); if (gpio_request(pwdn, "CAM_ENABLE_LOW")) { ret = -EIO; got...
functions
__init pxa988_init_device_vpudevfreq(void) { u32 i = 0; u32 vpu_freq_num = pxa988_get_vpu_op_num(); vpu_freq_table = kmalloc(sizeof(struct devfreq_frequency_table) * \ (vpu_freq_num + 1), GFP_KERNEL); if (!vpu_freq_table) return; for (i = 0; i < vpu_freq_num; i++) { vpu_freq_table[i].index = i; vpu_fr...
functions
__init pxa988_init_device_ddrdevfreq(void) { u32 i = 0; u32 ddr_freq_num = pxa988_get_ddr_op_num(); ddr_freq_table = kmalloc(sizeof(struct devfreq_frequency_table) * \ (ddr_freq_num + 1), GFP_KERNEL); if (!ddr_freq_table) return; for (i = 0; i < ddr_freq_num; i++) { ddr_freq_table[i].index = i; ddr_fr...
functions
int gps_enable_control(int flag) { static struct regulator *gps_regulator = NULL; static int f_enabled = 0; printk("[GPS] LDO control : %s\n", flag ? "ON" : "OFF"); #ifdef GPS_LDO_POWER if (flag && (!f_enabled)) { gps_regulator = regulator_get(NULL, "v_gps_1v8"); ...
functions
void gps_eclk_ctrl(int on) { mfp_cfg_t gps_eclk_en = GPIO089_GPS_CLK; mfp_cfg_t gps_eclk_dis = GPIO089_GPIO_89; if (on) mfp_config(&gps_eclk_en, 1); else mfp_config(&gps_eclk_dis, 1); }
functions
void gps_power_on(void) { unsigned int gps_rst_n,gps_on; gps_eclk_ctrl(0); gps_rst_n = mfp_to_gpio(GPIO053_AP_AGPS_RESET); if (gpio_request(gps_rst_n, "gpio_gps_rst")) { pr_err("Request GPIO failed, gpio: %d\n", gps_rst_n); return; }
functions
void gps_power_off(void) { unsigned int gps_rst_n, gps_on; gps_eclk_ctrl(0); /* hardcode */ gps_on = mfp_to_gpio(GPIO052_AP_AGPS_ONOFF); if (gpio_request(gps_on, "gpio_gps_on")) { pr_err("Request GPIO failed,gpio: %d\n", gps_on); return; }
functions
void gps_reset(int flag) { unsigned int gps_rst_n; gps_rst_n = mfp_to_gpio(GPIO053_AP_AGPS_RESET); if (gpio_request(gps_rst_n, "gpio_gps_rst")) { pr_err("Request GPIO failed, gpio: %d\n", gps_rst_n); return; }
functions
void gps_on_off(int flag) { unsigned int gps_on; gps_on = mfp_to_gpio(GPIO052_AP_AGPS_ONOFF); if (gpio_request(gps_on, "gpio_gps_on")) { pr_err("Request GPIO failed, gpio: %d\n", gps_on); return; }
functions
ssize_t sirf_read_proc(char *page, char **start, off_t off, int count, int *eof, void *data) { int len = strlen(sirf_status); sprintf(page, "%s\n", sirf_status); return len + 1; }
functions
ssize_t sirf_write_proc(struct file *filp, const char *buff, size_t len, loff_t *off) { char messages[256]; int flag, ret; char buffer[7]; if (len > 255) len = 255; memset(messages, 0, sizeof(messages)); if (!buff || copy_from_user(messages, buff, len)) return -EFAULT; if (strlen(messages) > (SIRF_STAT...
functions
void create_sirf_proc_file(void) { struct proc_dir_entry *sirf_proc_file = NULL; /* * CSR and Marvell GPS lib will both use this file * "/proc/drver/gps" may be modified in future */ sirf_proc_file = create_proc_entry("driver/sirf", 0644, NULL); if (!sirf_proc_file) { pr_err("sirf proc file create failed!\...
functions
ssize_t pcm_mfp_read_proc(char *page, char **start, off_t off, int count, int *eof, void *data) { int mfp = mfp_read(mfp_to_gpio(GPIO025_GPIO_INPUT)); mfp &= 0x7; sprintf(page, "GPIO25~28 are configured to %s\n", mfp ? "GSSP" : "GPIO input"); return strlen(page) + 1; }
functions
ssize_t pcm_mfp_write_proc(struct file *filp, const char *buff, size_t len, loff_t *off) { char a; unsigned long i, j, gpio; unsigned long gssp_mfp[2][4] = { { GPIO025_GPIO_INPUT, GPIO026_GPIO_INPUT, GPIO027_GPIO_INPUT, GPIO028_GPIO_INPUT, }
functions
void create_pcm_mfp_proc_file(void) { struct proc_dir_entry *proc_file = NULL; proc_file = create_proc_entry("driver/pcm_mfp", 0644, NULL); if (!proc_file) { pr_err("%s: create proc file failed\n", __func__); return; }
functions
void uart_add_constraint(int mfp, void *unused) { if (!mod_timer(&uart_constraint_timer, jiffies + 3 * HZ)) pm_qos_update_request(&uart_lpm_cons, PM_QOS_CPUIDLE_BLOCK_DDR_VALUE); /* Refer to wlan_edge_wakeup() for why using work_queue here. */ schedule_work(&uart_wakeup_work); }
functions
void uart_timer_handler(unsigned long data) { pm_qos_update_request(&uart_lpm_cons, PM_QOS_CPUIDLE_BLOCK_DEFAULT_VALUE); }
functions
void uart_wakeup(struct work_struct *work) { __pm_wakeup_event(&uart_ws, 3000); /* time in milliseconds */ }
functions
void uart_wakeup_init(void) { INIT_WORK(&uart_wakeup_work, uart_wakeup); wakeup_source_init(&uart_ws, "uart"); }
functions
void helan_dkb_poweroff(void) { unsigned char data; pr_info("turning off power....\n"); preempt_enable(); /* save power off reason */ pm800_extern_write(PM80X_BASE_PAGE, PMIC_GENERAL_USE_REGISTER, PMIC_GENERAL_USE_BOOT_BY_NONE); data = pm800_extern_read(PM80X_BASE_PAGE, PM800_WAKEUP1); pm800_extern_write(P...
functions
int reboot_notifier_func(struct notifier_block *this, unsigned long code, void *p) { char *cmd = p; unsigned char data; unsigned char pmic_download_register = 0; unsigned char pmic_register = 0; pr_info("reboot notifier: %s\n", cmd); #if defined (CONFIG_MFD_88PM800) if (cmd && !strcmp(cmd, "recovery")) { ...
functions
__init helandkb_init(void) { int i; #ifdef CONFIG_SEC_DEBUG sec_debug_init(); #endif for (i = 0; i < ARRAY_SIZE(helan_dkb_hw_desc); i++) mmp_device_hw_register(helan_dkb_hw_desc[i]); mfp_config(ARRAY_AND_SIZE(helandkb_pin_config)); if (dvc_flag) mfp_config(ARRAY_AND_SIZE(dvc_pin_config)); #if defined(CONF...
functions
void dvs_setting_initialize(void) { int cnt=0, gpio=0, len=0; static unsigned long dvs_init_input[]={ GPIO034_GPIO_34 | MFP_PULL_HIGH | MFP_LPM_INPUT, GPIO043_GPIO_43 | MFP_PULL_HIGH | MFP_LPM_PULL_HIGH, GPIO044_GPIO_44 | MFP_PULL_HIGH | MFP_LPM_PULL_HIGH, GPIO084_GPIO_84 | MFP_PULL_LOW, 0, GPIO077_CA...
functions
void dvs_setting_sleep(void) { int cnt=0, gpio=0, len=0; static unsigned long dvs_sleep_input[]={ GPIO043_GPIO_43 | MFP_PULL_HIGH | MFP_LPM_PULL_HIGH, GPIO044_GPIO_44 | MFP_PULL_HIGH | MFP_LPM_PULL_HIGH, GPIO084_GPIO_84 | MFP_PULL_HIGH, 0, //GPIO089_GPS_CLK, }
includes
#include <arch/acpi.h>
includes
#include <arch/io.h>
includes
#include <bootmode.h>
includes
#include <console/console.h>
includes
#include <stdlib.h>
includes
#include <stdint.h>
includes
#include <string.h>
includes
#include <delay.h>
includes
#include <device/cardbus.h>
includes
#include <device/device.h>
includes
#include <device/pci.h>
includes
#include <device/pci_ids.h>
includes
#include <device/pcix.h>