コード例 #1
0
void bt_uart_rts_ctrl(int flag)
{
	if(!gpio_get_value(GPIO_BT_nRST))
		return;

	if(flag) {
		// BT RTS Set to HIGH
		s3c_gpio_cfgpin(S5PV310_GPA0(3), S3C_GPIO_OUTPUT);
		s3c_gpio_setpull(S5PV310_GPA0(3), S3C_GPIO_PULL_NONE);
		gpio_set_value(S5PV310_GPA0(3), 1);

                s3c_gpio_slp_cfgpin(S5PV310_GPA0(3), S3C_GPIO_SLP_OUT0);
		s3c_gpio_slp_setpull_updown(S5PV310_GPA0(3), S3C_GPIO_PULL_NONE);
	}
	else {
		// BT RTS Set to LOW
		s3c_gpio_cfgpin(S5PV310_GPA0(3), S3C_GPIO_OUTPUT);
		gpio_set_value(S5PV310_GPA0(3), 0);

		s3c_gpio_cfgpin(S5PV310_GPA0(3), S3C_GPIO_SFN(2));
		s3c_gpio_setpull(S5PV310_GPA0(3), S3C_GPIO_PULL_NONE);
	}
}
コード例 #2
0
#define S5PV310_BANK_BASE3(bank_nr)	(S5PV310_VA_GPIO3 + ((bank_nr) * 0x20))

/*
 * Following are the gpio banks in v310.
 *
 * The 'config' member when left to NULL, is initialized to the default
 * structure gpio_cfg in the init function below.
 *
 * The 'base' member is also initialized in the init function below.
 * Note: The initialization of 'base' member of s3c_gpio_chip structure
 * uses the above macro and depends on the banks being listed in order here.
 */
static struct s3c_gpio_chip s5pv310_gpio_part1_4bit[] = {
	{
		.chip	= {
			.base	= S5PV310_GPA0(0),
			.ngpio	= S5PV310_GPIO_A0_NR,
			.label	= "GPA0",
		},
	}, {
		.chip	= {
			.base	= S5PV310_GPA1(0),
			.ngpio	= S5PV310_GPIO_A1_NR,
			.label	= "GPA1",
		},
	}, {
		.chip	= {
			.base	= S5PV310_GPB(0),
			.ngpio	= S5PV310_GPIO_B_NR,
			.label	= "GPB",
		},
コード例 #3
0
static struct rfkill *bt_rfk;
static const char bt_name[] = "bcm4330";

#ifdef BT_SLEEP_ENABLE
static struct wake_lock bt_wake_lock;
static struct rfkill *bt_sleep_rfk;
#endif /* BT_SLEEP_ENABLE */

volatile int bt_is_running = 0;
EXPORT_SYMBOL(bt_is_running);

extern int s3c_gpio_slp_cfgpin(unsigned int pin, unsigned int config);
extern int s3c_gpio_slp_setpull_updown(unsigned int pin, unsigned int config);

static unsigned int bt_uart_on_table[][4] = {
	{S5PV310_GPA0(0), 2, 2, S3C_GPIO_PULL_UP},
	{S5PV310_GPA0(1), 2, 2, S3C_GPIO_PULL_NONE},
	{S5PV310_GPA0(2), 2, 2, S3C_GPIO_PULL_NONE},
	{S5PV310_GPA0(3), 2, 2, S3C_GPIO_PULL_NONE},
};

/*
static unsigned int bt_uart_off_table[][4] = {
	{S5PV310_GPA0(0), 1, 2, S3C_GPIO_PULL_UP},
	{S5PV310_GPA0(1), 1, 2, S3C_GPIO_PULL_NONE},
	{S5PV310_GPA0(2), 1, 2, S3C_GPIO_PULL_NONE},
	{S5PV310_GPA0(3), 1, 2, S3C_GPIO_PULL_NONE},
};
*/

void bt_config_gpio_table(int array_size, unsigned int (*gpio_table)[4])