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);
}
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);