29.04.2015 Views

DevKit8500D/A User Manual - DMCS Pages for Students

DevKit8500D/A User Manual - DMCS Pages for Students

DevKit8500D/A User Manual - DMCS Pages for Students

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

.id = -1,<br />

.dev = {<br />

.plat<strong>for</strong>m_data = &gpio_key_info,<br />

},<br />

};<br />

2) GPIO pinmux Configuration<br />

Setup the GPIO 26, 29 as M4 (GPIO mode), IEM (Input enable).<br />

u-boot-03.00.02.07/board/devkit8500.h<br />

/*<br />

* IEN - Input Enable<br />

* IDIS - Input Disable<br />

* PTD - Pull type Down<br />

* PTU - Pull type Up<br />

* DIS - Pull type selection is inactive<br />

* EN - Pull type selection is active<br />

* M0 - Mode 0<br />

* The commented string gives the final mux configuration <strong>for</strong> that pin<br />

*/<br />

MUX_VAL(CP(ETK_D12_ES2),<br />

MUX_VAL(CP(ETK_D15_ES2),<br />

(IEN | PTU | DIS | M4)) /*GPIO_26*/\<br />

(IEN | PTU | DIS | M4)) /*GPIO_29*/\<br />

3) Driver Design<br />

linux-2.6.32-devkit8500/drivers/input/keyboard/gpio_keys.c<br />

a) Structure <strong>for</strong> plat<strong>for</strong>m_driver_register to register gpio_keys driver.<br />

static struct plat<strong>for</strong>m_driver gpio_keys_device_driver = {<br />

.probe<br />

.remove<br />

= gpio_keys_probe,<br />

= __devexit_p(gpio_keys_remove),<br />

.driver = {<br />

.name<br />

= "gpio-keys",<br />

#ifdef CONFIG_PM<br />

.owner = THIS_MODULE,<br />

.pm<br />

= &gpio_keys_pm_ops,<br />

46

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!