static int si2168_fe_enter_mode(struct aml_fe *fe, int mode) { struct aml_fe_dev *dev = fe->dtv_demod; int ret; pr_dbg("=========================si2168 demod init\r\n"); ret=amlogic_gpio_request(dev->reset_gpio, "si2168_reset"); ret = amlogic_gpio_direction_output(dev->reset_gpio, dev->reset_value, "si2168_reset"); msleep(300); ret=amlogic_gpio_direction_output(dev->reset_gpio, !dev->reset_value, "si2168_reset"); //enable tuner power msleep(200); //reset int standard; standard=SILABS_DVB_T2; //Initialize LSI printf("Initializing LSI .. "); SiLabs_API_SW_Init(&front_end, DEMOD_ADDRESS+(fe1*2), TUNER_ADDRESS_TER+(fe1*2), TUNER_ADDRESS_SAT+(fe1*2)); front_end.Si2168_FE->demod->i2c=DEMOD_ADDRESS; SiLabs_API_switch_to_standard (&front_end, standard, 1); printk("chip id is %d, i2c is %x\n",front_end.chip,front_end.Si2168_FE->demod->i2c); SiLabs_API_Tuner_I2C_Enable(&front_end); if(MDrv_Tuner_Init()==1) pr_dbg("TUNER OK\n"); else pr_dbg("TUNER NG\n"); SiLabs_API_Tuner_I2C_Disable(&front_end); return 0; }
static void bt_device_off(struct bt_dev_data *pdata) { if(pdata->gpio_reset > 0 ) amlogic_gpio_direction_output(pdata->gpio_reset, 0, BT_RFKILL); if(pdata->gpio_en > 0 ) amlogic_gpio_direction_output(pdata->gpio_en, 0, BT_RFKILL); msleep(20); }
static int AVL6211_Reset(int reset_gpio) { amlogic_gpio_request(reset_gpio,device_name); amlogic_gpio_direction_output(reset_gpio, 0, device_name); msleep(300); amlogic_gpio_direction_output(reset_gpio, 1, device_name); return 0; }
void demod_reset(struct cxd2837_state *state) { //gpio_request(state->config.reset_pin, "cxd2837:RESET"); pr_info("the reset pin is %x\n",state->config.reset_pin); //state->config.reset_pin = 6; // gpio_out(state->config.reset_pin, 0); amlogic_gpio_request(state->config.reset_pin, "cxd2837_reset"); amlogic_gpio_direction_output(state->config.reset_pin, 0, "cxd2837_reset"); pr_dbg("Jay reset pin \n"); msleep(600); // gpio_out(state->config.reset_pin, 1); amlogic_gpio_direction_output(state->config.reset_pin, 1, "cxd2837_reset"); msleep(200); }
static void um220_gps_power_enable(void) { int ret = -1; if(gps->gpio_power > 0) { //ret = amlogic_gpio_direction_output(gps->gpio_power, 1, MOD_NAME); ret = amlogic_gpio_direction_output(gps->gpio_power, 0, MOD_NAME); printk("%s:return status:%d\n", __func__, ret); } }
static int speaker_events(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { switch (event) { case SND_SOC_DAPM_POST_PMU: printk("speaker_events--mute =1\n"); amlogic_gpio_direction_output(p_audio->gpio_mute, 1, "mute_spk"); //amlogic_set_value(p_audio->gpio_mute, 1, "mute_spk"); aml_m8_spk_enabled = 1; msleep(p_audio->sleep_time); break; case SND_SOC_DAPM_PRE_PMD: printk("speaker_events--mute =0\n"); amlogic_gpio_direction_output(p_audio->gpio_mute, 0, "mute_spk"); //amlogic_set_value(p_audio->gpio_mute, 0, "mute_spk"); aml_m8_spk_enabled = 0; break; } return 0; }
static void usb_wifi_power(int is_power) { #ifdef CONFIG_OF if(!pdata){ printk("%s pdata is not inited!\n",__FUNCTION__); return; } if(pdata->power_gpio > 0) amlogic_gpio_direction_output(pdata->power_gpio, is_power, WIFI_POWER_MODULE_NAME); if(wifi_power_on_pin2){ if(pdata->power_gpio2 > 0) amlogic_gpio_direction_output(pdata->power_gpio2, is_power, WIFI_POWER_MODULE_NAME); } #else CLEAR_CBUS_REG_MASK(PREG_PAD_GPIO6_EN_N, (1<<11)); if (is_power)//is_power SET_CBUS_REG_MASK(PREG_PAD_GPIO6_O, (1<<11)); // GPIO_E bit 11 else CLEAR_CBUS_REG_MASK(PREG_PAD_GPIO6_O, (1<<11)); #endif return; }
static void bt_device_init(struct bt_dev_data *pdata) { if(pdata->gpio_reset > 0 ) { amlogic_gpio_request(pdata->gpio_reset, BT_RFKILL); } if(pdata->gpio_en > 0 ) { amlogic_gpio_request(pdata->gpio_en, BT_RFKILL); } if(pdata->gpio_wake > 0 ) { amlogic_gpio_request(pdata->gpio_wake, BT_RFKILL); amlogic_gpio_direction_output(pdata->gpio_wake, 1, BT_RFKILL); } }
void sii_hardware_reset(sii9233a_info_t *info) { amlogic_gpio_direction_output(info->gpio_reset, 0, SII9233A_DRV_NAME); msleep(60); amlogic_gpio_direction_output(info->gpio_reset, 1, SII9233A_DRV_NAME); }
void wifi_power_init() { printf("-- set usb wifi power off in uboot --\n"); amlogic_gpio_direction_output(GPIOX_11,1); }