mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
3036: fix rtc-HYM8563 without irq pin
This commit is contained in:
@@ -569,6 +569,7 @@ static int hym8563_probe(struct i2c_client *client, const struct i2c_device_id
|
||||
gClient = client;
|
||||
hym8563->client = client;
|
||||
hym8563->alarm.enabled = 0;
|
||||
client->irq = 0;
|
||||
mutex_init(&hym8563->mutex);
|
||||
wake_lock_init(&hym8563->wake_lock, WAKE_LOCK_SUSPEND, "rtc_hym8563");
|
||||
i2c_set_clientdata(client, hym8563);
|
||||
@@ -591,15 +592,17 @@ static int hym8563_probe(struct i2c_client *client, const struct i2c_device_id
|
||||
}
|
||||
|
||||
client->irq = of_get_named_gpio_flags(np, "irq_gpio", 0,(enum of_gpio_flags *)&irq_flags);
|
||||
|
||||
hym8563->irq = gpio_to_irq(client->irq);
|
||||
result = devm_request_threaded_irq(&client->dev, hym8563->irq, NULL, hym8563_wakeup_irq, irq_flags | IRQF_ONESHOT, client->dev.driver->name,hym8563 );
|
||||
if (result) {
|
||||
printk(KERN_ERR "%s:fail to request irq = %d, ret = 0x%x\n",__func__, hym8563->irq, result);
|
||||
goto exit;
|
||||
}
|
||||
enable_irq_wake(hym8563->irq);
|
||||
device_init_wakeup(&client->dev, 1);
|
||||
if(client->irq < 0)
|
||||
{
|
||||
hym8563->irq = gpio_to_irq(client->irq);
|
||||
result = devm_request_threaded_irq(&client->dev, hym8563->irq, NULL, hym8563_wakeup_irq, irq_flags | IRQF_ONESHOT, client->dev.driver->name,hym8563 );
|
||||
if (result) {
|
||||
printk(KERN_ERR "%s:fail to request irq = %d, ret = 0x%x\n",__func__, hym8563->irq, result);
|
||||
goto exit;
|
||||
}
|
||||
enable_irq_wake(hym8563->irq);
|
||||
device_init_wakeup(&client->dev, 1);
|
||||
}
|
||||
rtc = devm_rtc_device_register(&client->dev,
|
||||
client->name,
|
||||
&hym8563_rtc_ops, THIS_MODULE);
|
||||
|
||||
Reference in New Issue
Block a user