gpio/k64: convert to use DEVICE_AND_API_INIT()
Change-Id: I7fa0aa8f23e6d3b6c0664e211d605a03ae7e150c Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
parent
aa0635aa30
commit
9b23654f68
1 changed files with 25 additions and 34 deletions
|
@ -277,20 +277,6 @@ static struct gpio_driver_api gpio_k64_drv_api_funcs = {
|
||||||
.disable_callback = gpio_k64_disable_callback,
|
.disable_callback = gpio_k64_disable_callback,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Initialization function of Freescale K64-based GPIO port
|
|
||||||
*
|
|
||||||
* @param dev Device structure pointer
|
|
||||||
* @return 0 if successful, failed otherwise.
|
|
||||||
*/
|
|
||||||
int gpio_k64_init(struct device *dev)
|
|
||||||
{
|
|
||||||
dev->driver_api = &gpio_k64_drv_api_funcs;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Initialization for Port A */
|
/* Initialization for Port A */
|
||||||
#ifdef CONFIG_GPIO_K64_A
|
#ifdef CONFIG_GPIO_K64_A
|
||||||
|
|
||||||
|
@ -303,9 +289,10 @@ static struct gpio_k64_config gpio_k64_A_cfg = {
|
||||||
|
|
||||||
static struct gpio_k64_data gpio_data_A;
|
static struct gpio_k64_data gpio_data_A;
|
||||||
|
|
||||||
DEVICE_INIT(gpio_k64_A, CONFIG_GPIO_K64_A_DEV_NAME, gpio_k64_A_init,
|
DEVICE_AND_API_INIT(gpio_k64_A, CONFIG_GPIO_K64_A_DEV_NAME, gpio_k64_A_init,
|
||||||
&gpio_data_A, &gpio_k64_A_cfg,
|
&gpio_data_A, &gpio_k64_A_cfg,
|
||||||
SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
|
||||||
|
&gpio_k64_drv_api_funcs);
|
||||||
|
|
||||||
static int gpio_k64_A_init(struct device *dev)
|
static int gpio_k64_A_init(struct device *dev)
|
||||||
{
|
{
|
||||||
|
@ -314,7 +301,7 @@ static int gpio_k64_A_init(struct device *dev)
|
||||||
|
|
||||||
irq_enable(GPIO_K64_A_IRQ);
|
irq_enable(GPIO_K64_A_IRQ);
|
||||||
|
|
||||||
return gpio_k64_init(dev);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_GPIO_K64_A */
|
#endif /* CONFIG_GPIO_K64_A */
|
||||||
|
@ -331,9 +318,10 @@ static struct gpio_k64_config gpio_k64_B_cfg = {
|
||||||
|
|
||||||
static struct gpio_k64_data gpio_data_B;
|
static struct gpio_k64_data gpio_data_B;
|
||||||
|
|
||||||
DEVICE_INIT(gpio_k64_B, CONFIG_GPIO_K64_B_DEV_NAME, gpio_k64_B_init,
|
DEVICE_AND_API_INIT(gpio_k64_B, CONFIG_GPIO_K64_B_DEV_NAME, gpio_k64_B_init,
|
||||||
&gpio_data_B, &gpio_k64_B_cfg,
|
&gpio_data_B, &gpio_k64_B_cfg,
|
||||||
SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
|
||||||
|
&gpio_k64_drv_api_funcs);
|
||||||
|
|
||||||
static int gpio_k64_B_init(struct device *dev)
|
static int gpio_k64_B_init(struct device *dev)
|
||||||
{
|
{
|
||||||
|
@ -342,7 +330,7 @@ static int gpio_k64_B_init(struct device *dev)
|
||||||
|
|
||||||
irq_enable(GPIO_K64_B_IRQ);
|
irq_enable(GPIO_K64_B_IRQ);
|
||||||
|
|
||||||
return gpio_k64_init(dev);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_GPIO_K64_B */
|
#endif /* CONFIG_GPIO_K64_B */
|
||||||
|
@ -359,9 +347,10 @@ static struct gpio_k64_config gpio_k64_C_cfg = {
|
||||||
|
|
||||||
static struct gpio_k64_data gpio_data_C;
|
static struct gpio_k64_data gpio_data_C;
|
||||||
|
|
||||||
DEVICE_INIT(gpio_k64_C, CONFIG_GPIO_K64_C_DEV_NAME, gpio_k64_C_init,
|
DEVICE_AND_API_INIT(gpio_k64_C, CONFIG_GPIO_K64_C_DEV_NAME, gpio_k64_C_init,
|
||||||
&gpio_data_C, &gpio_k64_C_cfg,
|
&gpio_data_C, &gpio_k64_C_cfg,
|
||||||
SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
|
||||||
|
&gpio_k64_drv_api_funcs);
|
||||||
|
|
||||||
static int gpio_k64_C_init(struct device *dev)
|
static int gpio_k64_C_init(struct device *dev)
|
||||||
{
|
{
|
||||||
|
@ -370,7 +359,7 @@ static int gpio_k64_C_init(struct device *dev)
|
||||||
|
|
||||||
irq_enable(GPIO_K64_C_IRQ);
|
irq_enable(GPIO_K64_C_IRQ);
|
||||||
|
|
||||||
return gpio_k64_init(dev);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_GPIO_K64_C */
|
#endif /* CONFIG_GPIO_K64_C */
|
||||||
|
@ -387,9 +376,10 @@ static struct gpio_k64_config gpio_k64_D_cfg = {
|
||||||
|
|
||||||
static struct gpio_k64_data gpio_data_D;
|
static struct gpio_k64_data gpio_data_D;
|
||||||
|
|
||||||
DEVICE_INIT(gpio_k64_D, CONFIG_GPIO_K64_D_DEV_NAME, gpio_k64_D_init,
|
DEVICE_AND_API_INIT(gpio_k64_D, CONFIG_GPIO_K64_D_DEV_NAME, gpio_k64_D_init,
|
||||||
&gpio_data_D, &gpio_k64_D_cfg,
|
&gpio_data_D, &gpio_k64_D_cfg,
|
||||||
SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
|
||||||
|
&gpio_k64_drv_api_funcs);
|
||||||
|
|
||||||
static int gpio_k64_D_init(struct device *dev)
|
static int gpio_k64_D_init(struct device *dev)
|
||||||
{
|
{
|
||||||
|
@ -398,7 +388,7 @@ static int gpio_k64_D_init(struct device *dev)
|
||||||
|
|
||||||
irq_enable(GPIO_K64_D_IRQ);
|
irq_enable(GPIO_K64_D_IRQ);
|
||||||
|
|
||||||
return gpio_k64_init(dev);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_GPIO_K64_D */
|
#endif /* CONFIG_GPIO_K64_D */
|
||||||
|
@ -415,9 +405,10 @@ static struct gpio_k64_config gpio_k64_E_cfg = {
|
||||||
|
|
||||||
static struct gpio_k64_data gpio_data_E;
|
static struct gpio_k64_data gpio_data_E;
|
||||||
|
|
||||||
DEVICE_INIT(gpio_k64_E, CONFIG_GPIO_K64_E_DEV_NAME, gpio_k64_E_init,
|
DEVICE_AND_API_INIT(gpio_k64_E, CONFIG_GPIO_K64_E_DEV_NAME, gpio_k64_E_init,
|
||||||
&gpio_data_E, &gpio_k64_E_cfg,
|
&gpio_data_E, &gpio_k64_E_cfg,
|
||||||
SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
SECONDARY, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
|
||||||
|
&gpio_k64_drv_api_funcs);
|
||||||
|
|
||||||
static int gpio_k64_E_init(struct device *dev)
|
static int gpio_k64_E_init(struct device *dev)
|
||||||
{
|
{
|
||||||
|
@ -426,7 +417,7 @@ static int gpio_k64_E_init(struct device *dev)
|
||||||
|
|
||||||
irq_enable(GPIO_K64_E_IRQ);
|
irq_enable(GPIO_K64_E_IRQ);
|
||||||
|
|
||||||
return gpio_k64_init(dev);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_GPIO_K64_E */
|
#endif /* CONFIG_GPIO_K64_E */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue