本文整理汇总了C++中s3c_gpio_cfgpin函数的典型用法代码示例。如果您正苦于以下问题:C++ s3c_gpio_cfgpin函数的具体用法?C++ s3c_gpio_cfgpin怎么用?C++ s3c_gpio_cfgpin使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了s3c_gpio_cfgpin函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: s5pv210_setup_sdhci3_cfg_gpio
void s5pv210_setup_sdhci3_cfg_gpio(struct platform_device *dev, int width)
{
unsigned int gpio;
#if defined (CONFIG_TARGET_LOCALE_EUR) || defined(CONFIG_TARGET_LOCALE_HKTW) || defined (CONFIG_TARGET_LOCALE_HKTW_FET) || defined(CONFIG_TARGET_LOCALE_VZW) || defined(CONFIG_TARGET_LOCALE_USAGSM)
if (HWREV >= 12) {
#else /* CONFIG_TARGET_LOCALE_KOR */
if (HWREV >= 10 && HWREV != 17) {
#endif /* CONFIG_TARGET_LOCALE */
switch (width) {
/* Channel 3 supports 4-bit bus width */
case 0:
case 1:
case 4:
/* Set all the necessary GPIO function and pull up/down */
for (gpio = S5PV210_GPG3(0); gpio <= S5PV210_GPG3(6); gpio++) {
if (gpio != S5PV210_GPG3(2)) {
s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2));
s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
}
}
writel(0x2aaa, S5PV210_GPG3DRV);
/* Chip detect pin Pull up*/
/* S5PV210_GPG3(2) is WLAN_reset, Chip detect pin is not required. */
// s3c_gpio_setpull(S5PV210_GPG3(2), S3C_GPIO_PULL_UP);
break;
default:
printk(KERN_ERR "Wrong SD/MMC bus width : %d\n", width);
}
}
}
#define S3C_SDHCI_CTRL3_FCSELTX_INVERT (0)
#define S3C_SDHCI_CTRL3_FCSELTX_BASIC (S3C_SDHCI_CTRL3_FCSEL3 | S3C_SDHCI_CTRL3_FCSEL2)
#define S3C_SDHCI_CTRL3_FCSELRX_INVERT (0)
#define S3C_SDHCI_CTRL3_FCSELRX_BASIC (S3C_SDHCI_CTRL3_FCSEL1 | S3C_SDHCI_CTRL3_FCSEL0)
void s5pv210_setup_sdhci_cfg_card(struct platform_device *dev,
void __iomem *r,
struct mmc_ios *ios,
struct mmc_card *card)
{
u32 ctrl2;
u32 ctrl3;
ctrl2 = readl(r + S3C_SDHCI_CONTROL2);
ctrl2 &= S3C_SDHCI_CTRL2_SELBASECLK_MASK;
ctrl2 |= (S3C64XX_SDHCI_CTRL2_ENSTAASYNCCLR |
S3C64XX_SDHCI_CTRL2_ENCMDCNFMSK |
S3C_SDHCI_CTRL2_DFCNT_NONE |
S3C_SDHCI_CTRL2_ENCLKOUTHOLD);
if (ios->clock <= (400 * 1000)) {
ctrl2 &= ~(S3C_SDHCI_CTRL2_ENFBCLKTX | S3C_SDHCI_CTRL2_ENFBCLKRX);
ctrl3 = 0;
} else {
u32 range_start;
u32 range_end;
ctrl2 |= S3C_SDHCI_CTRL2_ENFBCLKTX | S3C_SDHCI_CTRL2_ENFBCLKRX;
if (card->type == MMC_TYPE_MMC) /* MMC */
range_start = 20 * 1000 * 1000;
else /* SD, SDIO */
range_start = 25 * 1000 * 1000;
range_end = 37 * 1000 * 1000;
if ((ios->clock > range_start) && (ios->clock < range_end)) {
ctrl3 = S3C_SDHCI_CTRL3_FCSELTX_BASIC |
S3C_SDHCI_CTRL3_FCSELRX_BASIC;
} else {
#if defined (CONFIG_TARGET_LOCALE_EUR) || defined (CONFIG_TARGET_LOCALE_HKTW) || defined (CONFIG_TARGET_LOCALE_HKTW_FET) || defined (CONFIG_TARGET_LOCALE_USAGSM)
if (card->type == MMC_TYPE_SD)
ctrl3 = S3C_SDHCI_CTRL3_FCSELTX_BASIC |
S3C_SDHCI_CTRL3_FCSELRX_BASIC;
else
#endif /* CONFIG_TARGET_LOCALE_EUR */
ctrl3 = S3C_SDHCI_CTRL3_FCSELTX_BASIC |
S3C_SDHCI_CTRL3_FCSELRX_INVERT;
}
}
writel(ctrl2, r + S3C_SDHCI_CONTROL2);
writel(ctrl3, r + S3C_SDHCI_CONTROL3);
}
开发者ID:xxSynGatesA7Xxx,项目名称:sgtkernel_tmobile,代码行数:88,代码来源:setup-sdhci.c
示例2: s6d6aa1_probe
static int s6d6aa1_probe(struct device *dev)
{
int ret = 0;
struct lcd_info *lcd;
lcd = kzalloc(sizeof(struct lcd_info), GFP_KERNEL);
if (!lcd) {
pr_err("failed to allocate for lcd\n");
ret = -ENOMEM;
goto err_alloc;
}
g_lcd = lcd;
lcd->ld = lcd_device_register("panel", dev, lcd, &panel_lcd_ops);
if (IS_ERR(lcd->ld)) {
pr_err("failed to register lcd device\n");
ret = PTR_ERR(lcd->ld);
goto out_free_lcd;
}
lcd->bd = backlight_device_register("panel", dev, lcd, &panel_backlight_ops, NULL);
if (IS_ERR(lcd->bd)) {
pr_err("failed to register backlight device\n");
ret = PTR_ERR(lcd->bd);
goto out_free_backlight;
}
lcd->dev = dev;
lcd->dsim = (struct dsim_global *)dev_get_drvdata(dev->parent);
lcd->bd->props.max_brightness = MAX_BRIGHTNESS;
lcd->bd->props.brightness = DEFAULT_BRIGHTNESS;
lcd->bl = 0;
lcd->current_bl = lcd->bl;
lcd->power = FB_BLANK_UNBLANK;
lcd->ldi_enable = 1;
lcd->connected = 1;
ret = device_create_file(&lcd->ld->dev, &dev_attr_lcd_type);
if (ret < 0)
dev_err(&lcd->ld->dev, "failed to add sysfs entries, %d\n", __LINE__);
ret = device_create_file(&lcd->bd->dev, &dev_attr_auto_brightness);
if (ret < 0)
dev_err(&lcd->ld->dev, "failed to add sysfs entries, %d\n", __LINE__);
dev_set_drvdata(dev, lcd);
mutex_init(&lcd->lock);
mutex_init(&lcd->bl_lock);
dev_info(&lcd->ld->dev, "s6e8aa0 lcd panel driver has been probed.\n");
#if defined(GPIO_OLED_DET)
if (lcd->connected) {
INIT_DELAYED_WORK(&lcd->oled_detection, oled_detection_work);
lcd->irq = gpio_to_irq(GPIO_OLED_DET);
s3c_gpio_cfgpin(GPIO_OLED_DET, S3C_GPIO_SFN(0xf));
s3c_gpio_setpull(GPIO_OLED_DET, S3C_GPIO_PULL_NONE);
if (request_irq(lcd->irq, oled_detection_int,
IRQF_TRIGGER_FALLING, "oled_detection", lcd))
pr_err("failed to reqeust irq. %d\n", lcd->irq);
}
#endif
lcd_early_suspend = s6d6aa1_early_suspend;
lcd_late_resume = s6d6aa1_late_resume;
return 0;
out_free_backlight:
lcd_device_unregister(lcd->ld);
kfree(lcd);
return ret;
out_free_lcd:
kfree(lcd);
return ret;
err_alloc:
return ret;
}
开发者ID:android-armv7a-belalang-tempur,项目名称:android_kernel_samsung_smdk4210-1,代码行数:85,代码来源:s6d6aa1.c
示例3: max8997_motor_init
static void max8997_motor_init(void)
{
gpio_request(GPIO_VIBTONE_EN, "VIBTONE_EN");
s3c_gpio_cfgpin(GPIO_VIBTONE_EN, S3C_GPIO_OUTPUT);
s3c_gpio_setpull(GPIO_VIBTONE_EN, S3C_GPIO_PULL_NONE);
}
开发者ID:rfcclub,项目名称:Googy-Max2-Kernel,代码行数:6,代码来源:naples-power.c
示例4: modemctl_cfg_gpio
static void modemctl_cfg_gpio(void)
{
int err = 0;
unsigned gpio_phone_on = mdmctl_data.gpio_phone_on;
unsigned gpio_phone_active = mdmctl_data.gpio_phone_active;
unsigned gpio_cp_rst = mdmctl_data.gpio_cp_reset;
unsigned gpio_pda_active = mdmctl_data.gpio_pda_active;
unsigned gpio_usim_boot = mdmctl_data.gpio_usim_boot;
unsigned gpio_flm_sel = mdmctl_data.gpio_flm_sel;
unsigned gpio_flm_sel_03 = mdmctl_data.gpio_flm_sel_03;
//unsigned gpio_sim_ndetect = mdmctl_data.gpio_sim_ndetect;
err = gpio_request(gpio_phone_on, "PHONE_ON");
if (err) {
printk("fail to request gpio %s\n","PHONE_ON");
} else {
gpio_direction_output(gpio_phone_on, GPIO_LEVEL_LOW);
s3c_gpio_setpull(gpio_phone_on, S3C_GPIO_PULL_NONE);
}
err = gpio_request(gpio_cp_rst, "CP_RST");
if (err) {
printk("fail to request gpio %s\n","CP_RST");
} else {
gpio_direction_output(gpio_cp_rst, GPIO_LEVEL_LOW);
s3c_gpio_setpull(gpio_cp_rst, S3C_GPIO_PULL_NONE);
}
err = gpio_request(gpio_pda_active, "PDA_ACTIVE");
if (err) {
printk("fail to request gpio %s\n","PDA_ACTIVE");
} else {
gpio_direction_output(gpio_pda_active, GPIO_LEVEL_LOW);
s3c_gpio_setpull(gpio_pda_active, S3C_GPIO_PULL_NONE);
}
err = gpio_request(gpio_usim_boot, "USIM_BOOT");
if (err) {
printk("fail to request gpio %s\n","USIM_BOOT");
} else {
gpio_direction_output(gpio_usim_boot, GPIO_LEVEL_LOW);
s3c_gpio_setpull(gpio_usim_boot, S3C_GPIO_PULL_NONE);
}
if(HWREV > 3) {
err = gpio_request(gpio_flm_sel, "FLM_SEL");
if (err) {
printk("fail to request gpio %s\n","FLM_SEL");
} else {
gpio_direction_output(gpio_flm_sel, GPIO_LEVEL_LOW);
s3c_gpio_setpull(gpio_flm_sel, S3C_GPIO_PULL_NONE);
}
} else {
err = gpio_request(gpio_flm_sel_03, "FLM_SEL");
if (err) {
printk("fail to request gpio %s\n","FLM_SEL");
} else {
gpio_direction_output(gpio_flm_sel_03, GPIO_LEVEL_LOW);
s3c_gpio_setpull(gpio_flm_sel_03, S3C_GPIO_PULL_NONE);
}
}
s3c_gpio_cfgpin(gpio_phone_active, S3C_GPIO_SFN(0xF));
s3c_gpio_setpull(gpio_phone_active, S3C_GPIO_PULL_NONE);
irq_set_irq_type(gpio_phone_active, IRQ_TYPE_EDGE_BOTH);
/*s3c_gpio_cfgpin(gpio_sim_ndetect, S3C_GPIO_SFN(0xF));
s3c_gpio_setpull(gpio_sim_ndetect, S3C_GPIO_PULL_NONE);
irq_set_irq_type(gpio_sim_ndetect, IRQ_TYPE_EDGE_BOTH);*/
}
开发者ID:AttiJeong98,项目名称:android_kernel_samsung_aries-kor,代码行数:68,代码来源:dev-s1-phone.c
示例5: smartq_bl_init
static int smartq_bl_init(struct device *dev)
{
s3c_gpio_cfgpin(S3C64XX_GPF(15), S3C_GPIO_SFN(2));
return 0;
}
开发者ID:08opt,项目名称:linux,代码行数:6,代码来源:mach-smartq.c
示例6: exynos4_setup_mshci_set_power
void exynos4_setup_mshci_set_power(struct platform_device *dev, int en)
{
struct s3c_mshci_platdata *pdata = dev->dev.platform_data;
unsigned int gpio = 0;
if (pdata->int_power_gpio) {
if (en) {
#if defined(CONFIG_MACH_Q1_BD)
mdelay(20);
#elif defined(CONFIG_MACH_PX)
mdelay(10);
#endif
/*CMD/CLK*/
for (gpio = EXYNOS4_GPK0(0); gpio < EXYNOS4_GPK0(2);
gpio++) {
s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
}
/*DAT[0]~[3]*/
for (gpio = EXYNOS4_GPK0(3); gpio <= EXYNOS4_GPK0(6);
gpio++) {
s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3));
s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
}
/*DAT[4]~[7]*/
for (gpio = EXYNOS4_GPK1(3); gpio <= EXYNOS4_GPK1(6);
gpio++) {
s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(4));
s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
}
gpio_set_value(pdata->int_power_gpio, 1);
pr_info("%s : internal MMC Card ON samsung-mshc.\n",
__func__);
} else {
#if defined(CONFIG_MACH_M0_CTC)
s3c_gpio_cfgpin(pdata->int_power_gpio, S3C_GPIO_OUTPUT);
s3c_gpio_setpull(pdata->int_power_gpio,
S3C_GPIO_PULL_NONE);
#endif
gpio_set_value(pdata->int_power_gpio, 0);
/*CMD/CLK*/
for (gpio = EXYNOS4_GPK0(0); gpio < EXYNOS4_GPK0(2);
gpio++) {
s3c_gpio_cfgpin(gpio, S3C_GPIO_INPUT);
s3c_gpio_setpull(gpio, S3C_GPIO_PULL_DOWN);
}
/*DAT[0]~[3]*/
for (gpio = EXYNOS4_GPK0(3); gpio <= EXYNOS4_GPK0(6);
gpio++) {
s3c_gpio_cfgpin(gpio, S3C_GPIO_INPUT);
s3c_gpio_setpull(gpio, S3C_GPIO_PULL_DOWN);
}
/*DAT[4]~[7]*/
for (gpio = EXYNOS4_GPK1(3); gpio <= EXYNOS4_GPK1(6);
gpio++) {
s3c_gpio_cfgpin(gpio, S3C_GPIO_INPUT);
s3c_gpio_setpull(gpio, S3C_GPIO_PULL_DOWN);
}
pr_info("%s : internal MMC Card OFF samsung-mshc.\n",
__func__);
mdelay(50);
}
}
}
开发者ID:Lukiqq,项目名称:GT-I9100-Galaxian-ICS-Kernel,代码行数:66,代码来源:setup-mshci-gpio.c
示例7: origen_power_init
static void __init origen_power_init(void)
{
gpio_request(EXYNOS4_GPX0(4), "PMIC_IRQ");
s3c_gpio_cfgpin(EXYNOS4_GPX0(4), S3C_GPIO_SFN(0xf));
s3c_gpio_setpull(EXYNOS4_GPX0(4), S3C_GPIO_PULL_NONE);
}
开发者ID:0x000000FF,项目名称:Linux4Edison,代码行数:6,代码来源:mach-origen.c
示例8: s5pv310_cfg_i2s
static int s5pv310_cfg_i2s(struct platform_device *pdev)
{
/* configure GPIO for i2s port */
switch (pdev->id) {
case 1:
s3c_gpio_cfgpin(S5PV310_GPC0(0), S3C_GPIO_SFN(2));
s3c_gpio_cfgpin(S5PV310_GPC0(1), S3C_GPIO_SFN(2));
s3c_gpio_cfgpin(S5PV310_GPC0(2), S3C_GPIO_SFN(2));
s3c_gpio_cfgpin(S5PV310_GPC0(3), S3C_GPIO_SFN(2));
s3c_gpio_cfgpin(S5PV310_GPC0(4), S3C_GPIO_SFN(2));
break;
case 2:
s3c_gpio_cfgpin(S5PV310_GPC1(0), S3C_GPIO_SFN(2));
s3c_gpio_cfgpin(S5PV310_GPC1(1), S3C_GPIO_SFN(2));
s3c_gpio_cfgpin(S5PV310_GPC1(2), S3C_GPIO_SFN(2));
s3c_gpio_cfgpin(S5PV310_GPC1(3), S3C_GPIO_SFN(2));
s3c_gpio_cfgpin(S5PV310_GPC1(4), S3C_GPIO_SFN(2));
break;
case -1:
s3c_gpio_cfgpin(S5PV310_GPZ(0), S3C_GPIO_SFN(2));
s3c_gpio_cfgpin(S5PV310_GPZ(1), S3C_GPIO_SFN(2));
s3c_gpio_cfgpin(S5PV310_GPZ(2), S3C_GPIO_SFN(2));
s3c_gpio_cfgpin(S5PV310_GPZ(3), S3C_GPIO_SFN(2));
s3c_gpio_cfgpin(S5PV310_GPZ(4), S3C_GPIO_SFN(2));
s3c_gpio_cfgpin(S5PV310_GPZ(5), S3C_GPIO_SFN(2));
s3c_gpio_cfgpin(S5PV310_GPZ(6), S3C_GPIO_SFN(2));
break;
default:
printk(KERN_ERR "Invalid Device %d\n", pdev->id);
return -EINVAL;
}
return 0;
}
开发者ID:alanorth,项目名称:samsung-kernel-p6200,代码行数:35,代码来源:dev-audio.c
示例9: s5pv310_pcm_cfg_gpio
static int s5pv310_pcm_cfg_gpio(struct platform_device *pdev)
{
switch (pdev->id) {
case 1:
s3c_gpio_cfgpin(S5PV310_GPC0(0), S3C_GPIO_SFN(3));
s3c_gpio_cfgpin(S5PV310_GPC0(1), S3C_GPIO_SFN(3));
s3c_gpio_cfgpin(S5PV310_GPC0(2), S3C_GPIO_SFN(3));
s3c_gpio_cfgpin(S5PV310_GPC0(3), S3C_GPIO_SFN(3));
s3c_gpio_cfgpin(S5PV310_GPC0(4), S3C_GPIO_SFN(3));
break;
case 2:
s3c_gpio_cfgpin(S5PV310_GPC1(0), S3C_GPIO_SFN(3));
s3c_gpio_cfgpin(S5PV310_GPC1(1), S3C_GPIO_SFN(3));
s3c_gpio_cfgpin(S5PV310_GPC1(2), S3C_GPIO_SFN(3));
s3c_gpio_cfgpin(S5PV310_GPC1(3), S3C_GPIO_SFN(3));
s3c_gpio_cfgpin(S5PV310_GPC1(4), S3C_GPIO_SFN(3));
break;
case 0:
s3c_gpio_cfgpin(S5PV310_GPZ(0), S3C_GPIO_SFN(3));
s3c_gpio_cfgpin(S5PV310_GPZ(1), S3C_GPIO_SFN(3));
s3c_gpio_cfgpin(S5PV310_GPZ(2), S3C_GPIO_SFN(3));
s3c_gpio_cfgpin(S5PV310_GPZ(3), S3C_GPIO_SFN(3));
s3c_gpio_cfgpin(S5PV310_GPZ(4), S3C_GPIO_SFN(3));
s3c_gpio_cfgpin(S5PV310_GPZ(5), S3C_GPIO_SFN(3));
s3c_gpio_cfgpin(S5PV310_GPZ(6), S3C_GPIO_SFN(3));
break;
default:
printk(KERN_DEBUG "Invalid PCM Controller number!");
return -EINVAL;
}
return 0;
}
开发者ID:alanorth,项目名称:samsung-kernel-p6200,代码行数:33,代码来源:dev-audio.c
示例10: bcm4329_wifi_power
int bcm4329_wifi_power(int on)
{
int ret;
struct regulator *wlan32k_regulator;
static int regulator_flag = 0;
printk("%s: %d\n", __func__, on);
/*stuttgart, enable max77676 32khz for wlan*/
wlan32k_regulator = regulator_get(NULL, "wlan_32khz");
if(IS_ERR(wlan32k_regulator)){
pr_err("%s: failed to get %s\n", __func__, "wlan_32khz");
return -1;
};
/*end*/
mdelay(100);
if(on)
{
/*stuttgart, enable max77676 32khz for wlan*/
if(!regulator_flag) {
regulator_enable(wlan32k_regulator);
regulator_flag = 1;
}
/*end*/
/* ret = gpio_request(WL_REG_ON, WL_REG_ON_DES);
if (ret)
printk(KERN_ERR "#### failed to request GPK3-2\n ");
*/ s3c_gpio_cfgpin(WL_REG_ON, S3C_GPIO_OUTPUT);
s3c_gpio_setpull(WL_REG_ON, S3C_GPIO_PULL_NONE);
gpio_set_value(WL_REG_ON, 1);
s5p_gpio_set_pd_cfg(WL_REG_ON, S5P_GPIO_PD_OUTPUT1);
s5p_gpio_set_pd_pull(WL_REG_ON, S5P_GPIO_PD_UPDOWN_DISABLE);
/*
ret = gpio_request(EXYNOS4_GPX2(7), "GPX2");
if (ret)
printk(KERN_ERR "#### failed to request GPX2-7\n ");
s3c_gpio_cfgpin(EXYNOS4_GPX2(7), S3C_GPIO_SFN(0x2));
s3c_gpio_setpull (EXYNOS4_GPX2(7),S3C_GPIO_PULL_NONE);
*/
//irq_set_irq_wake(gpio_to_irq(EXYNOS4_GPX2(7)), 1);
}
else
{
s3c_gpio_cfgpin(WL_REG_ON, S3C_GPIO_INPUT);
s3c_gpio_setpull(WL_REG_ON, S3C_GPIO_PULL_DOWN);
s5p_gpio_set_pd_cfg(WL_REG_ON, S5P_GPIO_PD_INPUT);
s5p_gpio_set_pd_pull(WL_REG_ON, S5P_GPIO_PD_DOWN_ENABLE);
//irq_set_irq_wake(gpio_to_irq(EXYNOS4_GPX2(7)), 0);
/*
s3c_gpio_cfgpin(EXYNOS4_GPX2(7), S3C_GPIO_INPUT);
s3c_gpio_setpull (EXYNOS4_GPX2(7),S3C_GPIO_PULL_DOWN);
*/
/*gpio_free(WL_REG_ON);*/
/*gpio_free(EXYNOS4_GPX2(7));*/
/*stuttgart, disable max77676 32khz for wlan*/
if(regulator_flag) {
regulator_disable(wlan32k_regulator);
regulator_flag = 0;
}
/*end*/
}
/*stuttgart, put regulator*/
regulator_put(wlan32k_regulator);
/*end*/
mdelay(200);
bcm4329_wifi_power_state = on;
return 0;
}
开发者ID:Frontier314,项目名称:kernel_s702hf,代码行数:76,代码来源:dev-hsmmc3.c
示例11: cdma_manager_probe
static int cdma_manager_probe(struct platform_device *dev)
{
/* if (gpio_is_valid(GPIO_CDMA_PWR_ON_OUT)) {
if (gpio_request(GPIO_CDMA_PWR_ON_OUT, "GPH2"))
printk(KERN_ERR "Failed to request GPIO_CDMA_PWR_ON_OUT!\n");
gpio_direction_output(GPIO_CDMA_PWR_ON_OUT, GPIO_LEVEL_LOW);
}
s3c_gpio_setpull(GPIO_CDMA_PWR_ON_OUT, S3C_GPIO_PULL_DOWN);
if (gpio_is_valid(GPIO_CDMA_RESET_OUT)) {
if (gpio_request(GPIO_CDMA_RESET_OUT, "GPH2"))
printk(KERN_ERR "Failed to request GPIO_CDMA_RESET_OUT!\n");
gpio_direction_output(GPIO_CDMA_RESET_OUT, GPIO_LEVEL_LOW);
}
s3c_gpio_setpull(GPIO_CDMA_RESET_OUT, S3C_GPIO_PULL_NONE);
if (gpio_is_valid(GPIO_CDMA_READY_SIGNAL_IN)) {
if (gpio_request(GPIO_CDMA_READY_SIGNAL_IN, "GPH2"))
printk(KERN_ERR "Failed to request GPIO_CDMA_READY_SIGNAL_IN!\n");
gpio_direction_input(GPIO_CDMA_READY_SIGNAL_IN);
}
s3c_gpio_setpull(GPIO_CDMA_READY_SIGNAL_IN, S3C_GPIO_PULL_DOWN);
if (gpio_is_valid(GPIO_CDMA_SLEEP_CTL_OUT)) {
if (gpio_request(GPIO_CDMA_SLEEP_CTL_OUT, "GPH2"))
printk(KERN_ERR "Failed to request GPIO_CDMA_SLEEP_CTL_OUT!\n");
gpio_direction_output(GPIO_CDMA_SLEEP_CTL_OUT,1);
}
s3c_gpio_setpull(GPIO_CDMA_SLEEP_CTL_OUT, S3C_GPIO_PULL_UP);*/
int ret = 0;
int irq;
ril_wakeup = 1;
ret = device_create_file(&(dev->dev), &dev_attr_wakeup);
if (ret < 0) {
printk("failed to add sysfs entries\n");
return -1;
}
//[yoon 20110504]changed cdma power squency : iriver_init_gpio() -> cdma_manager_probe()
#if 1
mx100_cdma_power(0);
#endif
s3c_gpio_cfgpin(GPIO_CDMA_HOST_WAKE, S3C_GPIO_SFN(0xF));
s3c_gpio_setpull(GPIO_CDMA_HOST_WAKE, S3C_GPIO_PULL_NONE);
cdma_uart_port_config(3);
irq = IRQ_CDMA_HOST_WAKE;
wake_lock_init(&cdma_wake_lock, WAKE_LOCK_SUSPEND, "cdma_host_wake");
ret = request_irq(irq, cdma_host_wake_irq_handler,IRQF_TRIGGER_RISING,
"cdma_host_wake_irq_handler", NULL);
if (ret < 0) {
pr_err("[CDMA] Request_irq failed\n");
return ret;
}
disable_irq(irq);
ret = enable_irq_wake(irq);
if (ret < 0)
pr_err("[CDMA] set wakeup src failed\n");
enable_irq(irq);
return 0;
}
开发者ID:sktjdgns1189,项目名称:android_kernel_iriver_MX100,代码行数:69,代码来源:cdma_manager.c
示例12: setup_sdhci0_gpio_wp
static void setup_sdhci0_gpio_wp(void)
{
s3c_gpio_cfgpin(S5PV210_GPH0(7), S3C_GPIO_INPUT);
s3c_gpio_setpull(S5PV210_GPH0(7), S3C_GPIO_PULL_DOWN);
}
开发者ID:xxSynGatesA7Xxx,项目名称:sgtkernel_tmobile,代码行数:5,代码来源:setup-sdhci.c
示例13: bast_pm_resume
static void bast_pm_resume(void)
{
s3c_gpio_cfgpin(S3C2410_GPA(21), S3C2410_GPA21_nRSTOUT);
}
开发者ID:Jackeagle,项目名称:android_kernel_sony_c2305,代码行数:4,代码来源:mach-bast.c
示例14: jive_machine_init
//.........这里部分代码省略.........
S3C2412_SLPCON_PULL(10) |
S3C2412_SLPCON_PULL(11) |
S3C2412_SLPCON_PULL(12) |
S3C2412_SLPCON_PULL(13) |
S3C2412_SLPCON_PULL(14) |
S3C2412_SLPCON_PULL(15), S3C2412_GPCSLPCON);
/* Port D sleep */
__raw_writel(S3C2412_SLPCON_ALL_PULL, S3C2412_GPDSLPCON);
/* Port F sleep */
__raw_writel(S3C2412_SLPCON_LOW(0) |
S3C2412_SLPCON_LOW(1) |
S3C2412_SLPCON_LOW(2) |
S3C2412_SLPCON_EINT(3) |
S3C2412_SLPCON_EINT(4) |
S3C2412_SLPCON_EINT(5) |
S3C2412_SLPCON_EINT(6) |
S3C2412_SLPCON_EINT(7), S3C2412_GPFSLPCON);
/* Port G sleep */
__raw_writel(S3C2412_SLPCON_IN(0) |
S3C2412_SLPCON_IN(1) |
S3C2412_SLPCON_IN(2) |
S3C2412_SLPCON_IN(3) |
S3C2412_SLPCON_IN(4) |
S3C2412_SLPCON_IN(5) |
S3C2412_SLPCON_IN(6) |
S3C2412_SLPCON_IN(7) |
S3C2412_SLPCON_PULL(8) |
S3C2412_SLPCON_PULL(9) |
S3C2412_SLPCON_IN(10) |
S3C2412_SLPCON_PULL(11) |
S3C2412_SLPCON_PULL(12) |
S3C2412_SLPCON_PULL(13) |
S3C2412_SLPCON_IN(14) |
S3C2412_SLPCON_PULL(15), S3C2412_GPGSLPCON);
/* Port H sleep */
__raw_writel(S3C2412_SLPCON_PULL(0) |
S3C2412_SLPCON_PULL(1) |
S3C2412_SLPCON_PULL(2) |
S3C2412_SLPCON_PULL(3) |
S3C2412_SLPCON_PULL(4) |
S3C2412_SLPCON_PULL(5) |
S3C2412_SLPCON_PULL(6) |
S3C2412_SLPCON_IN(7) |
S3C2412_SLPCON_IN(8) |
S3C2412_SLPCON_PULL(9) |
S3C2412_SLPCON_IN(10), S3C2412_GPHSLPCON);
/* initialise the power management now we've setup everything. */
s3c_pm_init();
/** TODO - check that this is after the cmdline option! */
s3c_nand_set_platdata(&jive_nand_info);
/* initialise the spi */
gpio_request(S3C2410_GPG(13), "lcm reset");
gpio_direction_output(S3C2410_GPG(13), 0);
gpio_request(S3C2410_GPB(7), "jive spi");
gpio_direction_output(S3C2410_GPB(7), 1);
s3c2410_gpio_setpin(S3C2410_GPB(6), 0);
s3c_gpio_cfgpin(S3C2410_GPB(6), S3C2410_GPIO_OUTPUT);
s3c2410_gpio_setpin(S3C2410_GPG(8), 1);
s3c_gpio_cfgpin(S3C2410_GPG(8), S3C2410_GPIO_OUTPUT);
/* initialise the WM8750 spi */
gpio_request(S3C2410_GPH(10), "jive wm8750 spi");
gpio_direction_output(S3C2410_GPH(10), 1);
/* Turn off suspend on both USB ports, and switch the
* selectable USB port to USB device mode. */
s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST |
S3C2410_MISCCR_USBSUSPND0 |
S3C2410_MISCCR_USBSUSPND1, 0x0);
s3c24xx_udc_set_platdata(&jive_udc_cfg);
s3c24xx_fb_set_platdata(&jive_lcd_config);
spi_register_board_info(jive_spi_devs, ARRAY_SIZE(jive_spi_devs));
s3c_i2c0_set_platdata(&jive_i2c_cfg);
i2c_register_board_info(0, jive_i2c_devs, ARRAY_SIZE(jive_i2c_devs));
pm_power_off = jive_power_off;
platform_add_devices(jive_devices, ARRAY_SIZE(jive_devices));
}
开发者ID:Medvedroid,项目名称:OT_903D-kernel-2.6.35.7,代码行数:101,代码来源:mach-jive.c
示例15: onedram_cfg_gpio
/* onedram */
static void onedram_cfg_gpio(void)
{
s3c_gpio_cfgpin(GPIO_nINT_ONEDRAM_AP, S3C_GPIO_SFN(GPIO_nINT_ONEDRAM_AP_AF));
s3c_gpio_setpull(GPIO_nINT_ONEDRAM_AP, S3C_GPIO_PULL_UP);
irq_set_irq_type(GPIO_nINT_ONEDRAM_AP, IRQ_TYPE_LEVEL_LOW);
}
开发者ID:AttiJeong98,项目名称:android_kernel_samsung_aries-kor,代码行数:7,代码来源:dev-s1-phone.c
示例16: midas_power_set_muic_pdata
void midas_power_set_muic_pdata(void *pdata, int gpio)
{
gpio_request(gpio, "AP_PMIC_IRQ");
s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
}
开发者ID:Pafcholini,项目名称:Nadia-kernel-kk_N7100XXUFND3,代码行数:6,代码来源:t0-power.c
示例17: s3c_irq_eint_set_type
static int s3c_irq_eint_set_type(struct irq_data *data, unsigned int type)
{
int offs = eint_offset(data->irq);
int pin, pin_val;
int shift;
u32 ctrl, mask;
u32 newvalue = 0;
void __iomem *reg;
if (offs > 27)
return -EINVAL;
if (offs <= 15)
reg = S3C64XX_EINT0CON0;
else
reg = S3C64XX_EINT0CON1;
switch (type) {
case IRQ_TYPE_NONE:
printk(KERN_WARNING "No edge setting!\n");
break;
case IRQ_TYPE_EDGE_RISING:
newvalue = S3C2410_EXTINT_RISEEDGE;
break;
case IRQ_TYPE_EDGE_FALLING:
newvalue = S3C2410_EXTINT_FALLEDGE;
break;
case IRQ_TYPE_EDGE_BOTH:
newvalue = S3C2410_EXTINT_BOTHEDGE;
break;
case IRQ_TYPE_LEVEL_LOW:
newvalue = S3C2410_EXTINT_LOWLEV;
break;
case IRQ_TYPE_LEVEL_HIGH:
newvalue = S3C2410_EXTINT_HILEV;
break;
default:
printk(KERN_ERR "No such irq type %d", type);
return -1;
}
if (offs <= 15)
shift = (offs / 2) * 4;
else
shift = ((offs - 16) / 2) * 4;
mask = 0x7 << shift;
ctrl = __raw_readl(reg);
ctrl &= ~mask;
ctrl |= newvalue << shift;
__raw_writel(ctrl, reg);
/* set the GPIO pin appropriately */
if (offs < 16) {
pin = S3C64XX_GPN(offs);
pin_val = S3C_GPIO_SFN(2);
} else if (offs < 23) {
pin = S3C64XX_GPL(offs + 8 - 16);
pin_val = S3C_GPIO_SFN(3);
} else {
pin = S3C64XX_GPM(offs - 23);
pin_val = S3C_GPIO_SFN(3);
}
s3c_gpio_cfgpin(pin, pin_val);
return 0;
}
开发者ID:davidmueller13,项目名称:valexKernel-lt03wifi,代码行数:75,代码来源:common.c
示例18: umts_modem_cfg_gpio
static void umts_modem_cfg_gpio(void)
{
int err = 0;
unsigned gpio_reset_req_n = umts_modem_data.gpio_reset_req_n;
unsigned gpio_cp_on = umts_modem_data.gpio_cp_on;
unsigned gpio_cp_rst = umts_modem_data.gpio_cp_reset;
unsigned gpio_pda_active = umts_modem_data.gpio_pda_active;
unsigned gpio_phone_active = umts_modem_data.gpio_phone_active;
unsigned gpio_cp_dump_int = umts_modem_data.gpio_cp_dump_int;
unsigned gpio_ap_dump_int = umts_modem_data.gpio_ap_dump_int;
unsigned gpio_flm_uart_sel = umts_modem_data.gpio_flm_uart_sel;
unsigned gpio_sim_detect = umts_modem_data.gpio_sim_detect;
unsigned irq_phone_active = umts_modem_res[0].start;
if (gpio_reset_req_n) {
err = gpio_request(gpio_reset_req_n, "RESET_REQ_N");
if (err) {
pr_err(LOG_TAG "fail to request gpio %s : %d\n",
"RESET_REQ_N", err);
}
s5p_gpio_set_pd_cfg(gpio_reset_req_n, S5P_GPIO_PD_OUTPUT1);
gpio_direction_output(gpio_reset_req_n, 0);
}
if (gpio_cp_on) {
err = gpio_request(gpio_cp_on, "CP_ON");
if (err) {
pr_err(LOG_TAG "fail to request gpio %s : %d\n",
"CP_ON", err);
}
gpio_direction_output(gpio_cp_on, 0);
}
if (gpio_cp_rst) {
err = gpio_request(gpio_cp_rst, "CP_RST");
if (err) {
pr_err(LOG_TAG "fail to request gpio %s : %d\n",
"CP_RST", err);
}
s5p_gpio_set_pd_cfg(gpio_cp_rst, S5P_GPIO_PD_OUTPUT1);
gpio_direction_output(gpio_cp_rst, 0);
}
if (gpio_pda_active) {
err = gpio_request(gpio_pda_active, "PDA_ACTIVE");
if (err) {
pr_err(LOG_TAG "fail to request gpio %s : %d\n",
"PDA_ACTIVE", err);
}
gpio_direction_output(gpio_pda_active, 0);
}
if (gpio_phone_active) {
err = gpio_request(gpio_phone_active, "PHONE_ACTIVE");
if (err) {
pr_err(LOG_TAG "fail to request gpio %s : %d\n",
"PHONE_ACTIVE", err);
}
gpio_direction_input(gpio_phone_active);
pr_err(LOG_TAG "check phone active = %d\n", irq_phone_active);
}
if (gpio_sim_detect) {
err = gpio_request(gpio_sim_detect, "SIM_DETECT");
if (err)
printk(KERN_ERR "fail to request gpio %s: %d\n",
"SIM_DETECT", err);
/* gpio_direction_input(gpio_sim_detect); */
s3c_gpio_cfgpin(gpio_sim_detect, S3C_GPIO_SFN(0xF));
s3c_gpio_setpull(gpio_sim_detect, S3C_GPIO_PULL_NONE);
irq_set_irq_type(gpio_to_irq(gpio_sim_detect),
IRQ_TYPE_EDGE_BOTH);
}
if (gpio_cp_dump_int) {
err = gpio_request(gpio_cp_dump_int, "CP_DUMP_INT");
if (err) {
pr_err(LOG_TAG "fail to request gpio %s : %d\n",
"CP_DUMP_INT", err);
}
gpio_direction_input(gpio_cp_dump_int);
}
if (gpio_ap_dump_int) {
err = gpio_request(gpio_ap_dump_int, "AP_DUMP_INT");
if (err) {
pr_err(LOG_TAG "fail to request gpio %s : %d\n",
"AP_DUMP_INT", err);
}
gpio_direction_output(gpio_ap_dump_int, 0);
}
if (gpio_flm_uart_sel) {
err = gpio_request(gpio_flm_uart_sel, "GPS_UART_SEL");
if (err) {
pr_err(LOG_TAG "fail to request gpio %s : %d\n",
"GPS_UART_SEL", err);
}
//.........这里部分代码省略.........
开发者ID:InhyukYee,项目名称:PeanutButterWolf,代码行数:101,代码来源:board-trats2-modems.c
示例19: sdhci_s3c_probe
//.........这里部分代码省略.........
/* we currently see overruns on errors, so disable the SDMA
* support as well. */
host->quirks |= SDHCI_QUIRK_BROKEN_DMA;
/* PIO currently has problems with multi-block IO */
host->quirks |= SDHCI_QUIRK_NO_MULTIBLOCK;
#endif /* CONFIG_MMC_SDHCI_S3C_DMA */
/* It seems we do not get an DATA transfer complete on non-busy
* transfers, not sure if this is a problem with this specific
* SDHCI block, or a missing configuration that needs to be set. */
host->quirks |= SDHCI_QUIRK_NO_BUSY_IRQ;
host->quirks |= (SDHCI_QUIRK_32BIT_DMA_ADDR |
SDHCI_QUIRK_32BIT_DMA_SIZE);
host->quirks |= SDHCI_QUIRK_NO_HISPD_BIT;
if (pdata->host_caps)
host->mmc->caps = pdata->host_caps;
else
host->mmc->caps = 0;
/* Set pm_flags for built_in device */
host->mmc->pm_caps = MMC_PM_KEEP_POWER | MMC_PM_IGNORE_PM_NOTIFY;
if (pdata->built_in)
host->mmc->pm_flags = MMC_PM_KEEP_POWER | MMC_PM_IGNORE_PM_NOTIFY;
/* to add external irq as a card detect signal */
if (pdata->cfg_ext_cd) {
pdata->cfg_ext_cd();
if (pdata->detect_ext_cd())
host->flags |= SDHCI_DEVICE_ALIVE;
}
/* to configure gpio pin as a card write protection signal */
if (pdata->cfg_wp)
pdata->cfg_wp();
ret = sdhci_add_host(host);
if (ret) {
dev_err(dev, "sdhci_add_host() failed\n");
goto err_add_host;
}
/* register external irq here (after all init is done) */
if (pdata->cfg_ext_cd) {
ret = request_irq(pdata->ext_cd, sdhci_irq_cd,
IRQF_SHARED, mmc_hostname(host->mmc), sc);
if(ret)
goto err_add_host;
}
#if SD_DYNAMIC
if (strcmp(mmc_hostname(host->mmc),"mmc1")==0)
{
int retval=0;
spin_lock_init(&s3c_sd_changed_lock);
INIT_WORK(&sd_monitor_work, sd_extr_work);
s3c_gpio_cfgpin(SD_DET_WAKE, S3C_GPIO_SFN(0xf));
s3c_gpio_setpull(SD_DET_WAKE, 0);
retval = request_irq(__gpio_to_irq(SD_DET_WAKE), s3c_sdhci_power_irq, IRQ_TYPE_EDGE_BOTH, sd_driver_name, NULL);
if (retval != 0)
{
printk(KERN_ERR "%s: can't get irq %i, err %d\n", sd_driver_name, __gpio_to_irq(SD_DET_WAKE), retval);
}
printk(KERN_ERR "%s: get irq %i, err %d\n", sd_driver_name, __gpio_to_irq(SD_DET_WAKE), retval);
}
#endif
return 0;
err_add_host:
release_resource(sc->ioarea);
kfree(sc->ioarea);
err_req_regs:
for (ptr = 0; ptr < MAX_BUS_CLK; ptr++) {
if (sc->clk_bus[ptr]) {
clk_disable(sc->clk_bus[ptr]);
clk_put(sc->clk_bus[ptr]);
}
}
err_no_busclks:
clk_disable(sc->clk_io);
clk_put(sc->clk_io);
err_io_clk:
sdhci_free_host(host);
return ret;
}
开发者ID:DrSauerkraut,项目名称:kernel_viewpad7e,代码行数:101,代码来源:sdhci-s3c.c
示例20: sdhci_s3c_probe
//.........这里部分代码省略.........
#ifdef CONFIG_MACH_MIDAS_01_BD
/* before calling shhci_add_host, you should turn vdd_tflash on */
sdhci_s3c_vtf_on_off(1);
#endif
/* To turn on vmmc regulator only if sd card exists,
GPIO pin for card detection should be initialized.
Moved from sdhci_s3c_setup_card_detect_gpio() function */
if (pdata->cd_type == S3C_SDHCI_CD_GPIO &&
gpio_is_valid(pdata->ext_cd_gpio)) {
if (gpio_request(pdata->ext_cd_gpio, "SDHCI EXT CD") == 0) {
sc->ext_cd_gpio = pdata->ext_cd_gpio;
sc->ext_cd_gpio_invert = pdata->ext_cd_gpio_invert;
mmc_host_sd_set_present(host->mmc);
if (sd_detection_cmd_dev == NULL &&
sc->ext_cd_gpio) {
sd_detection_cmd_dev =
device_create(sec_class, NULL, 0,
NULL, "sdcard");
if (IS_ERR(sd_detection_cmd_dev))
pr_err("Fail to create sysfs dev\n");
if (device_create_file(sd_detection_cmd_dev,
&dev_attr_status) < 0)
pr_err("Fail to create sysfs file\n");
dev_set_drvdata(sd_detection_cmd_dev, sc);
}
#ifdef CONFIG_MIDAS_COMMON
/* set TF_EN gpio as OUTPUT */
gpio_request(GPIO_TF_EN, "TF_EN");
gpio_direction_output(GPIO_TF_EN, 1);
s3c_gpio_cfgpin(GPIO_TF_EN, S3C_GPIO_SFN(1));
s3c_gpio_setpull(GPIO_TF_EN, S3C_GPIO_PULL_NONE);
#endif
} else {
dev_err(dev, "cannot request gpio for card detect\n");
}
}
ret = sdhci_add_host(host);
if (ret) {
dev_err(dev, "sdhci_add_host() failed\n");
goto err_add_host;
}
/* if it is set SDHCI_QUIRK_BROKEN_CARD_DETECTION before calling
sdhci_add_host, in sdhci_add_host, MMC_CAP_NEEDS_POLL flag will
be set. The flag S3C_SDHCI_CD_PERMANENT dose not need to
detect a card by polling. */
if (pdata->cd_type == S3C_SDHCI_CD_PERMANENT || \
pdata->cd_type == S3C_SDHCI_CD_GPIO)
host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
/* The following two methods of card detection might call
sdhci_s3c_notify_change() immediately, so they can be called
only after sdhci_add_host(). Setup errors are ignored. */
if (pdata->cd_type == S3C_SDHCI_CD_EXTERNAL && pdata->ext_cd_init) {
pdata->ext_cd_init(&sdhci_s3c_notify_change);
#ifdef CONFIG_MACH_PX
if (pdata->ext_pdev)
pdata->ext_pdev(pdev);
#endif
}
if (pdata->cd_type == S3C_SDHCI_CD_GPIO &&
gpio_is_valid(pdata->ext_cd_gpio))
sdhci_s3c_setup_card_detect_gpio(sc);
#ifdef CONFIG_MACH_MIDAS_01_BD
/* if card dose not exist, it should turn vtf off */
if (pdata->cd_type == S3C_SDHCI_CD_GPIO &&
sdhci_s3c_get_card_exist(host))
sdhci_s3c_vtf_on_off(1);
else
sdhci_s3c_vtf_on_off(0);
#endif
return 0;
err_add_host:
release_resource(sc->ioarea);
kfree(sc->ioarea);
err_req_regs:
for (ptr = 0; ptr < MAX_BUS_CLK; ptr++) {
clk_disable(sc->clk_bus[ptr]);
clk_put(sc->clk_bus[ptr]);
}
err_no_busclks:
clk_disable(sc->clk_io);
clk_put(sc->clk_io);
err_io_clk:
sdhci_free_host(host);
return ret;
}
开发者ID:SaMioalz,项目名称:GT-N7000-ICS-3.0.y,代码行数:101,代码来源:sdhci-s3c.c
注:本文中的s3c_gpio_cfgpin函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论