コード例 #1
0
static void tcc_dxb_ctrl_rf_path(unsigned int flag)
{
	if(machine_is_m805_892x())
	{
		tcc_gpio_config(GPIO_RFSW_CTL0, GPIO_FN(0));
		gpio_request(GPIO_RFSW_CTL0, NULL);
		gpio_direction_output(GPIO_RFSW_CTL0, 0);
	
		printk("[%s:%d] flag:%d\n", __func__, __LINE__, flag);
	
		switch(flag)
		{
		case DXB_RF_PATH_UHF:
			gpio_set_value(GPIO_RFSW_CTL0, 1);
			tcc_gpio_config(GPIO_RFSW_CTL3, GPIO_FN(0));
			gpio_request(GPIO_RFSW_CTL3, NULL);
			gpio_direction_output(GPIO_RFSW_CTL3, 0);
			break;
	
		case DXB_RF_PATH_VHF:
			gpio_set_value(GPIO_RFSW_CTL0, 0);
			tcc_gpio_config(GPIO_RFSW_CTL1, GPIO_FN(0));
			gpio_request(GPIO_RFSW_CTL1, NULL);
			gpio_direction_output(GPIO_RFSW_CTL1, 1);    		
	
			tcc_gpio_config(GPIO_RFSW_CTL2, GPIO_FN(0));
			gpio_request(GPIO_RFSW_CTL2, NULL);
			gpio_direction_output(GPIO_RFSW_CTL2, 0);
			break;
		default:
			break;
		}
	}
}
コード例 #2
0
static void tcc_dxb_ctrl_power_reset(int deviceIdx)
{
	if(machine_is_m801_88())
	{
		switch(deviceIdx)
		{
		case 0:
			tcc_gpio_config(GPIO_DXB0_RST, GPIO_FN(0));
			gpio_request(GPIO_DXB0_RST, NULL);
			gpio_direction_output(GPIO_DXB0_RST, 0);
			msleep(20);
			gpio_set_value(GPIO_DXB0_RST, 1);
			break;
		case 1:
			tcc_gpio_config(GPIO_DXB2_RST, GPIO_FN(0));
			gpio_request(GPIO_DXB2_RST, NULL);
			gpio_direction_output(GPIO_DXB2_RST, 0);
			msleep(20);
			gpio_set_value(GPIO_DXB2_RST, 1);
			break;
		default:
			break;
		}
	}
}
コード例 #3
0
static void tcc_dxb_ctrl_power_off(int deviceIdx)
{
#ifdef      CONFIG_STB_BOARD_HDB892F
   	gpio_set_value(TCC_GPG(18), 0);	
#else    
	if(machine_is_tcc8920st())
	{
		if(guiBoardType == BOARD_DXB_TCC3510 
		|| guiBoardType == BOARD_TDMB_TCC3161
		||  guiBoardType == BOARD_ISDBT_TCC353X)
		{
			switch(deviceIdx)
			{
			case 0:
				tcc_gpio_config(GPIO_DXB_ON,  GPIO_FN(0));
				tcc_gpio_config(GPIO_DXB0_PD,  GPIO_FN(0));
				gpio_request(GPIO_DXB0_PD, NULL);
				gpio_direction_output(GPIO_DXB0_PD, 0); //TCC3511_PD Set Output Mode
				gpio_request(GPIO_DXB_ON, NULL);
				gpio_direction_output(GPIO_DXB_ON, 0); //GPIO_DXB_ON Set Output Mode
				break;
			case 1:			
				break;
			default:
				break;
			}
		}
		else if(guiBoardType == BOARD_DVBT_DIB9090)
		{        
		}
		else if(guiBoardType == BOARD_TDMB_TCC3150)
		{
			switch(deviceIdx)
			{
			case 0:		
				break;
			default:
				break;
			}
		}
		else if(guiBoardType == BOARD_ISDBT_TOSHIBA)
		{
			switch (deviceIdx)
			{
			case 0:
				tcc_gpio_config(GPIO_DXB_ON,  GPIO_FN(0));
				tcc_gpio_config(GPIO_DXB0_PD,  GPIO_FN(0));
				tcc_gpio_config(GPIO_DXB0_RST, GPIO_FN(0));
				gpio_direction_output(GPIO_DXB0_PD, 0);
				gpio_direction_output(GPIO_DXB0_RST, 0);
				gpio_direction_output(GPIO_DXB_ON, 0);
				break;
			default:
				break;
			}
		}
	}
#endif	
}
コード例 #4
0
ファイル: tcc_bt_dev.c プロジェクト: AmesianX/telechips-linux
int init_module(void)
{
    int ret;

	printk("[## BT ##] init_module\n");
    ret = register_chrdev(BT_DEV_MAJOR_NUM, DEV_NAME, &tcc_bt_dev_ops);

	bt_dev_class = class_create(THIS_MODULE, DEV_NAME);
	device_create(bt_dev_class, NULL, MKDEV(BT_DEV_MAJOR_NUM, BT_DEV_MINOR_NUM), NULL, DEV_NAME);

#if 0  //  moved to arch/arm/mach-tcc8920/board-tcc-bluetooth.c
	if(machine_is_tcc8900()){
	    gpio_request(TCC_GPB(25), "bt_power");
	    gpio_request(TCC_GPEXT2(9), "bt_reset");
		gpio_direction_output(TCC_GPB(25), 0); // output
		gpio_direction_output(TCC_GPEXT2(9), 0);
	}else if(machine_is_tcc9300() || machine_is_tcc8800()|| machine_is_tcc8920()) {      // #elif defined (CONFIG_MACH_TCC9300)
			//gpio_set_value(TCC_GPEXT1(7), 0);   /* BT-ON Disable */
		gpio_request(TCC_GPEXT3(2), "bt_wake");
	    gpio_request(TCC_GPEXT2(4), "bt_reset");
		gpio_direction_output(TCC_GPEXT3(2), 0); // output
		gpio_direction_output(TCC_GPEXT2(4), 0);
#if defined(CONFIG_TCC_CSR_BC0406_MODULE_SUPPORT) && defined(CONFIG_TCC_CSR_HOST_WAKE_UP)
		tcc_gpio_config(TCC_GPB(31), GPIO_FN(0));
		gpio_request(TCC_GPEXT3(3), "bt_hwake");
		gpio_direction_input(TCC_GPEXT3(3));
#endif // for CSR Bluetooth host wake up
	}
	else if(machine_is_m801_88() || machine_is_m803())
	{
		#if defined(CONFIG_TCC_RDA_587X_MODULE_SUPPORT)
		gpio_request(TCC_GPA(13), "LDO_ON");
		tcc_gpio_config(TCC_GPA(13), GPIO_FN(0));
		gpio_direction_output(TCC_GPA(13), 0);
		#else
		gpio_request(TCC_GPA(13), "bt_reset");
		gpio_request(TCC_GPB(22), "BT WAKE");
		gpio_direction_output(TCC_GPA(13), 0); // output
		gpio_direction_output(TCC_GPB(22), 0); // output
		#endif

	}
	else if(machine_is_tcc8800st())
	{
		gpio_request(TCC_GPC(31), "bt_power");
		gpio_request(TCC_GPD(12), "bt_reset");
		gpio_direction_output(TCC_GPC(31), 0); // output
		gpio_direction_output(TCC_GPD(12), 0); // output
	}
#endif

    if(ret < 0){
        printk("[## BT ##] [%d]fail to register the character device\n", ret);
        return ret;
    }

    return 0;
}
コード例 #5
0
static void tcc_dxb_ctrl_power_reset(int deviceIdx)
{
#ifdef      CONFIG_STB_BOARD_HDB892F
#else    
	if(machine_is_tcc8920st())
	{
		if(guiBoardType == BOARD_DXB_TCC3510 
		|| guiBoardType == BOARD_TDMB_TCC3161
		||  guiBoardType == BOARD_ISDBT_TCC353X)
		{
			switch(deviceIdx)
			{
			case 0:
				tcc_gpio_config(GPIO_DXB0_RST, GPIO_FN(0));
				gpio_request(GPIO_DXB0_RST, NULL);
				gpio_direction_output(GPIO_DXB0_RST, 0);
				msleep (20);
				gpio_set_value(GPIO_DXB0_RST, 1);
				break;
			case 1:
				break;
			default:
				break;
			}
		}
		else if(guiBoardType == BOARD_DVBT_DIB9090)
        {
           	
        }
		else if(guiBoardType == BOARD_TDMB_TCC3150)	
		{
			switch(deviceIdx)
			{
			case 0:
			
				break;
			default:
				break;
			}
		}
		else if (guiBoardType == BOARD_ISDBT_TOSHIBA)
		{
			switch (deviceIdx)
			{
			case 0:
				tcc_gpio_config(GPIO_DXB0_RST, GPIO_FN(0));
				gpio_direction_output(GPIO_DXB0_RST, 0);
				msleep (20);
				gpio_set_value(GPIO_DXB0_RST, 1);				
				break;
			default:
				break;
			}
		}
	}
#endif	
}
コード例 #6
0
static void tcc_dxb_ctrl_power_on(int deviceIdx)
{
	if(machine_is_m805_892x())
	{
		if(g_power_status[deviceIdx] == 1) //already power on
            return;

		if(g_power_status[0]==0 && g_power_status[1]==0 && 
			g_power_status[2]==0 && g_power_status[3]==0)
		{
		#if defined(CONFIG_REGULATOR) && defined(CONFIG_M805S_8925_0XX)
			if (vdd_dxb)
			{
				printk("regulator_enable !!!\n");
				regulator_enable(vdd_dxb);
				msleep(20);
			}
		#endif
			/* GPIO_EXPAND DXB_ON Power-on */
			tcc_gpio_config(GPIO_DXB_PWREN,  GPIO_FN(0));
			gpio_request(GPIO_DXB_PWREN, NULL);
			gpio_direction_output(GPIO_DXB_PWREN, 1);
		}

		g_power_status[deviceIdx] = 1; //power on status
	
		switch(deviceIdx)
		{
		case 0:
			tcc_gpio_config(GPIO_DXB_PWDN,  GPIO_FN(0));
			tcc_gpio_config(GPIO_DXB0_RST,  GPIO_FN(0));
	
			gpio_request(GPIO_DXB_PWDN, NULL);
			gpio_direction_output(GPIO_DXB_PWDN, 1);
			gpio_request(GPIO_DXB0_RST, NULL);
			gpio_direction_output(GPIO_DXB0_RST, 0);
			msleep(20);
			gpio_set_value(GPIO_DXB0_RST, 1);
			break;
		case 1:
			tcc_gpio_config(GPIO_DXB2_PWDN,	GPIO_FN(0));
			tcc_gpio_config(GPIO_DXB2_RST,	GPIO_FN(0));
	
			gpio_request(GPIO_DXB2_PWDN, NULL);
			gpio_direction_output(GPIO_DXB2_PWDN, 1);
			gpio_request(GPIO_DXB2_RST, NULL);
			gpio_direction_output(GPIO_DXB2_RST, 0);
			msleep(20);
			gpio_set_value(GPIO_DXB2_RST, 1);
			break;
		default:
			break;
		}
	}
}
コード例 #7
0
static void m805_892x_nand_init(void)
{
	unsigned int gpio_wp = GPIO_NAND_WP;
	unsigned int gpio_rdy0 = GPIO_NAND_RDY0;	
		
	tcc_gpio_config(gpio_wp, GPIO_FN(0));
	tcc_gpio_config(gpio_rdy0, GPIO_FN(0));	
	
	gpio_request(gpio_wp, "nand_wp");
	gpio_direction_output(gpio_wp, 1);

	gpio_request(gpio_rdy0, "nand_rdy0");
	gpio_direction_input(gpio_rdy0);
}
コード例 #8
0
ファイル: cec.c プロジェクト: AmesianX/telechips-linux
void cec_stop(void)
{
    DPRINTK(KERN_INFO "%s\n", __FUNCTION__);

    cec_mask_tx_interrupts();
    cec_mask_rx_interrupts();
    cec_disable_interrupts();

#if defined(CONFIG_ARCH_TCC92XX)
	tcc_gpio_config(CEC_GPIO_IN, GPIO_FN(0));
	tcc_gpio_config(CEC_GPIO_OUT, GPIO_FN(0));
#else
	tcc_gpio_config(CEC_GPIO_COMMON, GPIO_FN(0));
#endif /* CONFIG_ARCH_TCC88XX */

}
コード例 #9
0
static void tcc_dxb_ctrl_power_off(int deviceIdx)
{
	if(machine_is_m805_892x())
	{
		if(g_power_status[deviceIdx] == 0) //already power off
            return;

		g_power_status[deviceIdx] = 0; //power off status
		switch(deviceIdx)
		{
		case 0:
			tcc_gpio_config(GPIO_DXB_PWDN, GPIO_FN(0));//DXB_PWDN#
			gpio_request(GPIO_DXB_PWDN, NULL);
			gpio_direction_output(GPIO_DXB_PWDN, 0);
			gpio_set_value(GPIO_DXB0_RST, 0);
			break;
		case 1:
			tcc_gpio_config(GPIO_DXB2_PWDN,  GPIO_FN(0));
			gpio_request(GPIO_DXB2_PWDN, NULL);
			gpio_direction_output(GPIO_DXB2_PWDN, 0);
			gpio_set_value(GPIO_DXB2_RST, 0);
			break;
		default:
			break;
		}
	
		if(g_power_status[0]==0 && g_power_status[1]==0 && 
			g_power_status[2]==0 && g_power_status[3]==0)
		{
	
			tcc_gpio_config(GPIO_DXB_PWREN, GPIO_FN(0));     //DXB_PWREN
			gpio_request(GPIO_DXB_PWREN, NULL);
			gpio_direction_output(GPIO_DXB_PWREN, 0);

		#if defined(CONFIG_REGULATOR) && defined(CONFIG_M805S_8925_0XX)
			if (vdd_dxb)
			{
				printk("regulator_disable !!!\n");
				msleep(20);
				regulator_disable(vdd_dxb);
			}
		#endif
		}
	}
}
コード例 #10
0
int m803_mmc_init(struct device *dev, int id)
{
	BUG_ON(id > TCC_MMC_TYPE_MAX);

	tcc_gpio_config(mmc_ports[id].data0, GPIO_FN(2) | GPIO_CD(0));
	tcc_gpio_config(mmc_ports[id].data1, GPIO_FN(2) | GPIO_CD(0));
	tcc_gpio_config(mmc_ports[id].data2, GPIO_FN(2) | GPIO_CD(0));
	tcc_gpio_config(mmc_ports[id].data3, GPIO_FN(2) | GPIO_CD(0));
	tcc_gpio_config(mmc_ports[id].cmd, GPIO_FN(2));
	tcc_gpio_config(mmc_ports[id].clk, GPIO_FN(2) | GPIO_CD(3));

	if(id == TCC_MMC_TYPE_WIFI)
	{
		gpio_request(TCC_GPG(11),"wifi_rst");
		gpio_request(TCC_GPG(10),"wifi_on");

		gpio_direction_output(TCC_GPG(11), 0);
		msleep(10);
		gpio_direction_output(TCC_GPG(11), 1);
	}

	if(id == TCC_MMC_TYPE_SD){
		tcc_gpio_config(mmc_ports[id].cd, GPIO_FN(0));
		gpio_request(mmc_ports[id].cd, "sd_cd");

		gpio_direction_input(mmc_ports[id].cd);
	}

	return 0;
}
コード例 #11
0
static int hpd_probe(struct platform_device *pdev)
{
	unsigned int reg;
	struct tcc_hpd_platform_data *hpd_dev;
	hpd_dev = pdev->dev.platform_data;

    if (!machine_is_hdmidp())
        return -ENODEV;

    printk(KERN_INFO "HPD Driver ver. %s (built %s %s)\n", VERSION, __DATE__, __TIME__);

	hdmi_hpd_clk = clk_get(0, "hdmi");
	
	clk_enable(hdmi_hpd_clk);
	hpd_port = hpd_dev->hpd_port;

	gpio_request(hpd_port, "hpd");

	#if defined(CONFIG_MACH_M805_892X)
	tcc_gpio_config(hpd_port, GPIO_FN(0)|GPIO_PULLDOWN);
	#else
	tcc_gpio_config(hpd_port, GPIO_FN(0));
	#endif

	gpio_direction_input(hpd_port);

    if (misc_register(&hpd_misc_device))    {
        printk(KERN_WARNING "HPD: Couldn't register device 10, %d.\n", HPD_MINOR);
        return -EBUSY;
    }
    spin_lock_init(&hpd_struct.lock);
	
    /* disable HPD interrupts */
    reg = readb(HDMI_SS_INTC_CON);
    reg &= ~(1<<HDMI_IRQ_HPD_PLUG);
    reg &= ~(1<<HDMI_IRQ_HPD_UNPLUG);
    writeb(reg, HDMI_SS_INTC_CON);
    atomic_set(&hpd_struct.state, -1);

	#ifndef CONFIG_OUTPUT_SKIP_KERNEL_LOGO
		clk_disable(hdmi_hpd_clk);
	#endif

    return 0;
}
コード例 #12
0
static void tcc_dxb_ctrl_set_board(unsigned int uiboardtype)
{
	guiBoardType = uiboardtype;
	if(guiBoardType == BOARD_TDMB_TCC3150)
	{
		tcc_gpio_config(gINT_DXB0_IRQ,  GPIO_FN(0));
		gpio_request(gINT_DXB0_IRQ, NULL);
		gpio_direction_input(gINT_DXB0_IRQ);

		tcc_gpio_config(GPIO_DXB1_PD,  GPIO_FN(0));
		gpio_request(GPIO_DXB1_PD, NULL);
		gpio_direction_output(GPIO_DXB1_PD, 0);

		tcc_gpio_config(gGPIO_DXB0_RST,	GPIO_FN(0));
		gpio_request(gGPIO_DXB0_RST, NULL);
		gpio_direction_output(gGPIO_DXB0_RST, 0);
	}
}
コード例 #13
0
/*****************************************************************************
* Function Name : static void Init_IR_Port(void);
* Description : IR port register init
* Arguments :
******************************************************************************/
static void Init_IR_Port(void)
{
#if defined(CONFIG_ARCH_TCC892X)
	tcc_gpio_config(TCC_GPG(17), GPIO_FN7|GPIO_OUTPUT|GPIO_LOW);
#else
	PGPIO pGpioA = (volatile PGPIO)tcc_p2v(HwGPIOA_BASE);
	BITCSET(pGpioA->GPAFN0, (Hw20 | Hw21 | Hw22 | Hw23), Hw20);	//GPIO_A5
#endif
}
コード例 #14
0
static void tcc_dxb_ctrl_set_board(unsigned int uiboardtype)
{
	guiBoardType = uiboardtype;

	if (guiBoardType == BOARD_ISDBT_TOSHIBA)
	{
		tcc_gpio_config(INT_DXB0_IRQ, GPIO_FN(0) | GPIO_PULLDOWN);
		gpio_request(INT_DXB0_IRQ, NULL);
		gpio_direction_input(INT_DXB0_IRQ);
	}
}
コード例 #15
0
ファイル: cec.c プロジェクト: AmesianX/telechips-linux
void cec_start(void)
{
    DPRINTK(KERN_INFO "%s\n", __FUNCTION__);

#if defined(CONFIG_ARCH_TCC88XX)
	tcc_gpio_config(CEC_GPIO_COMMON, GPIO_FN(5));
	gpio_direction_output(CEC_GPIO_COMMON, 0);
#elif defined(CONFIG_ARCH_TCC93XX)
	tcc_gpio_config(CEC_GPIO_COMMON, GPIO_FN(1));
	gpio_direction_output(CEC_GPIO_COMMON, 0);
#elif defined(CONFIG_ARCH_TCC92XX)
	tcc_gpio_config(CEC_GPIO_IN, GPIO_FN(1));
	tcc_gpio_config(CEC_GPIO_OUT, GPIO_FN(1));

	gpio_direction_output(CEC_GPIO_IN, 0);
	gpio_direction_output(CEC_GPIO_OUT, 1);	
#elif defined(CONFIG_ARCH_TCC892X)
	tcc_gpio_config(CEC_GPIO_COMMON, GPIO_FN(1));
	gpio_direction_output(CEC_GPIO_COMMON, 0);
#else
#error : not define HDMI CEC GPIO
#endif /* CONFIG_ARCH_TCC88XX */

    writeb(CEC_RX_CTRL_RESET, CEC_RX_CTRL); // reset CEC Rx
    writeb(CEC_TX_CTRL_RESET, CEC_TX_CTRL); // reset CEC Tx

    cec_set_divider();

    writeb(CEC_FILTER_THRESHOLD, CEC_RX_FILTER_TH); // setup filter

    cec_enable_interrupts();

    cec_unmask_tx_interrupts();

    cec_set_rx_state(STATE_RX);
    cec_unmask_rx_interrupts();
    cec_enable_rx();

	cec_rx_struct.flag = 0;
}
コード例 #16
0
int tcc8920_mmc_suspend(struct device *dev, int id)
{
	#if defined(TCC_MMC_SDIO_WIFI_USED)
	if(id == TCC_MMC_TYPE_WIFI) {
		if(mmc_ports[id].pwr != TCC_MMC_PORT_NULL)
			gpio_direction_output(mmc_ports[id].pwr, 0);
	}
	#endif

	#if defined(CONFIG_TCC_SD_PORT_RESTORE)
	if (id == TCC_MMC_TYPE_SD)
	{
		/* GPIO mode */
		tcc_gpio_config(mmc_ports[id].data0, GPIO_FN(0));
		tcc_gpio_config(mmc_ports[id].data1, GPIO_FN(0));
		tcc_gpio_config(mmc_ports[id].data2, GPIO_FN(0));
		tcc_gpio_config(mmc_ports[id].data3, GPIO_FN(0));

		tcc_gpio_config(mmc_ports[id].cmd, GPIO_FN(0));
		tcc_gpio_config(mmc_ports[id].clk, GPIO_FN(0));

		/* output mode - 1:high, 0:low */
		gpio_direction_output(mmc_ports[id].data0, 0);
		gpio_direction_output(mmc_ports[id].data1, 0);
		gpio_direction_output(mmc_ports[id].data2, 0);
		gpio_direction_output(mmc_ports[id].data3, 0);

		gpio_direction_output(mmc_ports[id].cmd, 0);
		gpio_direction_output(mmc_ports[id].clk, 0);
	}
	#endif

	return 0;
}
コード例 #17
0
static void sitronix_ts_port_init(void)
{
	volatile PGPIO pGPIO = (volatile PGPIO)tcc_p2v(HwGPIO_BASE);
	//int gp_penirq;

#if defined(CONFIG_ARCH_TCC88XX)
	if (machine_is_tcc8800()) {
		gp_penirq = TCC_GPA(6);
	}
#elif defined(CONFIG_ARCH_TCC892X)
	if (machine_is_tcc8920()) {
		if(system_rev == 0x1005 || system_rev == 0x1007)
			gp_penirq = TCC_GPB(11);
		else if(system_rev == 0x1006)
			gp_penirq = TCC_GPE(17);
		else if(system_rev == 0x1008)
			gp_penirq = TCC_GPE(5);
		else
			gp_penirq = TCC_GPG(18);
	}
#endif

      gpio_request(gp_penirq, "tsc_int");
      tcc_gpio_config(gp_penirq, GPIO_FN(0));
      gpio_direction_input(gp_penirq);

#if defined(CONFIG_ARCH_TCC88XX)
      if (machine_is_tcc8800()) {
		BITCSET(pGPIO->EINTSEL0 , HwEINTSEL0_EINT2_MASK, HwEINTSEL0_EINT2(SEL_GPIOA6));

		HwPIC->INTMSK0	|= Hw5;
		HwPIC->IEN0	&= ~Hw5;	/* disable Isr */
		HwPIC->MODEA0	&= ~Hw5; 	/* single edge */
		HwPIC->MODE0	&= ~Hw5;	/* set edge trigger mode */
		HwPIC->POL0	|= Hw5;		/* active-low */
		HwPIC->CLR0	|= Hw5;		/* clear pending status */
		HwPIC->SEL0	|= Hw5;		/* IRQ Select */
		HwPIC->IEN0	|= Hw5;
	}
#elif defined(CONFIG_ARCH_TCC892X)
	if (machine_is_tcc8920()) {
		if(system_rev == 0x1005 || system_rev == 0x1007)
			tcc_gpio_config_ext_intr(INT_EI2, EXTINT_GPIOB_11);
		else if(system_rev == 0x1006)
			tcc_gpio_config_ext_intr(INT_EI2, EXTINT_GPIOE_17);
		else if(system_rev == 0x1008)
			tcc_gpio_config_ext_intr(INT_EI2, EXTINT_GPIOE_05);
		else
			tcc_gpio_config_ext_intr(INT_EI2, EXTINT_GPIOG_18);
	}
#endif
}
コード例 #18
0
static int rn5t614_port_init(int irq_num)
{
	if(system_rev == 0x1005 || system_rev == 0x1007)
	{
		tcc_gpio_config(TCC_GPE(29), GPIO_FN(0)|GPIO_PULL_DISABLE);  // GPIOE[31]: input mode, disable pull-up/down
		tcc_gpio_config_ext_intr(PMIC_IRQ, EXTINT_GPIOE_29);

		gpio_request(TCC_GPE(29), "PMIC_IRQ");
		gpio_direction_input(TCC_GPE(29));
	}
	else if(system_rev == 0x1006)
	{
		tcc_gpio_config(TCC_GPE(27), GPIO_FN(0)|GPIO_PULL_DISABLE);  // GPIOE[31]: input mode, disable pull-up/down
		tcc_gpio_config_ext_intr(PMIC_IRQ, EXTINT_GPIOE_27);

		gpio_request(TCC_GPE(27), "PMIC_IRQ");
		gpio_direction_input(TCC_GPE(27));
	}
	else if(system_rev == 0x1008)
	{
		tcc_gpio_config(TCC_GPD(9), GPIO_FN(0)|GPIO_PULL_DISABLE);  // GPIOE[31]: input mode, disable pull-up/down
		tcc_gpio_config_ext_intr(PMIC_IRQ, EXTINT_GPIOD_09);

		gpio_request(TCC_GPD(9), "PMIC_IRQ");
		gpio_direction_input(TCC_GPD(9));
	}
	else
	{
		tcc_gpio_config(TCC_GPE(31), GPIO_FN(0)|GPIO_PULL_DISABLE);  // GPIOE[31]: input mode, disable pull-up/down
		tcc_gpio_config_ext_intr(PMIC_IRQ, EXTINT_GPIOE_31);

		gpio_request(TCC_GPE(31), "PMIC_IRQ");
		gpio_direction_input(TCC_GPE(31));
	}

	return 0;
}
コード例 #19
0
static void m805_892x_SetFlags( int bMultiCS )
{
	gMultiCS = bMultiCS;

#if (0) //bscho_temp
	if( gMultiCS == TRUE )
	{
		unsigned int gpio_rdy1 = GPIO_NAND_RDY1;

		tcc_gpio_config(gpio_rdy1, GPIO_FN(0));
		gpio_request(gpio_rdy1, "nand_rdy1");
		gpio_direction_input(gpio_rdy1);
	}
#endif
}
コード例 #20
0
static int tcc8800st_mmc_init(struct device *dev, int id)
{
	BUG_ON(id >= TCC_MMC_TYPE_MAX);

	gpio_request(mmc_ports[id].pwr, "sd_power");

	if(id == TCC_MMC_TYPE_SD)
	{
		gpio_request(mmc_ports[id].data0, "sd_d0");
		gpio_request(mmc_ports[id].data1, "sd_d1");
		gpio_request(mmc_ports[id].data2, "sd_d2");
		gpio_request(mmc_ports[id].data3, "sd_d3");

		gpio_request(mmc_ports[id].cmd, "sd_cmd");
		gpio_request(mmc_ports[id].clk, "sd_clk");
	}

#if defined(CONFIG_WIFI_SUB_BOARD)
	if(id == TCC_MMC_TYPE_WIFI)
	{
		gpio_request(GPIO_SD1_ON, "wifi_pre_power");
		gpio_direction_output(GPIO_SD1_ON, 1);
        
                gpio_request(TCC_GPG(11),"wifi_rst");

                gpio_direction_output(TCC_GPG(11), 0);
                msleep(100);
                gpio_direction_output(TCC_GPG(11), 1);
        }
#endif

	tcc_gpio_config(mmc_ports[id].data0, GPIO_FN(2) | GPIO_CD(1));
	tcc_gpio_config(mmc_ports[id].data1, GPIO_FN(2) | GPIO_CD(1));
	tcc_gpio_config(mmc_ports[id].data2, GPIO_FN(2) | GPIO_CD(1));
	tcc_gpio_config(mmc_ports[id].data3, GPIO_FN(2) | GPIO_CD(1));

	tcc_gpio_config(mmc_ports[id].cmd, GPIO_FN(2) | GPIO_CD(1));
	tcc_gpio_config(mmc_ports[id].clk, GPIO_FN(2) | GPIO_CD(3));

	tcc_gpio_config(mmc_ports[id].cd, GPIO_FN(0));
	gpio_request(mmc_ports[id].cd, "sd_cd");
	
	gpio_direction_input(mmc_ports[id].cd);

	return 0;
}
コード例 #21
0
static int tm070rdh11_set_power(struct lcd_panel *panel, int on, unsigned int lcd_num)
{
	struct lcd_platform_data *pdata = panel->dev->platform_data;

	printk("%s : %d %d  \n", __func__, on, panel->bl_level);

	mutex_lock(&panel_lock);
	panel->state = on;

	if (on) {

		
		gpio_set_value(pdata->power_on, 1);
		udelay(100);

		gpio_set_value(pdata->reset, 1);
		mdelay(20);

		lcdc_initialize(panel, lcd_num);
		LCDC_IO_Set(1, panel->bus_width);

		if(panel->bl_level)		{
			msleep(80); 	
			tcc_gpio_config(pdata->bl_on, GPIO_FN(2));
		}
		else		{
			msleep(80);
		}
		
	}
	else 
	{
		msleep(10);
		gpio_set_value(pdata->reset, 0);

		gpio_set_value(pdata->power_on, 0);

		LCDC_IO_Disable(1, panel->bus_width);
	}
	mutex_unlock(&panel_lock);

	return 0;
}
コード例 #22
0
static int tcc8800st_mmc_set_power(struct device *dev, int id, int on)
{
	if (on)
	{
		/* power */
		gpio_direction_output(mmc_ports[id].pwr, 1);
		mdelay(1);
	}
	else
	{
#if 0	// sd/mmc power always turned on
		//gpio_direction_output(mmc_ports[id].pwr, 0);

		if (id == TCC_MMC_TYPE_SD)
		{
			/* SD2 - GPIO mode */
			tcc_gpio_config(mmc_ports[id].data0, GPIO_FN(0));
			tcc_gpio_config(mmc_ports[id].data1, GPIO_FN(0));
			tcc_gpio_config(mmc_ports[id].data2, GPIO_FN(0));
			tcc_gpio_config(mmc_ports[id].data3, GPIO_FN(0));

			tcc_gpio_config(mmc_ports[id].cmd, GPIO_FN(0));
			tcc_gpio_config(mmc_ports[id].clk, GPIO_FN(0));

			/* output mode */
			gpio_direction_output(mmc_ports[id].data0, 1);
			gpio_direction_output(mmc_ports[id].data1, 1);
			gpio_direction_output(mmc_ports[id].data2, 1);
			gpio_direction_output(mmc_ports[id].data3, 1);

			gpio_direction_output(mmc_ports[id].cmd, 1);
			gpio_direction_output(mmc_ports[id].clk, 1);
		}
#endif

		//mdelay(10);
	}

	return 0;
}
コード例 #23
0
ファイル: gpio.c プロジェクト: AmesianX/telechips-linux
//  ************************************************************ //
//  Device Init :
//  
//  
//
//  ************************************************************ //
static int __init gps_gpio_init(void)  
{  
    int result;  
        gps_dbg("gps_gpio_init\n"); 

  
	if (0 == gps_major)
	{
		/* auto select a major */
		result = alloc_chrdev_region(&dev, 0, 1, GPS_GPIO_DEV_NAME);
		gps_major = MAJOR(dev);
	}
	else
	{
		/* use load time defined major number */
		dev = MKDEV(gps_major, 0);
		result = register_chrdev_region(dev, 1, GPS_GPIO_DEV_NAME);
	}

	memset(&gps_cdev, 0, sizeof(gps_cdev));

	/* initialize our char dev data */
	cdev_init(&gps_cdev, &gps_gpio_fops);

	/* register char dev with the kernel */
	result = cdev_add(&gps_cdev, dev, 1);
    
	if (0 != result)
	{
		unregister_chrdev_region(dev, 1);
		gps_dbg("Error registrating mali device object with the kernel\n");
	}

    gps_class = class_create(THIS_MODULE, GPS_GPIO_DEV_NAME);
    device_create(gps_class, NULL, MKDEV(gps_major, MINOR(dev)), NULL,
                  GPS_GPIO_DEV_NAME);

    if (result < 0)
        return result;  

#if defined(CONFIG_MACH_TCC9300) || defined(CONFIG_MACH_TCC8800) || defined(CONFIG_MACH_TCC8920)
    if(machine_is_m801_88() || machine_is_m803()) // GPIOG[4]
    {
        gps_dbg("GPS_PWREN on\n");
        tcc_gpio_config(TCC_GPG(4), GPIO_FN(0));
        gpio_request(TCC_GPG(4), "GPIO_PWREN");
        gpio_direction_output(TCC_GPG(4), 0);
    }
    else if(machine_is_tcc8800() || machine_is_tcc8920()) 
    {
        gps_dbg("gpio_direction_output__gps\n");
        gpio_direction_output(TCC_GPEXT1(6), 0);    // GPS Power On
    }
#elif defined(CONFIG_MACH_TCC8900)
    if(machine_is_tcc8900())
    {
        gps_dbg("GPS_8900_PWREN on\n");
        tcc_gpio_config(TCC_GPD(25), GPIO_FN(0));
        gpio_request(TCC_GPD(25), "GPIO_PWREN");
        gpio_set_value(TCC_GPD(25), 0);
    }
#elif defined(CONFIG_MACH_M805_892X)
    if(machine_is_m805_892x())
    {
        gps_dbg("GPS_PWREN on\n");
		if (system_rev == 0x2002 || system_rev == 0x2003 || system_rev == 0x2004 || system_rev == 0x2005) {
			tcc_gpio_config(TCC_GPE(14), GPIO_FN(0));
			gpio_request(TCC_GPE(14), "GPIO_PWREN");
			gpio_direction_output(TCC_GPE(14), 0);

		} else {
			tcc_gpio_config(TCC_GPC(6), GPIO_FN(0));
			gpio_request(TCC_GPC(6), "GPIO_PWREN");
			gpio_direction_output(TCC_GPC(6), 0);
        }
    }
#endif

    gps_dbg("GPS driver loaded\n");

    return 0;  
}  
コード例 #24
0
static void tcc_dxb_ctrl_power_on(int deviceIdx)
{
	if(machine_is_tcc8920())
	{
		/* GPIO_EXPAND DXB_ON Power-on */
		gpio_request(GPIO_DXB_ON,NULL);
		gpio_direction_output(GPIO_DXB_ON, 1);

		/* GPIO_EXPAND DEEPPWDN Power-on */
		gpio_request(GPIO_DXB1_PD,NULL);
		gpio_direction_output(GPIO_DXB1_PD, 1);

		if(guiBoardType == BOARD_ISDBT_TOSHIBA)
		{
			switch (deviceIdx)
			{
			case 0:
				tcc_gpio_config(gGPIO_DXB0_RST,  GPIO_FN(0));
				gpio_request(gGPIO_DXB0_RST, NULL);
				gpio_direction_output(gGPIO_DXB0_RST, 0);
				msleep(10);
				gpio_set_value(gGPIO_DXB0_RST, 1);
				break;
			default:
				break;
			}
		}
		else if(guiBoardType == BOARD_DXB_TCC3510 
			|| guiBoardType == BOARD_TDMB_TCC3161
			||  guiBoardType == BOARD_ISDBT_TCC353X)
		
		{
			switch(deviceIdx)
			{
			case 0:
				tcc_gpio_config(GPIO_DXB1_PD, GPIO_FN(0));
				tcc_gpio_config(gGPIO_DXB1_RST, GPIO_FN(0));

				gpio_request(GPIO_DXB1_PD, NULL);
				gpio_direction_output(GPIO_DXB1_PD, 0);
				gpio_set_value(gGPIO_DXB1_RST, 0);
				gpio_set_value(GPIO_DXB1_PD, 0);
				msleep (20);
				gpio_set_value(GPIO_DXB1_PD, 1);
				msleep (20);

				gpio_request(gGPIO_DXB1_RST, NULL);
				gpio_direction_output(gGPIO_DXB1_RST, 0);
				msleep (20);
				gpio_set_value(gGPIO_DXB1_RST, 1);
				break;
			case 1:
				tcc_gpio_config(GPIO_DXB2_PD,  GPIO_FN(0));
				tcc_gpio_config(gGPIO_DXB0_RST,  GPIO_FN(0));
	
				gpio_request(GPIO_DXB2_PD, NULL);
				gpio_direction_output(GPIO_DXB2_PD, 0);
	
				gpio_set_value(gGPIO_DXB0_RST, 0);
				gpio_set_value(GPIO_DXB2_PD, 0);
				msleep (20);
				gpio_set_value(GPIO_DXB2_PD, 1);
				msleep (20);
	
				gpio_request(gGPIO_DXB0_RST, NULL);
				gpio_direction_output(gGPIO_DXB0_RST, 0);
				msleep (20);
				gpio_set_value(gGPIO_DXB0_RST, 1);
				break;
			default:
				break;
			}
		}
		else if(guiBoardType == BOARD_DVBT_DIB9090)
		{
			tcc_gpio_config(GPIO_DXB1_PD, GPIO_FN(0));
			tcc_gpio_config(gGPIO_DXB1_RST, GPIO_FN(0));

			gpio_request(GPIO_DXB1_PD, NULL);
			gpio_direction_output(GPIO_DXB1_PD, 0);
			gpio_set_value(gGPIO_DXB1_RST, 0);
			gpio_set_value(GPIO_DXB1_PD, 0);
			msleep (20);
			gpio_set_value(GPIO_DXB1_PD, 1);
			msleep (20);

			gpio_request(gGPIO_DXB1_RST, NULL);
			gpio_direction_output(gGPIO_DXB1_RST, 0);
			msleep (20);
			gpio_set_value(gGPIO_DXB1_RST, 1);

			/* RF Control */
			tcc_gpio_config(gGPIO_DXB0_SDO,  GPIO_FN(0));
			gpio_request(gGPIO_DXB0_SDO, NULL);
			gpio_direction_output(gGPIO_DXB0_SDO, 0);
			gpio_set_value(gGPIO_DXB0_SDO, 1);
		}
		else if(guiBoardType == BOARD_TDMB_TCC3150)
		{
			switch(deviceIdx)
			{
			case 0:
				gpio_set_value(GPIO_DXB1_PD, 1);
				break;
			default:
				break;
			}
		}
		else if (guiBoardType == BOARD_ISDBT_DIB10096)
		{
			//DXB1_PD (LDO_EN) is already set

			//GPIO_E[7] = PWDN#
			tcc_gpio_config(gGPIO_DXB0_SDO, GPIO_FN(0)|GPIO_PULL_DISABLE);
			gpio_direction_output(gGPIO_DXB0_SDO, 1);

			//GPIO_E[4] = RST#
			tcc_gpio_config(gGPIO_DXB0_RST, GPIO_FN(0));
			gpio_direction_output(gGPIO_DXB0_RST, 0);
			msleep(20);
			gpio_set_value (gGPIO_DXB0_RST, 1);
		}
	}
}
コード例 #25
0
int tcc8920_mmc_init(struct device *dev, int id)
{
	BUG_ON(id >= TCC_MMC_TYPE_MAX);

	if(mmc_ports[id].pwr != TCC_MMC_PORT_NULL)
	{
		gpio_request(mmc_ports[id].pwr, "sd_power");

		#if defined(TCC_MMC_SDIO_WIFI_USED)
		if(id == TCC_MMC_TYPE_WIFI)
		{
			//gpio_request(mmc_ports[id].pwr, "wifi_pre_power");
			gpio_direction_output(mmc_ports[id].pwr, 0);
			msleep(100);
			gpio_direction_output(mmc_ports[id].pwr, 1);

		}
		#endif
	}

	#if defined(CONFIG_TCC_SD_PORT_RESTORE)
	if(id == TCC_MMC_TYPE_SD)
	{
		gpio_request(mmc_ports[id].data0, "sd_d0");
		gpio_request(mmc_ports[id].data1, "sd_d1");
		gpio_request(mmc_ports[id].data2, "sd_d2");
		gpio_request(mmc_ports[id].data3, "sd_d3");

		gpio_request(mmc_ports[id].cmd, "sd_cmd");
		gpio_request(mmc_ports[id].clk, "sd_clk");
	}
	#endif

	tcc_gpio_config(mmc_ports[id].data0, mmc_ports[id].func | GPIO_CD(1));
	tcc_gpio_config(mmc_ports[id].data1, mmc_ports[id].func | GPIO_CD(1));
	tcc_gpio_config(mmc_ports[id].data2, mmc_ports[id].func | GPIO_CD(1));
	tcc_gpio_config(mmc_ports[id].data3, mmc_ports[id].func | GPIO_CD(1));

	if(mmc_ports[id].width == TCC_MMC_BUS_WIDTH_8)
	{
		tcc_gpio_config(mmc_ports[id].data4, mmc_ports[id].func | GPIO_CD(1));
		tcc_gpio_config(mmc_ports[id].data5, mmc_ports[id].func | GPIO_CD(1));
		tcc_gpio_config(mmc_ports[id].data6, mmc_ports[id].func | GPIO_CD(1));
		tcc_gpio_config(mmc_ports[id].data7, mmc_ports[id].func | GPIO_CD(1));
	}

	tcc_gpio_config(mmc_ports[id].cmd, mmc_ports[id].func | GPIO_CD(1));
	tcc_gpio_config(mmc_ports[id].clk, mmc_ports[id].func | GPIO_CD(3));

	if(mmc_ports[id].cd != TCC_MMC_PORT_NULL)
	{
		tcc_gpio_config(mmc_ports[id].cd, GPIO_FN(0)|GPIO_PULL_DISABLE);
		gpio_request(mmc_ports[id].cd, "sd_cd");

		gpio_direction_input(mmc_ports[id].cd);
	}

	return 0;
}
コード例 #26
0
static void tcc_dxb_init(void)
{
	if(machine_is_m805_892x())
	{
		if (system_rev == 0x2008) {
			gpio_dxb1_sfrm = TCC_GPD(12);
			gpio_dxb1_sclk = TCC_GPD(11);
			gpio_dxb1_sdi = TCC_GPD(13);
			gpio_dxb1_sdo = TCC_GPD(14);
		} else {
			gpio_dxb1_sfrm = TCC_GPG(1);
			gpio_dxb1_sclk = TCC_GPG(0);
			gpio_dxb1_sdi = TCC_GPG(2);
			gpio_dxb1_sdo = TCC_GPG(3);
		}
		/*PULL_UP is disabled to save current.*/
	
		//TCC_GPE(2)
		tcc_gpio_config(GPIO_DXB0_SFRM, GPIO_FN(0)|GPIO_PULL_DISABLE);
		gpio_request(GPIO_DXB0_SFRM, NULL);
		gpio_direction_output(GPIO_DXB0_SFRM, 0);
	
		//TCC_GPE(3)
		tcc_gpio_config(GPIO_DXB0_SCLK, GPIO_FN(0)|GPIO_PULL_DISABLE);
		gpio_request(GPIO_DXB0_SCLK, NULL);
		gpio_direction_output(GPIO_DXB0_SCLK, 0);
	
		//TCC_GPE(9)
		tcc_gpio_config(GPIO_DXB0_RST, GPIO_FN(0)|GPIO_PULL_DISABLE);
		gpio_request(GPIO_DXB0_RST, NULL);
		gpio_direction_output(GPIO_DXB0_RST, 0);
	
		//TCC_GPE(5)
		tcc_gpio_config(INT_DXB0_IRQ, GPIO_FN(0)|GPIO_PULL_DISABLE);
		gpio_request(INT_DXB0_IRQ, NULL);
		gpio_direction_output(INT_DXB0_IRQ, 0);
	
		//TCC_GPE(6)
		tcc_gpio_config(GPIO_DXB0_SDI, GPIO_FN(0)|GPIO_PULL_DISABLE);
		gpio_request(GPIO_DXB0_SDI, NULL);
		gpio_direction_output(GPIO_DXB0_SDI, 0);
	
		//TCC_GPE(7)
		tcc_gpio_config(GPIO_DXB0_SDO, GPIO_FN(0)|GPIO_PULL_DISABLE);
		gpio_request(GPIO_DXB0_SDO, NULL);
		gpio_direction_output(GPIO_DXB0_SDO, 0);
	
		if (system_rev==0x2006 || system_rev==0x2007 || system_rev==0x2008) {
			tcc_gpio_config(gpio_dxb1_sfrm, GPIO_FN(0)|GPIO_PULL_DISABLE);
			gpio_request(gpio_dxb1_sfrm, NULL);
			gpio_direction_input(gpio_dxb1_sfrm);
	
			tcc_gpio_config(gpio_dxb1_sclk, GPIO_FN(0)|GPIO_PULL_DISABLE);
			gpio_request(gpio_dxb1_sclk, NULL);
			gpio_direction_input(gpio_dxb1_sclk);
	
			tcc_gpio_config(gpio_dxb1_sdi, GPIO_FN(0)|GPIO_PULL_DISABLE);
			gpio_request(gpio_dxb1_sdi, NULL);
			gpio_direction_input(gpio_dxb1_sdi);
	
			tcc_gpio_config(gpio_dxb1_sdo, GPIO_FN(0)|GPIO_PULL_DISABLE);
			gpio_request(gpio_dxb1_sdo, NULL);
			gpio_direction_input(gpio_dxb1_sdo);
		} else {
			tcc_gpio_config(gpio_dxb1_sfrm, GPIO_FN(0)|GPIO_PULL_DISABLE);
			gpio_request(gpio_dxb1_sfrm, NULL);
			gpio_direction_output(gpio_dxb1_sfrm, 0);
	
			tcc_gpio_config(gpio_dxb1_sclk, GPIO_FN(0)|GPIO_PULL_DISABLE);
			gpio_request(gpio_dxb1_sclk, NULL);
			gpio_direction_output(gpio_dxb1_sclk, 0);
	
			tcc_gpio_config(gpio_dxb1_sdi, GPIO_FN(0)|GPIO_PULL_DISABLE);
			gpio_request(gpio_dxb1_sdi, NULL);
			gpio_direction_output(gpio_dxb1_sdi, 0);
	
			tcc_gpio_config(gpio_dxb1_sdo, GPIO_FN(0)|GPIO_PULL_DISABLE);
			gpio_request(gpio_dxb1_sdo, NULL);
			gpio_direction_output(gpio_dxb1_sdo, 0);
		}
	
		//TCC_GPE(8)
		tcc_gpio_config(GPIO_DXB_PWDN, GPIO_FN(0)|GPIO_PULL_DISABLE);
		gpio_request(GPIO_DXB_PWDN, NULL);
		gpio_direction_output(GPIO_DXB_PWDN, 0);
	
		//TCC_GPG(5)
		tcc_gpio_config(GPIO_DXB_PWREN, GPIO_FN(0)|GPIO_PULL_DISABLE);
		gpio_request(GPIO_DXB_PWREN, NULL);
		gpio_direction_output(GPIO_DXB_PWREN, 0);	//DXB_PWREN //power off
	
		//TCC_GPE(1)
		tcc_gpio_config(GPIO_RFSW_CTL0, GPIO_FN(0)|GPIO_PULL_DISABLE);
		gpio_request(GPIO_RFSW_CTL0, NULL);
		gpio_direction_output(GPIO_RFSW_CTL0, 0);
	
		//TCC_GPE(1)
		tcc_gpio_config(GPIO_RFSW_CTL1, GPIO_FN(0)|GPIO_PULL_DISABLE);
		gpio_request(GPIO_RFSW_CTL1, NULL);
		gpio_direction_output(GPIO_RFSW_CTL1, 0);
	
		//TCC_GPE(1)
		tcc_gpio_config(GPIO_RFSW_CTL2, GPIO_FN(0)|GPIO_PULL_DISABLE);
		gpio_request(GPIO_RFSW_CTL2, NULL);
		gpio_direction_output(GPIO_RFSW_CTL2, 0);
	
		//TCC_GPE(1)
		tcc_gpio_config(GPIO_RFSW_CTL3, GPIO_FN(0)|GPIO_PULL_DISABLE);
		gpio_request(GPIO_RFSW_CTL3, NULL);
		gpio_direction_output(GPIO_RFSW_CTL3, 0);
		
		#if defined(CONFIG_REGULATOR) && defined(CONFIG_M805S_8925_0XX)
		if (vdd_dxb == NULL)
		{
			vdd_dxb = regulator_get(NULL, "vdd_dxb");
			if (IS_ERR(vdd_dxb)) {
				printk("Failed to obtain vdd_dxb\n");
				vdd_dxb = NULL;
			}
		}
		#endif
	}
}
コード例 #27
0
static void tcc_dxb_ctrl_power_reset(int deviceIdx)
{
	if(machine_is_tcc8920())
	{
		if(guiBoardType == BOARD_DXB_TCC3510 
		|| guiBoardType == BOARD_TDMB_TCC3161
		||  guiBoardType == BOARD_ISDBT_TCC353X)
		{
			switch(deviceIdx)
			{
			case 0:
				tcc_gpio_config(gGPIO_DXB0_RST, GPIO_FN(0));
				gpio_request(gGPIO_DXB0_RST, NULL);
				gpio_direction_output(gGPIO_DXB0_RST, 0);
				msleep (20);
				gpio_set_value(gGPIO_DXB0_RST, 1);
				break;
			case 1:
				tcc_gpio_config(gGPIO_DXB1_RST, GPIO_FN(0));
				gpio_request(gGPIO_DXB1_RST, NULL);
				gpio_direction_output(gGPIO_DXB1_RST, 0);
				msleep (20);
				gpio_set_value(gGPIO_DXB1_RST, 1);
				break;
			default:
				break;
			}
		}
		else if(guiBoardType == BOARD_DVBT_DIB9090)
        {
           	tcc_gpio_config(gGPIO_DXB0_RST, GPIO_FN(0));
			gpio_request(gGPIO_DXB0_RST, NULL);
			gpio_direction_output(gGPIO_DXB0_RST, 0);
			msleep (100);
			gpio_set_value(gGPIO_DXB0_RST, 1);
			msleep (100);
        }
		else if(guiBoardType == BOARD_TDMB_TCC3150)	
		{
			switch(deviceIdx)
			{
			case 0:
				gpio_set_value(gGPIO_DXB0_RST, 0);
				msleep(100);		
				gpio_set_value(gGPIO_DXB0_RST, 1);
				msleep(100);		
				break;
			default:
				break;
			}
		}
		else if (guiBoardType == BOARD_ISDBT_TOSHIBA || guiBoardType == BOARD_ISDBT_DIB10096)
		{
			switch (deviceIdx)
			{
			case 0:
				tcc_gpio_config(gGPIO_DXB0_RST, GPIO_FN(0));
				gpio_request(gGPIO_DXB0_RST, NULL);
				gpio_direction_output(gGPIO_DXB0_RST, 0);
				msleep(10);
				gpio_set_value(gGPIO_DXB0_RST, 1);
				break;
			default:
				break;
			}
		}
	}
}
コード例 #28
0
static void tcc_dxb_init(void)
{
	if(machine_is_tcc8920())
	{
		/*PULL_UP is disabled to save current.*/
        if(system_rev == 0x1005 || system_rev == 0x1007)
        {
            gGPIO_DXB0_SCLK = GPIO_DXB0_SCLK_REV1005;
            gGPIO_DXB0_SFRM = GPIO_DXB0_SFRM_REV1005;
            gGPIO_DXB0_SDI = GPIO_DXB0_SDI_REV1005;
            gGPIO_DXB0_SDO = GPIO_DXB0_SDO_REV1005;
            gGPIO_DXB0_RST = GPIO_DXB0_RST_REV1005;
            gGPIO_DXB1_SCLK = GPIO_DXB1_SCLK_REV1005;
            gGPIO_DXB1_SFRM = GPIO_DXB1_SFRM_REV1005;
            gGPIO_DXB1_SDI = GPIO_DXB1_SDI_REV1005;
            gGPIO_DXB1_SDO = GPIO_DXB1_SDO_REV1005;
            gGPIO_DXB1_RST = GPIO_DXB1_RST_REV1005;
			gINT_DXB1_IRQ = INT_DXB1_IRQ_REV1005;
            gINT_DXB0_IRQ = INT_DXB0_IRQ_REV1005;
        }      
        else if(system_rev == 0x1006)
        {
            gGPIO_DXB0_SCLK = GPIO_DXB0_SCLK_REV1006;
            gGPIO_DXB0_SFRM = GPIO_DXB0_SFRM_REV1006;
            gGPIO_DXB0_SDI = GPIO_DXB0_SDI_REV1006;
            gGPIO_DXB0_SDO = GPIO_DXB0_SDO_REV1006;
            gGPIO_DXB0_RST = GPIO_DXB0_RST_REV1006;
            gGPIO_DXB1_SCLK = GPIO_DXB1_SCLK_REV1006;
            gGPIO_DXB1_SFRM = GPIO_DXB1_SFRM_REV1006;
            gGPIO_DXB1_SDI = GPIO_DXB1_SDI_REV1006;
            gGPIO_DXB1_SDO = GPIO_DXB1_SDO_REV1006;
            gGPIO_DXB1_RST = GPIO_DXB1_RST_REV1006;
			gINT_DXB1_IRQ = INT_DXB1_IRQ_REV1006;
            gINT_DXB0_IRQ = INT_DXB0_IRQ_REV1006;
        }        
        else if(system_rev == 0x1008)
        {
            gGPIO_DXB0_SCLK = GPIO_DXB0_SCLK_REV1008;
            gGPIO_DXB0_SFRM = GPIO_DXB0_SFRM_REV1008;
            gGPIO_DXB0_SDI = GPIO_DXB0_SDI_REV1008;
            gGPIO_DXB0_SDO = GPIO_DXB0_SDO_REV1008;
            gGPIO_DXB0_RST = GPIO_DXB0_RST_REV1008;
            gGPIO_DXB1_SCLK = GPIO_DXB1_SCLK_REV1008;
            gGPIO_DXB1_SFRM = GPIO_DXB1_SFRM_REV1008;
            gGPIO_DXB1_SDI = GPIO_DXB1_SDI_REV1008;
            gGPIO_DXB1_SDO = GPIO_DXB1_SDO_REV1008;
            gGPIO_DXB1_RST = GPIO_DXB1_RST_REV1008;
			gINT_DXB1_IRQ = INT_DXB1_IRQ_REV1008;
            gINT_DXB0_IRQ = INT_DXB0_IRQ_REV1008;
        }        
		//TCC_GPE(2)
		tcc_gpio_config(gGPIO_DXB0_SFRM, GPIO_FN(0)|GPIO_PULL_DISABLE);
		gpio_request(gGPIO_DXB0_SFRM, NULL);
		gpio_direction_output(gGPIO_DXB0_SFRM, 0);
	
		//TCC_GPE(3)
		tcc_gpio_config(gGPIO_DXB0_SCLK, GPIO_FN(0)|GPIO_PULL_DISABLE);
		gpio_request(gGPIO_DXB0_SCLK, NULL);
		gpio_direction_output(gGPIO_DXB0_SCLK, 0);
	
		//TCC_GPE(4)
		tcc_gpio_config(gGPIO_DXB0_RST, GPIO_FN(0)|GPIO_PULL_DISABLE);
		gpio_request(gGPIO_DXB0_RST, NULL);
		gpio_direction_output(gGPIO_DXB0_RST, 0);
	
		//TCC_GPE(5)
		tcc_gpio_config(gINT_DXB0_IRQ, GPIO_FN(0)|GPIO_PULL_DISABLE);
		gpio_request(gINT_DXB0_IRQ, NULL);
		gpio_direction_output(gINT_DXB0_IRQ, 0);
	
		//TCC_GPE(6)
		tcc_gpio_config(gGPIO_DXB0_SDI, GPIO_FN(0)|GPIO_PULL_DISABLE);
		gpio_request(gGPIO_DXB0_SDI, NULL);
		gpio_direction_output(gGPIO_DXB0_SDI, 0);
	
		//TCC_GPE(7)
		tcc_gpio_config(gGPIO_DXB0_SDO, GPIO_FN(0)|GPIO_PULL_DISABLE);
		gpio_request(gGPIO_DXB0_SDO, NULL);
		gpio_direction_output(gGPIO_DXB0_SDO, 0);
	
		//TCC_GPD(5)
		tcc_gpio_config(gGPIO_DXB1_SFRM, GPIO_FN(0)|GPIO_PULL_DISABLE);
		gpio_request(gGPIO_DXB1_SFRM, NULL);
		gpio_direction_output(gGPIO_DXB1_SFRM, 0);
	
		//TCC_GPD(6)
		tcc_gpio_config(gGPIO_DXB1_SCLK, GPIO_FN(0)|GPIO_PULL_DISABLE);
		gpio_request(gGPIO_DXB1_SCLK, NULL);
		gpio_direction_output(gGPIO_DXB1_SCLK, 0);
	
		//TCC_GPD(7)
		tcc_gpio_config(gGPIO_DXB1_SDI, GPIO_FN(0)|GPIO_PULL_DISABLE);
		gpio_request(gGPIO_DXB1_SDI, NULL);
		gpio_direction_output(gGPIO_DXB1_SDI, 0);
	
		//TCC_GPD(8)
		tcc_gpio_config(gGPIO_DXB1_SDO, GPIO_FN(0)|GPIO_PULL_DISABLE);
		gpio_request(gGPIO_DXB1_SDO, NULL);
		gpio_direction_output(gGPIO_DXB1_SDO, 0);
	
		//TCC_GPD(9)
		tcc_gpio_config(gGPIO_DXB1_RST, GPIO_FN(0)|GPIO_PULL_DISABLE);
		gpio_request(gGPIO_DXB1_RST, NULL);
		gpio_direction_output(gGPIO_DXB1_RST, 0);
	
		//TCC_GPD(10)
		tcc_gpio_config(gINT_DXB1_IRQ, GPIO_FN(0)|GPIO_PULL_DISABLE);
		gpio_request(gINT_DXB1_IRQ, NULL);
		gpio_direction_output(gINT_DXB1_IRQ, 0);
	
		//smart Card Interface for CAS
		tcc_gpio_config(TCC_GPD(13), GPIO_FN(0)|GPIO_PULL_DISABLE);
		gpio_request(TCC_GPD(13), NULL);
		gpio_direction_output(TCC_GPD(13), 0);
	
		//smart Card Interface for CAS
		tcc_gpio_config(TCC_GPD(14), GPIO_FN(0)|GPIO_PULL_DISABLE);//
		gpio_request(TCC_GPD(14), NULL);
		gpio_direction_output(TCC_GPD(14), 0);

//////////////////////////////////////////////////////////////////////////////////////////////////////
		tcc_gpio_config(GPIO_DXB_ON, GPIO_FN(0)|GPIO_PULL_DISABLE);
		gpio_request(GPIO_DXB_ON, NULL);
		gpio_direction_output(GPIO_DXB_ON, 0);

		tcc_gpio_config(GPIO_DXB1_PD, GPIO_FN(0)|GPIO_PULL_DISABLE);
		gpio_request(GPIO_DXB1_PD, NULL);
		gpio_direction_output(GPIO_DXB1_PD, 0);		
#if 0
		tcc_gpio_config(GPIO_DXB_UARTTX, GPIO_FN(0)|GPIO_PULL_DISABLE);
		gpio_request(GPIO_DXB_UARTTX, NULL);
		gpio_direction_output(GPIO_DXB_UARTTX, 0);

		//TCC_GPE(5)
		tcc_gpio_config(GPIO_DXB_UARTRX, GPIO_FN(0)|GPIO_PULL_DISABLE);
		gpio_request(GPIO_DXB_UARTRX, NULL);
		gpio_direction_output(GPIO_DXB_UARTRX, 0);
#endif
	}
}
コード例 #29
0
static void tcc_dxb_ctrl_power_off(int deviceIdx)
{
	if(machine_is_tcc8920())
	{
		if(guiBoardType == BOARD_DXB_TCC3510 
		|| guiBoardType == BOARD_TDMB_TCC3161
		||  guiBoardType == BOARD_ISDBT_TCC353X)
		{
			switch(deviceIdx)
			{
			case 0:
				tcc_gpio_config(GPIO_DXB1_PD,  GPIO_FN(0));
				gpio_request(GPIO_DXB1_PD, NULL);
				gpio_direction_output(GPIO_DXB1_PD, 0);
				gpio_set_value(gGPIO_DXB1_RST, 0);
				break;
			case 1:
				tcc_gpio_config(GPIO_DXB2_PD,  GPIO_FN(0));
				gpio_request(GPIO_DXB2_PD, NULL);
				gpio_direction_output(GPIO_DXB2_PD, 0);
				gpio_set_value(gGPIO_DXB0_RST, 0);
				break;
			default:
				break;
			}
		}
		else if(guiBoardType == BOARD_DVBT_DIB9090)
		{
			tcc_gpio_config(GPIO_DXB1_PD,  GPIO_FN(0));
			gpio_request(GPIO_DXB1_PD, NULL);
			gpio_direction_output(GPIO_DXB1_PD, 0);
			gpio_set_value(gGPIO_DXB1_RST, 0);
		}
		else if(guiBoardType == BOARD_TDMB_TCC3150)
		{
			switch(deviceIdx)
			{
			case 0:
				gpio_set_value(GPIO_DXB1_PD, 0);
				gpio_set_value(gGPIO_DXB0_RST, 0);
				break;
			default:
				break;
			}
		}
		else if(guiBoardType == BOARD_ISDBT_TOSHIBA)
		{
			switch (deviceIdx)
			{
			case 0:
				gpio_set_value(gGPIO_DXB0_RST, 0);
				break;
			default:
				break;
			}
		}
		else if (guiBoardType == BOARD_ISDBT_DIB10096)
		{
			//GPIO_E[7] = PWDN#
			tcc_gpio_config(gGPIO_DXB0_SDO, GPIO_FN(0));
			gpio_direction_output(gGPIO_DXB0_SDO, 0);

			//GPIO_E[4] = RST#
			tcc_gpio_config(gGPIO_DXB0_RST, GPIO_FN(0));
			gpio_direction_output(gGPIO_DXB0_RST, 0);
		}

		/* GPIO_EXPAND DXB_ON Power-off */
		gpio_request(GPIO_DXB_ON,NULL);
		gpio_direction_output(GPIO_DXB_ON, 0);
		/* GPIO_EXPAND DEEPPWDN Power-off */
		gpio_request(GPIO_DXB1_PD,NULL);
		gpio_direction_output(GPIO_DXB1_PD, 0);
	}
}
コード例 #30
0
static int tcc_bluetooth_probe(struct platform_device *pdev)
{
	int rc = 0;
	int ret = 0;

	printk("[## BT ##] tcc_bluetooth_probe\n");
	if( machine_is_tcc8800()|| machine_is_tcc8920()) {      // #elif defined (CONFIG_MACH_TCC9300)
			//gpio_set_value(TCC_GPEXT1(7), 0);   /* BT-ON Disable */
		gpio_request(TCC_GPEXT3(2), "bt_wake");
	       gpio_request(TCC_GPEXT2(4), "bt_reset");
		gpio_direction_output(TCC_GPEXT3(2), 0); // output
		gpio_direction_output(TCC_GPEXT2(4), 0);
#if defined(CONFIG_TCC_CSR_BC0406_MODULE_SUPPORT) && defined(CONFIG_TCC_CSR_HOST_WAKE_UP)
		tcc_gpio_config(TCC_GPB(31), GPIO_FN(0));
		gpio_request(TCC_GPEXT3(3), "bt_hwake");
		gpio_direction_input(TCC_GPEXT3(3));
#endif // for CSR Bluetooth host wake up
	}
	else if(machine_is_m801_88() || machine_is_m803())
	{
		#if defined(CONFIG_TCC_RDA_587X_MODULE_SUPPORT)
		gpio_request(TCC_GPA(13), "LDO_ON");
		tcc_gpio_config(TCC_GPA(13), GPIO_FN(0));
		gpio_direction_output(TCC_GPA(13), 0);
		#else
		gpio_request(TCC_GPA(13), "bt_reset");
		gpio_request(TCC_GPB(22), "BT WAKE");
		gpio_direction_output(TCC_GPA(13), 0); // output
		gpio_direction_output(TCC_GPB(22), 0); // output
		#endif

	}
	else if(machine_is_tcc8800st())
	{
		gpio_request(TCC_GPC(31), "bt_power");
		gpio_request(TCC_GPD(12), "bt_reset");
		gpio_direction_output(TCC_GPC(31), 0); // output
		gpio_direction_output(TCC_GPD(12), 0); // output
	}
/*
	rc = gpio_request(BT_RESET_GPIO, "bcm4330_nreset_gpip");
	if (unlikely(rc)) {
		return rc;
	}

	rc = gpio_request(BT_REG_GPIO, "bcm4330_nshutdown_gpio");
	if (unlikely(rc)) {
		gpio_free(BT_RESET_GPIO);
		return rc;
	}
*/
	bt_rfkill = rfkill_alloc("Telechips Bluetooth", &pdev->dev,
				RFKILL_TYPE_BLUETOOTH, &tcc_bt_rfkill_ops,
				NULL);

	if (unlikely(!bt_rfkill)) {
		//gpio_free(BT_RESET_GPIO);
		//gpio_free(BT_REG_GPIO);
		printk("[## BT ##] rfkill_alloc failed \n");
		return -ENOMEM;
	}

	rc = rfkill_register(bt_rfkill);

	if (unlikely(rc)) {
		printk("[## BT ##] rfkill_register failed \n");
		rfkill_destroy(bt_rfkill);
		//gpio_free(BT_RESET_GPIO);
		//gpio_free(BT_REG_GPIO);
		return -1;
	}

	printk("[## BT ##] rfkill_register Telechips Bluetooth \n");

	rfkill_set_states(bt_rfkill, true, false);
	tcc_bt_rfkill_set_power(NULL, true);

#if defined (CONFIG_TCC_BRCM_BCM4330_MODULE_SUPPORT)
	ret = bcm_bt_lpm_init(pdev);
	if (ret) {
		rfkill_unregister(bt_rfkill);
		rfkill_destroy(bt_rfkill);

		//gpio_free(BT_RESET_GPIO);
		//gpio_free(BT_REG_GPIO);
	}
#endif

	return ret;
}