本文整理汇总了C++中S3C2410_GPF函数的典型用法代码示例。如果您正苦于以下问题:C++ S3C2410_GPF函数的具体用法?C++ S3C2410_GPF怎么用?C++ S3C2410_GPF使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了S3C2410_GPF函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: nexcoder_sensorboard_init
static void __init nexcoder_sensorboard_init(void)
{
// Initialize SCCB bus
s3c2410_gpio_setpin(S3C2410_GPE(14), 1); // IICSCL
s3c_gpio_cfgpin(S3C2410_GPE(14), S3C2410_GPIO_OUTPUT);
s3c2410_gpio_setpin(S3C2410_GPE(15), 1); // IICSDA
s3c_gpio_cfgpin(S3C2410_GPE(15), S3C2410_GPIO_OUTPUT);
// Power up the sensor board
s3c2410_gpio_setpin(S3C2410_GPF(1), 1);
s3c_gpio_cfgpin(S3C2410_GPF(1), S3C2410_GPIO_OUTPUT); // CAM_GPIO7 => nLDO_PWRDN
s3c2410_gpio_setpin(S3C2410_GPF(2), 0);
s3c_gpio_cfgpin(S3C2410_GPF(2), S3C2410_GPIO_OUTPUT); // CAM_GPIO6 => CAM_PWRDN
}
示例2: nexcoder_sensorboard_init
static void __init nexcoder_sensorboard_init(void)
{
/* Initialize SCCB bus */
gpio_request_one(S3C2410_GPE(14), GPIOF_OUT_INIT_HIGH, NULL);
gpio_free(S3C2410_GPE(14)); /* IICSCL */
gpio_request_one(S3C2410_GPE(15), GPIOF_OUT_INIT_HIGH, NULL);
gpio_free(S3C2410_GPE(15)); /* IICSDA */
/* Power up the sensor board */
gpio_request_one(S3C2410_GPF(1), GPIOF_OUT_INIT_HIGH, NULL);
gpio_free(S3C2410_GPF(1)); /* CAM_GPIO7 => nLDO_PWRDN */
gpio_request_one(S3C2410_GPF(2), GPIOF_OUT_INIT_LOW, NULL);
gpio_free(S3C2410_GPF(2)); /* CAM_GPIO6 => CAM_PWRDN */
}
示例3: s3c2412_gpio_set_sleepcfg
int s3c2412_gpio_set_sleepcfg(unsigned int pin, unsigned int state)
{
struct samsung_gpio_chip *chip = samsung_gpiolib_getchip(pin);
unsigned long offs = pin - chip->chip.base;
unsigned long flags;
unsigned long slpcon;
offs *= 2;
if (pin < S3C2410_GPB(0))
return -EINVAL;
if (pin >= S3C2410_GPF(0) &&
pin <= S3C2410_GPG(16))
return -EINVAL;
if (pin > S3C2410_GPH(16))
return -EINVAL;
local_irq_save(flags);
slpcon = __raw_readl(chip->base + 0x0C);
slpcon &= ~(3 << offs);
slpcon |= state << offs;
__raw_writel(slpcon, chip->base + 0x0C);
local_irq_restore(flags);
return 0;
}
示例4: smdk2416_hsudc_gpio_init
void smdk2416_hsudc_gpio_init(void)
{
s3c_gpio_setpull(S3C2410_GPH(14), S3C_GPIO_PULL_UP);
s3c_gpio_setpull(S3C2410_GPF(2), S3C_GPIO_PULL_NONE);
s3c_gpio_cfgpin(S3C2410_GPH(14), S3C_GPIO_SFN(1));
s3c2410_modify_misccr(S3C2416_MISCCR_SEL_SUSPND, 0);
}
示例5: amlm5900_init_pm
static void amlm5900_init_pm(void)
{
int ret = 0;
ret = request_irq(IRQ_EINT9, &amlm5900_wake_interrupt,
IRQF_TRIGGER_RISING | IRQF_SHARED,
"amlm5900_wakeup", &amlm5900_wake_interrupt);
if (ret != 0) {
printk(KERN_ERR "AML-M5900: no wakeup irq, %d?\n", ret);
} else {
enable_irq_wake(IRQ_EINT9);
/* configure the suspend/resume status pin */
s3c_gpio_cfgpin(S3C2410_GPF(2), S3C2410_GPIO_OUTPUT);
s3c_gpio_setpull(S3C2410_GPF(2), S3C_GPIO_PULL_UP);
}
}
示例6: s3c_pm_configure_extint
void s3c_pm_configure_extint(void)
{
int pin;
/*
*/
for (pin = S3C2410_GPF(0); pin <= S3C2410_GPF(7); pin++) {
s3c_pm_check_resume_pin(pin, pin - S3C2410_GPF(0));
}
for (pin = S3C2410_GPG(0); pin <= S3C2410_GPG(7); pin++) {
s3c_pm_check_resume_pin(pin, (pin - S3C2410_GPG(0))+8);
}
}
示例7: s3c_pm_configure_extint
void s3c_pm_configure_extint(void)
{
int pin;
/* for each of the external interrupts (EINT0..EINT15) we
* need to check wether it is an external interrupt source,
* and then configure it as an input if it is not
*/
for (pin = S3C2410_GPF(0); pin <= S3C2410_GPF(7); pin++) {
s3c_pm_check_resume_pin(pin, pin - S3C2410_GPF(0));
}
for (pin = S3C2410_GPG(0); pin <= S3C2410_GPG(7); pin++) {
s3c_pm_check_resume_pin(pin, (pin - S3C2410_GPG(0))+8);
}
}
示例8: smdk2413_udc_pullup
static void smdk2413_udc_pullup(enum s3c2410_udc_cmd_e cmd)
{
printk(KERN_DEBUG "udc: pullup(%d)\n",cmd);
switch (cmd)
{
case S3C2410_UDC_P_ENABLE :
s3c2410_gpio_setpin(S3C2410_GPF(2), 1);
break;
case S3C2410_UDC_P_DISABLE :
s3c2410_gpio_setpin(S3C2410_GPF(2), 0);
break;
case S3C2410_UDC_P_RESET :
break;
default:
break;
}
}
示例9: smdk2413_machine_init
static void __init smdk2413_machine_init(void)
{ /* Turn off suspend on both USB ports, and switch the
* selectable USB port to USB device mode. */
s3c2410_gpio_setpin(S3C2410_GPF(2), 0);
s3c2410_gpio_cfgpin(S3C2410_GPF(2), S3C2410_GPIO_OUTPUT);
s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST |
S3C2410_MISCCR_USBSUSPND0 |
S3C2410_MISCCR_USBSUSPND1, 0x0);
s3c24xx_udc_set_platdata(&smdk2413_udc_cfg);
s3c_i2c0_set_platdata(NULL);
platform_add_devices(smdk2413_devices, ARRAY_SIZE(smdk2413_devices));
smdk_machine_init();
}
示例10: smdk2413_machine_init
static void __init smdk2413_machine_init(void)
{ /* Turn off suspend on both USB ports, and switch the
* selectable USB port to USB device mode. */
WARN_ON(gpio_request(S3C2410_GPF(2), "udc pull"));
gpio_direction_output(S3C2410_GPF(2), 0);
s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST |
S3C2410_MISCCR_USBSUSPND0 |
S3C2410_MISCCR_USBSUSPND1, 0x0);
s3c24xx_udc_set_platdata(&smdk2413_udc_cfg);
s3c_i2c0_set_platdata(NULL);
platform_add_devices(smdk2413_devices, ARRAY_SIZE(smdk2413_devices));
smdk_machine_init();
}
示例11: s3c2410_pm_prepare
static void s3c2410_pm_prepare(void)
{
/* ensure at least GSTATUS3 has the resume address */
__raw_writel(virt_to_phys(s3c_cpu_resume), S3C2410_GSTATUS3);
S3C_PMDBG("GSTATUS3 0x%08x\n", __raw_readl(S3C2410_GSTATUS3));
S3C_PMDBG("GSTATUS4 0x%08x\n", __raw_readl(S3C2410_GSTATUS4));
if (machine_is_h1940()) {
void *base = phys_to_virt(H1940_SUSPEND_CHECK);
unsigned long ptr;
unsigned long calc = 0;
/* generate check for the bootloader to check on resume */
for (ptr = 0; ptr < 0x40000; ptr += 0x400)
calc += __raw_readl(base+ptr);
__raw_writel(calc, phys_to_virt(H1940_SUSPEND_CHECKSUM));
}
/* RX3715 and RX1950 use similar to H1940 code and the
* same offsets for resume and checksum pointers */
if (machine_is_rx3715() || machine_is_rx1950()) {
void *base = phys_to_virt(H1940_SUSPEND_CHECK);
unsigned long ptr;
unsigned long calc = 0;
/* generate check for the bootloader to check on resume */
for (ptr = 0; ptr < 0x40000; ptr += 0x4)
calc += __raw_readl(base+ptr);
__raw_writel(calc, phys_to_virt(H1940_SUSPEND_CHECKSUM));
}
if ( machine_is_aml_m5900() )
s3c2410_gpio_setpin(S3C2410_GPF(2), 1);
if (machine_is_rx1950()) {
/* According to S3C2442 user's manual, page 7-17,
* when the system is operating in NAND boot mode,
* the hardware pin configuration - EINT[23:21] –
* must be set as input for starting up after
* wakeup from sleep mode
*/
s3c_gpio_cfgpin(S3C2410_GPG(13), S3C2410_GPIO_INPUT);
s3c_gpio_cfgpin(S3C2410_GPG(14), S3C2410_GPIO_INPUT);
s3c_gpio_cfgpin(S3C2410_GPG(15), S3C2410_GPIO_INPUT);
}
}
示例12: s3c2410_pm_prepare
static void s3c2410_pm_prepare(void)
{
/* ensure at least GSTATUS3 has the resume address */
{
volatile unsigned long *ptr = phys_to_virt(0x30000900);
*ptr = 0x55;
}
__raw_writel(0x7, S3C2410_GSTATUS2);
S3C_PMDBG("GSTATUS2 0x%08x\n", __raw_readl(S3C2410_GSTATUS2));
__raw_writel(virt_to_phys(s3c_cpu_resume), S3C2410_GSTATUS3);
S3C_PMDBG("GSTATUS3 0x%08x\n", __raw_readl(S3C2410_GSTATUS3));
S3C_PMDBG("GSTATUS4 0x%08x\n", __raw_readl(S3C2410_GSTATUS4));
if (machine_is_h1940()) {
void *base = phys_to_virt(H1940_SUSPEND_CHECK);
unsigned long ptr;
unsigned long calc = 0;
/* generate check for the bootloader to check on resume */
for (ptr = 0; ptr < 0x40000; ptr += 0x400)
calc += __raw_readl(base+ptr);
__raw_writel(calc, phys_to_virt(H1940_SUSPEND_CHECKSUM));
}
/* the RX3715 uses similar code and the same H1940 and the
* same offsets for resume and checksum pointers */
if (machine_is_rx3715()) {
void *base = phys_to_virt(H1940_SUSPEND_CHECK);
unsigned long ptr;
unsigned long calc = 0;
/* generate check for the bootloader to check on resume */
for (ptr = 0; ptr < 0x40000; ptr += 0x4)
calc += __raw_readl(base+ptr);
__raw_writel(calc, phys_to_virt(H1940_SUSPEND_CHECKSUM));
}
if ( machine_is_aml_m5900() )
s3c2410_gpio_setpin(S3C2410_GPF(2), 1);
}
示例13: s3c2410_pm_resume
static void s3c2410_pm_resume(void)
{
unsigned long tmp;
/* unset the return-from-sleep flag, to ensure reset */
tmp = __raw_readl(S3C2410_GSTATUS2);
tmp &= S3C2410_GSTATUS2_OFFRESET;
__raw_writel(tmp, S3C2410_GSTATUS2);
if ( machine_is_aml_m5900() )
s3c2410_gpio_setpin(S3C2410_GPF(2), 0);
}
示例14: mini2440_machine_init
static void __init mini2440_machine_init(void)
{
s3c24xx_fb_set_platdata(&s3c24xx_fb_info);
s3c_i2c0_set_platdata(NULL);
s3c2410_gpio_cfgpin(S3C2410_GPC(0), S3C2410_GPC0_LEND);
printk("S3C2410_GPA=%d\n",S3C2410_GPA(0));
printk("S3C2410_GPB=%d\n",S3C2410_GPB(0));
printk("S3C2410_GPC=%d\n",S3C2410_GPC(0));
printk("S3C2410_GPD=%d\n",S3C2410_GPD(0));
printk("S3C2410_GPE=%d\n",S3C2410_GPE(0));
printk("S3C2410_GPF=%d\n",S3C2410_GPF(0));
printk("S3C2410_GPG=%d\n",S3C2410_GPG(0));
printk("S3C2410_GPH=%d\n",S3C2410_GPH(0));
s3c_device_nand.dev.platform_data = &friendly_arm_nand_info;
s3c_device_sdi.dev.platform_data = &mini2440_mmc_cfg;
platform_add_devices(mini2440_devices, ARRAY_SIZE(mini2440_devices));
platform_device_register_simple("GPIODEV", 0, &gpiodev_resource, 1); //GPIO resource MAP
s3c_pm_init();
}
示例15: smdk_machine_init
void __init smdk_machine_init(void)
{
/* Configure the LEDs (even if we have no LED support)*/
s3c_gpio_cfgpin(S3C2410_GPF(4), S3C2410_GPIO_OUTPUT);
s3c_gpio_cfgpin(S3C2410_GPF(5), S3C2410_GPIO_OUTPUT);
s3c_gpio_cfgpin(S3C2410_GPF(6), S3C2410_GPIO_OUTPUT);
s3c_gpio_cfgpin(S3C2410_GPF(7), S3C2410_GPIO_OUTPUT);
s3c2410_gpio_setpin(S3C2410_GPF(4), 1);
s3c2410_gpio_setpin(S3C2410_GPF(5), 1);
s3c2410_gpio_setpin(S3C2410_GPF(6), 1);
s3c2410_gpio_setpin(S3C2410_GPF(7), 1);
if (machine_is_smdk2443())
smdk_nand_info.twrph0 = 50;
s3c_nand_set_platdata(&smdk_nand_info);
platform_add_devices(smdk_devs, ARRAY_SIZE(smdk_devs));
s3c_pm_init();
}