static void htcleo_config_bt_off(void) { #ifdef HTC_RFKILL_DBG printk(KERN_INFO "-- RK OFF --\n"); #endif /* BT_SHUTDOWN_N */ gpio_configure(HTCLEO_GPIO_BT_SHUTDOWN_N, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_LOW); mdelay(2); /* BT_RESET_N */ gpio_configure(HTCLEO_GPIO_BT_RESET_N, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_LOW); mdelay(2); /* set bt off configuration*/ config_bt_table(htcleo_bt_off_table, ARRAY_SIZE(htcleo_bt_off_table)); mdelay(5); /* BT_RTS */ gpio_configure(HTCLEO_GPIO_BT_UART1_RTS, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_LOW); /* BT_TX */ gpio_configure(HTCLEO_GPIO_BT_UART1_TX, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_LOW); /* BT_CHIP_WAKE */ gpio_configure(HTCLEO_GPIO_BT_CHIP_WAKE, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_LOW); }
static void vivow_config_bt_init(void) { vivow_wifi_bt_sleep_clk_ctl(CLK_ON, ID_BT); mdelay(2); /* set bt initial configuration*/ config_bt_table(vivow_bt_init_table, ARRAY_SIZE(vivow_bt_init_table)); mdelay(2); /* BT_RESET_N */ gpio_configure(VIVOW_GPIO_BT_RESET_N, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_LOW); mdelay(1); /* BT_SHUTDOWN_N */ gpio_configure(VIVOW_GPIO_BT_SHUTDOWN_N, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_LOW); mdelay(1); /* BT_CHIP_WAKE */ gpio_configure(VIVOW_GPIO_BT_CHIP_WAKE, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_LOW); /* BT_RTS */ gpio_configure(VIVOW_GPIO_BT_UART1_RTS, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_HIGH); /* BT_CTS */ /* BT_RX */ /* BT_TX */ gpio_configure(VIVOW_GPIO_BT_UART1_TX, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_HIGH); }
void __init swift_init_accel(void) { int rc = 0; gpio_configure(ACCEL_GPIO_I2C_SDA, GPIOF_DRIVE_OUTPUT); //gpio_set_value(ACCEL_GPIO_I2C_SDA, 1); gpio_configure(ACCEL_GPIO_I2C_SCL, GPIOF_DRIVE_OUTPUT); //gpio_set_value(ACCEL_GPIO_I2C_SCL, 1); rc = gpio_request(ACCEL_GPIO_INT, "motion_int"); if (rc < 0) { GI2C_E("150 failed to gpio %d request(ret=%d)\n", ACCEL_GPIO_INT, rc); return; } gpio_direction_input(ACCEL_GPIO_INT); /*temp3*/printk("diyu1: Function : %s \n", __FUNCTION__); rc = i2c_register_board_info(I2C_BUS_NUM_ACCEL, &accel_i2c_bdinfo, 1); if (rc < 0) { GI2C_E("150: failed to i2c register board info(busnum=%d, ret=%d)\n", I2C_BUS_NUM_ACCEL, rc); return; } rc = platform_device_register(&swift_accel_i2c_device); if (rc != 0) { GI2C_E("150: failed to register motion platform device(ret=%d)\n", rc); } }
int main(){ int diff_usec = 13157; struct timespec start, end; int infrared_pulse = 1; int buf_index = 0; int record = open("./config", O_RDONLY); int size = read(record, buf, BUF_SIZE); gpio_init(); gpio_configure(17, GPIO_OUTPUT); gpio_configure(27, GPIO_INPUT); while(size--){ clock_gettime(CLOCK_MONOTONIC_RAW, &start); int pin = (int)buf[buf_index++] - 48; if(infrared_pulse && pin){ gpio_set(17); } else { gpio_clear(17); } while(1){ clock_gettime(CLOCK_MONOTONIC_RAW, &end); long real_diff = (end.tv_sec - start.tv_sec) * 1000 * 1000 * 1000 + (end.tv_nsec - start.tv_nsec); if( real_diff > diff_usec) { break; } } infrared_pulse = 1 - infrared_pulse; } return 0; }
int firm_update( void ) { printk(KERN_INFO "[TSP] %s, %d\n", __func__, __LINE__); printk("[TSP] disable_irq : %d\n", __LINE__ ); disable_irq(ts_global->client->irq); // TEST gpio_configure( TSP_SCL, GPIOF_DRIVE_OUTPUT ); if( HW_ver==1 || HW_ver==2 ) firmware_ret_val = cypress_update( HW_ver ); else { printk(KERN_INFO "[TSP] %s, %d cypress_update blocked, HW ver=%d\n", __func__, __LINE__, HW_ver); firmware_ret_val = 0; // Fail } if( firmware_ret_val ) printk(KERN_INFO "[TSP] %s success, %d\n", __func__, __LINE__); else printk(KERN_INFO "[TSP] %s fail, %d\n", __func__, __LINE__); gpio_configure( TSP_SCL, GPIOF_DRIVE_OUTPUT ); printk("[TSP] enable_irq : %d\n", __LINE__ ); enable_irq(ts_global->client->irq); return 0; }
void lge_melfas_intr(UINT8 set) { int nErr; switch(set) { case TKEY_SET_LOW : DMSG("melfas set INTR to LOW\n"); gpio_set_value(mcs6000_ts_dev.intr_gpio, 0); break; case TKEY_SET_HIGH : DMSG("melfas set INTR to HIGH\n"); gpio_set_value(mcs6000_ts_dev.intr_gpio, 1); break; case TKEY_SET_OUTPUT : DMSG("melfas set INTR to OUTPUT\n"); nErr = gpio_tlmm_config(GPIO_CFG(mcs6000_ts_dev.intr_gpio, 0, GPIO_OUTPUT, GPIO_NO_PULL, GPIO_2MA), GPIO_ENABLE); nErr = gpio_configure(mcs6000_ts_dev.intr_gpio, GPIOF_DRIVE_OUTPUT); if(nErr) { DMSG("GPIO_CONFIGURE FAILED (%d)\n", nErr); } break; case TKEY_SET_INPUT : DMSG("melfas set INTR to INPUT\n"); nErr = gpio_tlmm_config(GPIO_CFG(mcs6000_ts_dev.intr_gpio, 0, GPIO_INPUT, GPIO_PULL_UP, GPIO_2MA), GPIO_ENABLE); nErr = gpio_configure(mcs6000_ts_dev.intr_gpio, GPIOF_INPUT); if(nErr) { DMSG("GPIO_CONFIGURE FAILED (%d)\n", nErr); } break; } }
static void incrediblec_config_bt_off(void) { /* BT_SHUTDOWN_N */ gpio_configure(INCREDIBLEC_GPIO_BT_SHUTDOWN_N, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_LOW); mdelay(2); /* BT_RESET_N */ gpio_configure(INCREDIBLEC_GPIO_BT_RESET_N, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_LOW); mdelay(2); /* set bt off configuration*/ config_bt_table(incrediblec_bt_off_table, ARRAY_SIZE(incrediblec_bt_off_table)); mdelay(5); /* BT_RTS */ gpio_configure(INCREDIBLEC_GPIO_BT_UART1_RTS, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_LOW); /* BT_TX */ gpio_configure(INCREDIBLEC_GPIO_BT_UART1_TX, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_LOW); /* BT_CHIP_WAKE */ gpio_configure(INCREDIBLEC_GPIO_BT_CHIP_WAKE, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_LOW); }
static void liberty_config_bt_off(void) { /* BT_SHUTDOWN_N */ gpio_configure(LIBERTY_GPIO_BT_SHUTDOWN_N, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_LOW); mdelay(2); /* BT_RESET_N */ gpio_configure(LIBERTY_GPIO_BT_RESET_N, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_LOW); mdelay(2); /* set bt off configuration*/ config_bt_table(liberty_bt_off_table, ARRAY_SIZE(liberty_bt_off_table)); mdelay(5); /* BT_RTS */ /* BT_CTS */ /* BT_TX */ gpio_configure(LIBERTY_GPIO_BT_UART1_TX, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_LOW); /* BT_RX */ /* BT_HOST_WAKE */ /* BT_CHIP_WAKE */ gpio_configure(LIBERTY_GPIO_BT_CHIP_WAKE, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_LOW); }
static int kgm803a0_panel_reset(void) { int err; err = gpio_request(102, "gpio_panel_reset"); if (err) { printk(KERN_ERR "gpio_request failed for 102\n"); return -1; } err = gpio_configure(102, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_HIGH); if (err) { printk(KERN_ERR "gpio_config failed for 102 HIGH\n"); return -1; } WAIT_USEC(5); err = gpio_configure(102, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_LOW); if (err) { printk(KERN_ERR "gpio_config failed for 102 LOW\n"); return -1; } WAIT_SEC(10000); err = gpio_configure(102, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_HIGH); if (err) { printk(KERN_ERR "gpio_config failed for 102\n"); return -1; } WAIT_SEC(10000); }
static int kgm803a0_set_backlight(boolean on) { int err; err = gpio_request(94, "gpio_backlight"); if (err) { printk(KERN_ERR "gpio_request failed for 94\n"); return -1; } if(on) { err = gpio_configure(94, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_HIGH); if (err) { printk(KERN_ERR "gpio_config failed for 94 HIGH\n"); return -1; } } else { err = gpio_configure(94, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_LOW); if (err) { printk(KERN_ERR "gpio_config failed for 94 low\n"); return -1; } } }
static void spade_config_bt_off(void) { /* BT_RESET_N */ gpio_configure(SPADE_GPIO_BT_RESET_N, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_LOW); mdelay(1); /* BT_SHUTDOWN_N */ gpio_configure(SPADE_GPIO_BT_SHUTDOWN_N, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_LOW); mdelay(1); /* set bt off configuration*/ config_bt_table(spade_bt_off_table, ARRAY_SIZE(spade_bt_off_table)); mdelay(2); /* BT_RTS */ /* BT_CTS */ /* BT_TX */ /* BT_RX */ /* BT_HOST_WAKE */ /* BT_CHIP_WAKE */ gpio_configure(SPADE_GPIO_BT_CHIP_WAKE, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_LOW); }
/*powerup the PMIC, configure GPIO 37, set GPIO to NO_PULL, make it as input pin. Give sleep of 10 millisecs, call registry init */ int prodrv_sns_ON(void) { int ok_flag = TRUE; PROX_DBG("=====<PROXIMITY> prodrv_sns_ON=====\n"); prox_detect.proxy_val = PROX_VAL_NEAR; prox_detect.proxy_state = PROX_DETECT_NON; sub_pmic_ldo_ctrl(SUB_PMIC_LDO4,SUB_PMIC_LDO_ON); #ifndef CONFIG_GPIOLIB gpio_configure(PROX_GPIO, GPIOF_ENABLE_WAKE | GPIOF_INPUT); #else gpio_direction_input(PROX_GPIO); #endif //added to set it to no pull as per spec gpio_tlmm_config(GPIO_CFG(PROX_GPIO, 0, GPIO_INPUT, GPIO_NO_PULL, GPIO_2MA),GPIO_ENABLE); msleep(SNS_STANDBY_TIME); ok_flag = prodrv_sns_reg_init(); if(ok_flag!=TRUE) { #ifndef CONFIG_GPIOLIB gpio_configure(PROX_GPIO, GPIOF_DRIVE_OUTPUT); #else gpio_direction_output(PROX_GPIO, 1); #endif } return ok_flag; }
static void vivow_config_bt_off(void) { /* BT_RESET_N */ gpio_configure(VIVOW_GPIO_BT_RESET_N, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_LOW); mdelay(1); /* BT_SHUTDOWN_N */ gpio_configure(VIVOW_GPIO_BT_SHUTDOWN_N, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_LOW); mdelay(1); /* set bt off configuration*/ config_bt_table(vivow_bt_off_table, ARRAY_SIZE(vivow_bt_off_table)); mdelay(2); /* BT_RTS */ /* BT_CTS */ /* BT_RX */ /* BT_TX */ /* BT_HOST_WAKE */ /* BT_CHIP_WAKE */ gpio_configure(VIVOW_GPIO_BT_CHIP_WAKE, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_LOW); vivow_wifi_bt_sleep_clk_ctl(CLK_OFF, ID_BT); mdelay(2); }
void legend_config_bt_disable_sleep(void) { config_bt_table(legend_bt_disable_sleep_table, ARRAY_SIZE(legend_bt_disable_sleep_table)); mdelay(5); gpio_configure(LEGEND_GPIO_UART1_RTS, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_LOW); /* O(L) */ gpio_configure(LEGEND_GPIO_UART1_TX, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_HIGH); /* O(H) */ }
static void __init msm7x2x_init_mmc(void) { if (!machine_is_msm7x25_ffa() && !machine_is_msm7x27_ffa()) { vreg_mmc = vreg_get(NULL, "gp6"); if (IS_ERR(vreg_mmc)) { printk(KERN_ERR "%s: vreg get failed (%ld)\n", __func__, PTR_ERR(vreg_mmc)); return; } } sdcc_gpio_init(); #ifdef CONFIG_MMC_MSM_SDC1_SUPPORT msm_add_sdcc(1, &msm7x2x_sdcc_data); #endif #ifdef CONFIG_MMC_MSM_SDC2_SUPPORT #if defined(CONFIG_LGE_BCM432X_PATCH) gpio_tlmm_config(GPIO_CFG(CONFIG_BCM4325_GPIO_WL_REGON, 0, GPIO_OUTPUT, GPIO_PULL_UP, GPIO_2MA), GPIO_ENABLE); gpio_configure(CONFIG_BCM4325_GPIO_WL_REGON, GPIOF_DRIVE_OUTPUT); gpio_set_value(CONFIG_BCM4325_GPIO_WL_REGON, 0); gpio_tlmm_config(GPIO_CFG(CONFIG_BCM4325_GPIO_WL_RESET, 0, GPIO_OUTPUT, GPIO_PULL_UP, GPIO_2MA), GPIO_ENABLE); gpio_configure(CONFIG_BCM4325_GPIO_WL_RESET, GPIOF_DRIVE_OUTPUT); gpio_set_value(CONFIG_BCM4325_GPIO_WL_RESET, 0); gpio_tlmm_config(GPIO_CFG(CONFIG_BCM4325_GPIO_WL_HOSTWAKEUP, 0, GPIO_INPUT, GPIO_PULL_DOWN, GPIO_2MA), GPIO_ENABLE); gpio_configure(CONFIG_BCM4325_GPIO_WL_HOSTWAKEUP, GPIOF_INPUT); msm_add_sdcc(2, &bcm432x_sdcc_wlan_data); enable_irq(gpio_to_irq(CONFIG_BCM4325_GPIO_WL_RESET)); #else msm_add_sdcc(2, &msm7x2x_sdcc_data); #endif #endif #ifdef CONFIG_MMC_MSM_SDC3_SUPPORT msm_add_sdcc(3, &msm7x2x_sdcc_data); #endif #ifdef CONFIG_MMC_MSM_SDC4_SUPPORT msm_add_sdcc(4, &msm7x2x_sdcc_data); #endif }
static void __init msm7x2x_init_mmc(void) { if (!machine_is_msm7x25_ffa() && !machine_is_msm7x27_ffa()) { vreg_mmc = vreg_get(NULL, "wlan"); if (IS_ERR(vreg_mmc)) { printk(KERN_ERR "%s: vreg get failed (%ld)\n", __func__, PTR_ERR(vreg_mmc)); return; } } sdcc_gpio_init(); #ifdef CONFIG_MMC_MSM_SDC1_SUPPORT msm_add_sdcc(1, &msm7x2x_sdcc_data); #endif #ifdef CONFIG_MMC_MSM_SDC2_SUPPORT /* _S [jisung.yang] 2010-04-24, BCM4325 control */ #if defined(CONFIG_LGE_BCM432X_PATCH) /* GPIO config */ gpio_tlmm_config(GPIO_CFG(CONFIG_BCM4325_GPIO_WL_REGON, 0, GPIO_OUTPUT, GPIO_PULL_UP, GPIO_2MA), GPIO_ENABLE); gpio_configure(CONFIG_BCM4325_GPIO_WL_REGON, GPIOF_DRIVE_OUTPUT); gpio_set_value(CONFIG_BCM4325_GPIO_WL_REGON, 0); gpio_tlmm_config(GPIO_CFG(CONFIG_BCM4325_GPIO_WL_RESET, 0, GPIO_OUTPUT, GPIO_PULL_UP, GPIO_2MA), GPIO_ENABLE); gpio_configure(CONFIG_BCM4325_GPIO_WL_RESET, GPIOF_DRIVE_OUTPUT); gpio_set_value(CONFIG_BCM4325_GPIO_WL_RESET, 0); gpio_tlmm_config(GPIO_CFG(CONFIG_BCM4325_GPIO_WL_HOSTWAKEUP, 0, GPIO_OUTPUT, GPIO_PULL_UP, GPIO_2MA), GPIO_ENABLE); gpio_configure(CONFIG_BCM4325_GPIO_WL_HOSTWAKEUP, GPIOF_INPUT); /* Register platform device */ msm_add_sdcc(2, &bcm432x_sdcc_wlan_data); /* Enable RESET IRQ for wlan card detect */ enable_irq(gpio_to_irq(CONFIG_BCM4325_GPIO_WL_RESET)); #else /* qualcomm or google */ msm_add_sdcc(2, &msm7x2x_sdcc_data); #endif /* CONFIG_LGE_BCM432X_PATCH */ /* _E [jisung.yang] 2010-04-24, BCM4325 control */ #endif #ifdef CONFIG_MMC_MSM_SDC3_SUPPORT msm_add_sdcc(3, &msm7x2x_sdcc_data); #endif #ifdef CONFIG_MMC_MSM_SDC4_SUPPORT msm_add_sdcc(4, &msm7x2x_sdcc_data); #endif }
static bool _io_init(spi_device_t *dev, struct gpio_pin *cs) { do { if (!gpio_configure(cs)) break; gpio_set(cs); if (!device_open(dev)) break; device_setup(dev, SPI_DEVICE_PARAMETER_CLOCK, 1000000UL); device_setup(dev, SPI_DEVICE_PARAMETER_BITS, SPI_8_BIT); device_setup(dev, SPI_DEVICE_PARAMETER_PHASE, SPI_PHASE_0); device_setup(dev, SPI_DEVICE_PARAMETER_POLARITY, SPI_POLARITY_0); device_setup(dev, SPI_DEVICE_PARAMETER_MODE, SPI_MODE_MASTER); device_setup(dev, SPI_DEVICE_PARAMETER_DIRECTION, SPI_DIRECTION_1LINE); if (!device_configure(dev)) break; return true; } while (0); return false; }
static int adp5587_setup_irq(struct i2c_client *client) { int rc = 0; int gpio_config; struct adp5587_data *client_data = NULL; client_data = i2c_get_clientdata(client); gpio_config = GPIO_CFG(ADP5587_INT_GPIO, 0, GPIO_INPUT, GPIO_PULL_UP, GPIO_2MA); rc = gpio_tlmm_config(gpio_config, GPIO_ENABLE); if (rc) { printk(KERN_ERR "adp5587_setup_irq: gpio_tlmm_config failed\n"); rc = -EIO;; } rc = gpio_configure(ADP5587_INT_GPIO, GPIOF_INPUT | IRQF_TRIGGER_FALLING); if (rc) { printk(KERN_ERR "adp5587_setup_irq: gpio_configure failed\n"); rc = -EIO;; } rc = request_irq(client->irq, adp5587_irq_handler,IRQF_TRIGGER_FALLING,ADP5587_I2C_NAME,client_data); if (rc) { printk(KERN_ERR "adp5587_setup_irq: request irq failed\n"); rc = -EIO;; } return rc; }
static void incrediblec_config_bt_on(void) { /* set bt on configuration*/ config_bt_table(incrediblec_bt_on_table, ARRAY_SIZE(incrediblec_bt_on_table)); mdelay(5); /* BT_RESET_N */ gpio_configure(INCREDIBLEC_GPIO_BT_RESET_N, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_HIGH); mdelay(2); /* BT_SHUTDOWN_N */ gpio_configure(INCREDIBLEC_GPIO_BT_SHUTDOWN_N, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_HIGH); mdelay(2); }
static void set_h2w_clk_dir(int n) { if (n == 0) /* input */ gpio_direction_input(HERO_GPIO_H2W_CLK); else gpio_configure(HERO_GPIO_H2W_CLK, GPIOF_DRIVE_OUTPUT); }
static void liberty_config_bt_on(void) { /* set bt on configuration*/ config_bt_table(liberty_bt_on_table, ARRAY_SIZE(liberty_bt_on_table)); mdelay(5); /* BT_RESET_N */ gpio_configure(LIBERTY_GPIO_BT_RESET_N, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_HIGH); mdelay(2); /* BT_SHUTDOWN_N */ gpio_configure(LIBERTY_GPIO_BT_SHUTDOWN_N, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_HIGH); mdelay(2); }
static void set_h2w_dat_dir(int n) { if (n == 0) /* input */ gpio_direction_input(BAHAMAS_GPIO_H2W_DATA); else gpio_configure(BAHAMAS_GPIO_H2W_DATA, GPIOF_DRIVE_OUTPUT); }
static void chacha_config_bt_on(void) { /* set bt on configuration*/ config_bt_table(chacha_bt_on_table, ARRAY_SIZE(chacha_bt_on_table)); mdelay(5); /* BT_RESET_N */ gpio_configure(CHACHA_GPIO_BT_RESET_N, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_HIGH); mdelay(2); /* BT_SHUTDOWN_N */ gpio_configure(CHACHA_GPIO_BT_SD_N, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_HIGH); mdelay(2); }
int main(int argc, char *argv[]) { #ifdef __XENO__ struct sched_param param = { 99 }; mlockall(MCL_CURRENT | MCL_FUTURE); pthread_setschedparam(pthread_self(), SCHED_FIFO, ¶m); #endif if (!raspi_map_hw()) { perror("Could not map hardware registers"); exit(1); } #ifdef __XENO__ pthread_set_mode_np(0, PTHREAD_WARNSW|PTHREAD_PRIMARY); #endif gpio_configure(16, Output); for (;;) { gpio_set(16); sleep(1); gpio_clear(16); sleep(1); } #ifdef __XENO__ pthread_set_mode_np(PTHREAD_WARNSW, 0); #endif return 1; }
// ********************* LOW-LEVEL ISSP SUBROUTINE SECTION ******************** // **************************************************************************** // **** PROCESSOR SPECIFIC **** // **************************************************************************** // **** USER ATTENTION REQUIRED **** // **************************************************************************** // SCLKLow() // Make Clock pin Low // **************************************************************************** // high low // to do void SCLKLow(void) { gpio_configure( TSP_SCL, GPIOF_DRIVE_OUTPUT ); gpio_set_value ( TSP_SCL, 0); #if !defined(CONFIG_MACH_BENI)||!defined(CONFIG_MACH_TASS) ||!defined(CONFIG_MACH_COOPER) Delay(1); #endif }
static int synaptics_ts_suspend(struct i2c_client *client, pm_message_t mesg) { int ret; struct synaptics_ts_data *ts = i2c_get_clientdata(client); struct vreg *vreg_touch; printk("[TSP] %s+\n", __func__ ); vreg_touch = vreg_get(NULL, "ldo6"); if (ts->use_irq) { disable_irq(client->irq); } gpio_configure( TSP_SCL, GPIOF_DRIVE_OUTPUT ); gpio_configure( TSP_SDA, GPIOF_DRIVE_OUTPUT ); gpio_configure( TSP_INT, GPIOF_INPUT ); #if 0 gpio_tlmm_config(GPIO_CFG( TSP_SCL, 0, GPIO_OUTPUT, GPIO_PULL_UP,GPIO_2MA), GPIO_ENABLE); gpio_tlmm_config(GPIO_CFG( TSP_SDA, 0, GPIO_OUTPUT, GPIO_PULL_UP,GPIO_2MA), GPIO_ENABLE); gpio_tlmm_config(GPIO_CFG( TSP_INT, 0, GPIO_OUTPUT, GPIO_PULL_UP,GPIO_2MA), GPIO_ENABLE); #endif gpio_set_value( TSP_SCL , 0 ); gpio_set_value( TSP_SDA , 0 ); gpio_set_value( TSP_INT , 0 ); ret = cancel_work_sync(&ts->work); if (ret && ts->use_irq) /* if work was pending disable-count is now 2 */ { enable_irq(client->irq); } msleep(20); ret = vreg_disable(vreg_touch); if (ret) { printk(KERN_ERR "%s: vreg enable failed (%d)\n", __func__, ret); return -EIO; } printk("[TSP] %s-\n", __func__ ); return 0; }
static void spade_config_bt_on(void) { /* set bt on configuration*/ config_bt_table(spade_bt_on_table, ARRAY_SIZE(spade_bt_on_table)); mdelay(2); /* BT_SHUTDOWN_N */ gpio_configure(SPADE_GPIO_BT_SHUTDOWN_N, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_HIGH); mdelay(1); /* BT_RESET_N */ gpio_configure(SPADE_GPIO_BT_RESET_N, GPIOF_DRIVE_OUTPUT | GPIOF_OUTPUT_HIGH); mdelay(1); }
// ********************* LOW-LEVEL ISSP SUBROUTINE SECTION ******************** // **************************************************************************** // **** PROCESSOR SPECIFIC **** // **************************************************************************** // **** USER ATTENTION REQUIRED **** // **************************************************************************** // SCLKHigh() // Set the SCLK pin High // **************************************************************************** // High PIN // TO DO void SCLKHigh(void) { gpio_configure( TSP_SCL, GPIOF_DRIVE_OUTPUT ); gpio_set_value ( TSP_SCL, 1); #if !defined(CONFIG_MACH_BENI)||!defined(CONFIG_MACH_TASS)|| !defined(CONFIG_MACH_TASSTMO)|| !defined(CONFIG_MACH_TASSATT)|| !defined(CONFIG_MACH_GT2)|| !defined(CONFIG_MACH_FLIPBOOK) ||!defined(CONFIG_MACH_COOPER) || !defined(CONFIG_MACH_GIO) Delay(1); #endif }
int main(){ gpio_init(); gpio_configure(27, GPIO_INPUT); gpio_asynchronous_rising_edge_detect(27, 1); gpio_asynchronous_falling_edge_detect(27, 1); return 0; }
static __inline void pp2106_send_ack(void) { QWERTY_SDA_OUTPUT(); QWERTY_SDA_LOW(); QWERTY_SCL_LOW(); gpio_configure(KEY_SDA_PIN,GPIOF_INPUT); QWERTY_SCL_HIGH(); }