#endif
//------------------------------------------------------------------
if (pdata->Headset_gpio) {
- ret = pdata->headset_io_init(pdata->Headset_gpio, pdata->headset_gpio_info.iomux_name, pdata->headset_gpio_info.iomux_mode);
+ if(pdata->Headset_gpio == NULL){
+ dev_err(&pdev->dev,"failed init hook,please full hook_io_init function in board\n");
+ goto failed_free_dev;
+ }
+ ret = pdata->headset_io_init(pdata->Headset_gpio);
if (ret)
- goto failed_free;
+ goto failed_free_dev;
headset->irq[HEADSET] = gpio_to_irq(pdata->Headset_gpio);
goto failed_free_dev;
//------------------------------------------------------------------
if (pdata->Hook_gpio) {
- ret = pdata->hook_io_init(pdata->Hook_gpio, pdata->hook_gpio_info.iomux_name, pdata->hook_gpio_info.iomux_mode);
+ if(pdata->hook_io_init == NULL){
+ dev_err(&pdev->dev,"failed init hook,please full hook_io_init function in board\n");
+ goto failed_free_dev;
+ }
+ ret = pdata->hook_io_init(pdata->Hook_gpio);
if (ret)
- goto failed_free;
+ goto failed_free_dev;
headset->irq[HOOK] = gpio_to_irq(pdata->Hook_gpio);
headset->irq_type[HOOK] = pdata->Hook_down_type == HOOK_DOWN_HIGH ? IRQF_TRIGGER_RISING : IRQF_TRIGGER_FALLING;
unsigned int Hook_down_type; //Hook key down status
int hook_key_code;
unsigned int Headset_gpio;//Detection Headset--Must be set
- unsigned int headset_in_type;// Headphones into the state level--Must be set
- struct io_info headset_gpio_info;
- struct io_info hook_gpio_info;
- int (*headset_io_init)(int, char *, int);
- int (*hook_io_init)(int, char *, int);
+ unsigned int headset_in_type;// Headphones into the state level--Must be set
+ int (*headset_io_init)(int);
+ int (*hook_io_init)(int);
};
#endif