Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'rtc-4.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux

Pull RTC fixes from Alexandre Belloni:
"Two fixes for the ds1307 alarm and wakeup"

* tag 'rtc-4.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux:
rtc: ds1307: fix alarm reading at probe time
rtc: ds1307: fix kernel splat due to wakeup irq handling

+9 -36
+1
arch/arm/boot/dts/am57xx-beagle-x15.dts
··· 604 604 reg = <0x6f>; 605 605 interrupts-extended = <&crossbar_mpu GIC_SPI 2 IRQ_TYPE_EDGE_RISING>, 606 606 <&dra7_pmx_core 0x424>; 607 + interrupt-names = "irq", "wakeup"; 607 608 608 609 pinctrl-names = "default"; 609 610 pinctrl-0 = <&mcp79410_pins_default>;
+8 -36
drivers/rtc/rtc-ds1307.c
··· 15 15 #include <linux/i2c.h> 16 16 #include <linux/init.h> 17 17 #include <linux/module.h> 18 - #include <linux/of_device.h> 19 - #include <linux/of_irq.h> 20 - #include <linux/pm_wakeirq.h> 21 18 #include <linux/rtc/ds1307.h> 22 19 #include <linux/rtc.h> 23 20 #include <linux/slab.h> ··· 114 117 #define HAS_ALARM 1 /* bit 1 == irq claimed */ 115 118 struct i2c_client *client; 116 119 struct rtc_device *rtc; 117 - int wakeirq; 118 120 s32 (*read_block_data)(const struct i2c_client *client, u8 command, 119 121 u8 length, u8 *values); 120 122 s32 (*write_block_data)(const struct i2c_client *client, u8 command, ··· 1134 1138 bin2bcd(tmp)); 1135 1139 } 1136 1140 1137 - device_set_wakeup_capable(&client->dev, want_irq); 1141 + if (want_irq) { 1142 + device_set_wakeup_capable(&client->dev, true); 1143 + set_bit(HAS_ALARM, &ds1307->flags); 1144 + } 1138 1145 ds1307->rtc = devm_rtc_device_register(&client->dev, client->name, 1139 1146 rtc_ops, THIS_MODULE); 1140 1147 if (IS_ERR(ds1307->rtc)) { ··· 1145 1146 } 1146 1147 1147 1148 if (want_irq) { 1148 - struct device_node *node = client->dev.of_node; 1149 - 1150 1149 err = devm_request_threaded_irq(&client->dev, 1151 1150 client->irq, NULL, irq_handler, 1152 1151 IRQF_SHARED | IRQF_ONESHOT, 1153 1152 ds1307->rtc->name, client); 1154 1153 if (err) { 1155 1154 client->irq = 0; 1155 + device_set_wakeup_capable(&client->dev, false); 1156 + clear_bit(HAS_ALARM, &ds1307->flags); 1156 1157 dev_err(&client->dev, "unable to request IRQ!\n"); 1157 - goto no_irq; 1158 - } 1159 - 1160 - set_bit(HAS_ALARM, &ds1307->flags); 1161 - dev_dbg(&client->dev, "got IRQ %d\n", client->irq); 1162 - 1163 - /* Currently supported by OF code only! */ 1164 - if (!node) 1165 - goto no_irq; 1166 - 1167 - err = of_irq_get(node, 1); 1168 - if (err <= 0) { 1169 - if (err == -EPROBE_DEFER) 1170 - goto exit; 1171 - goto no_irq; 1172 - } 1173 - ds1307->wakeirq = err; 1174 - 1175 - err = dev_pm_set_dedicated_wake_irq(&client->dev, 1176 - ds1307->wakeirq); 1177 - if (err) { 1178 - dev_err(&client->dev, "unable to setup wakeIRQ %d!\n", 1179 - err); 1180 - goto exit; 1181 - } 1158 + } else 1159 + dev_dbg(&client->dev, "got IRQ %d\n", client->irq); 1182 1160 } 1183 1161 1184 - no_irq: 1185 1162 if (chip->nvram_size) { 1186 1163 1187 1164 ds1307->nvram = devm_kzalloc(&client->dev, ··· 1200 1225 static int ds1307_remove(struct i2c_client *client) 1201 1226 { 1202 1227 struct ds1307 *ds1307 = i2c_get_clientdata(client); 1203 - 1204 - if (ds1307->wakeirq) 1205 - dev_pm_clear_wake_irq(&client->dev); 1206 1228 1207 1229 if (test_and_clear_bit(HAS_NVRAM, &ds1307->flags)) 1208 1230 sysfs_remove_bin_file(&client->dev.kobj, ds1307->nvram);