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-7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux

Pull RTC updates from Alexandre Belloni:
"Subsystem:
- add data_race() in rtc_dev_poll()

Drivers:
- remove i2c_match_id usage
- abx80x: Disable alarm feature if no interrupt attached
- ti-k3: support resuming from IO DDR low power mode"

* tag 'rtc-7.1' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux:
rtc: abx80x: Disable alarm feature if no interrupt attached
rtc: ntxec: fix OF node reference imbalance
rtc: pic32: allow driver to be compiled with COMPILE_TEST
rtc: ti-k3: Add support to resume from IO DDR low power mode
rtc: cmos: Use platform_get_irq_optional() in cmos_platform_probe()
dt-bindings: rtc: add olpc,xo1-rtc to trivial-rtc
dt-bindings: rtc: sc2731: Add compatible for SC2730
rtc: add data_race() in rtc_dev_poll()
rtc: armada38x: zalloc + calloc to single allocation
dt-bindings: rtc: isl12026: convert to YAML schema
dt-bindings: rtc: microcrystal,rv3028: Allow to specify vdd-supply
rtc: max77686: convert to i2c_new_ancillary_device
dt-bindings: rtc: mpfs-rtc: permit resets
rtc: rx8025: Remove use of i2c_match_id()
rtc: rv8803: Remove use of i2c_match_id()
rtc: rs5c372: Remove use of i2c_match_id()
rtc: pcf2127: Remove use of i2c_match_id()
rtc: m41t80: Remove use of i2c_match_id()
rtc: abx80x: Remove use of i2c_match_id()

+132 -90
-28
Documentation/devicetree/bindings/rtc/isil,isl12026.txt
··· 1 - ISL12026 I2C RTC/EEPROM 2 - 3 - ISL12026 is an I2C RTC/EEPROM combination device. The RTC and control 4 - registers respond at bus address 0x6f, and the EEPROM array responds 5 - at bus address 0x57. The canonical "reg" value will be for the RTC portion. 6 - 7 - Required properties supported by the device: 8 - 9 - - "compatible": must be "isil,isl12026" 10 - - "reg": I2C bus address of the device (always 0x6f) 11 - 12 - Optional properties: 13 - 14 - - "isil,pwr-bsw": If present PWR.BSW bit must be set to the specified 15 - value for proper operation. 16 - 17 - - "isil,pwr-sbib": If present PWR.SBIB bit must be set to the specified 18 - value for proper operation. 19 - 20 - 21 - Example: 22 - 23 - rtc@6f { 24 - compatible = "isil,isl12026"; 25 - reg = <0x6f>; 26 - isil,pwr-bsw = <0>; 27 - isil,pwr-sbib = <1>; 28 - }
+59
Documentation/devicetree/bindings/rtc/isil,isl12026.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/rtc/isil,isl12026.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Intersil ISL12026 I2C RTC/EEPROM 8 + 9 + maintainers: 10 + - Piyush Patle <piyushpatle228@gmail.com> 11 + 12 + description: 13 + The ISL12026 is a combination RTC and EEPROM device connected via I2C. 14 + The RTC and control registers respond at address 0x6f, while the EEPROM 15 + array responds at address 0x57. The "reg" property refers to the RTC 16 + portion of the device. 17 + 18 + allOf: 19 + - $ref: rtc.yaml# 20 + 21 + properties: 22 + compatible: 23 + const: isil,isl12026 24 + 25 + reg: 26 + maxItems: 1 27 + description: I2C address of the RTC portion (must be 0x6f) 28 + 29 + isil,pwr-bsw: 30 + $ref: /schemas/types.yaml#/definitions/uint32 31 + enum: [ 0, 1 ] 32 + description: 33 + Value written to the PWR.BSW bit for proper device operation. 34 + 35 + isil,pwr-sbib: 36 + $ref: /schemas/types.yaml#/definitions/uint32 37 + enum: [ 0, 1 ] 38 + description: 39 + Value written to the PWR.SBIB bit for proper device operation. 40 + 41 + required: 42 + - compatible 43 + - reg 44 + 45 + unevaluatedProperties: false 46 + 47 + examples: 48 + - | 49 + i2c { 50 + #address-cells = <1>; 51 + #size-cells = <0>; 52 + 53 + rtc@6f { 54 + compatible = "isil,isl12026"; 55 + reg = <0x6f>; 56 + isil,pwr-bsw = <0>; 57 + isil,pwr-sbib = <1>; 58 + }; 59 + };
+3
Documentation/devicetree/bindings/rtc/microchip,mpfs-rtc.yaml
··· 47 47 - const: rtc 48 48 - const: rtcref 49 49 50 + resets: 51 + maxItems: 1 52 + 50 53 required: 51 54 - compatible 52 55 - reg
+2
Documentation/devicetree/bindings/rtc/microcrystal,rv3028.yaml
··· 32 32 - 9000 33 33 - 15000 34 34 35 + vdd-supply: true 36 + 35 37 required: 36 38 - compatible 37 39 - reg
-5
Documentation/devicetree/bindings/rtc/olpc-xo1-rtc.txt
··· 1 - OLPC XO-1 RTC 2 - ~~~~~~~~~~~~~ 3 - 4 - Required properties: 5 - - compatible : "olpc,xo1-rtc"
+6 -1
Documentation/devicetree/bindings/rtc/sprd,sc2731-rtc.yaml
··· 13 13 14 14 properties: 15 15 compatible: 16 - const: sprd,sc2731-rtc 16 + oneOf: 17 + - items: 18 + - enum: 19 + - sprd,sc2730-rtc 20 + - const: sprd,sc2731-rtc 21 + - const: sprd,sc2731-rtc 17 22 18 23 reg: 19 24 maxItems: 1
+2
Documentation/devicetree/bindings/rtc/trivial-rtc.yaml
··· 65 65 - microcrystal,rv3029 66 66 # Real Time Clock 67 67 - microcrystal,rv8523 68 + # OLPC XO-1 RTC 69 + - olpc,xo1-rtc 68 70 # I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC 69 71 - ricoh,r2025sd 70 72 # I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC
+1 -1
drivers/rtc/Kconfig
··· 1986 1986 1987 1987 config RTC_DRV_PIC32 1988 1988 tristate "Microchip PIC32 RTC" 1989 - depends on MACH_PIC32 1989 + depends on MACH_PIC32 || COMPILE_TEST 1990 1990 default y 1991 1991 help 1992 1992 If you say yes here you get support for the PIC32 RTC module.
+10 -1
drivers/rtc/dev.c
··· 195 195 196 196 poll_wait(file, &rtc->irq_queue, wait); 197 197 198 - data = rtc->irq_data; 198 + /* 199 + * This read can race with the write in rtc_handle_legacy_irq(). 200 + * 201 + * - If this check misses a zero to non-zero transition the next check 202 + * will pick it up (rtc_handle_legacy_irq() wakes up rtc->irq_queue). 203 + * - Non-zero to non-zero transition misses do not change return value. 204 + * - And a non-zero to zero transition is unlikely to be missed, since 205 + * it occurs on rtc_dev_read(), during which polling is not expected. 206 + */ 207 + data = data_race(rtc->irq_data); 199 208 200 209 return (data != 0) ? (EPOLLIN | EPOLLRDNORM) : 0; 201 210 }
+3 -2
drivers/rtc/rtc-abx80x.c
··· 772 772 struct abx80x_priv *priv; 773 773 int i, data, err, trickle_cfg = -EINVAL; 774 774 char buf[7]; 775 - const struct i2c_device_id *id = i2c_match_id(abx80x_id, client); 776 - unsigned int part = id->driver_data; 775 + unsigned int part = (uintptr_t)i2c_get_match_data(client); 777 776 unsigned int partnumber; 778 777 unsigned int majrev, minrev; 779 778 unsigned int lot; ··· 932 933 client->irq = 0; 933 934 } 934 935 } 936 + if (client->irq <= 0) 937 + clear_bit(RTC_FEATURE_ALARM, priv->rtc->features); 935 938 936 939 err = rtc_add_group(priv->rtc, &rtc_calib_attr_group); 937 940 if (err) {
+2 -7
drivers/rtc/rtc-armada38x.c
··· 72 72 spinlock_t lock; 73 73 int irq; 74 74 bool initialized; 75 - struct value_to_freq *val_to_freq; 76 75 const struct armada38x_rtc_data *data; 76 + struct value_to_freq val_to_freq[]; 77 77 }; 78 78 79 79 #define ALARM1 0 ··· 490 490 { 491 491 struct armada38x_rtc *rtc; 492 492 493 - rtc = devm_kzalloc(&pdev->dev, sizeof(struct armada38x_rtc), 493 + rtc = devm_kzalloc(&pdev->dev, struct_size(rtc, val_to_freq, SAMPLE_NR), 494 494 GFP_KERNEL); 495 495 if (!rtc) 496 496 return -ENOMEM; 497 497 498 498 rtc->data = of_device_get_match_data(&pdev->dev); 499 - 500 - rtc->val_to_freq = devm_kcalloc(&pdev->dev, SAMPLE_NR, 501 - sizeof(struct value_to_freq), GFP_KERNEL); 502 - if (!rtc->val_to_freq) 503 - return -ENOMEM; 504 499 505 500 spin_lock_init(&rtc->lock); 506 501
+11 -2
drivers/rtc/rtc-cmos.c
··· 1429 1429 resource = platform_get_resource(pdev, IORESOURCE_IO, 0); 1430 1430 else 1431 1431 resource = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1432 - irq = platform_get_irq(pdev, 0); 1433 - if (irq < 0) 1432 + irq = platform_get_irq_optional(pdev, 0); 1433 + if (irq < 0) { 1434 1434 irq = -1; 1435 + #ifdef CONFIG_X86 1436 + /* 1437 + * On some x86 systems, the IRQ is not defined, but it should 1438 + * always be safe to hardcode it on systems with a legacy PIC. 1439 + */ 1440 + if (nr_legacy_irqs()) 1441 + irq = RTC_IRQ; 1442 + #endif 1443 + } 1435 1444 1436 1445 return cmos_do_probe(&pdev->dev, resource, irq); 1437 1446 }
+1 -7
drivers/rtc/rtc-m41t80.c
··· 924 924 return -ENOMEM; 925 925 926 926 m41t80_data->client = client; 927 - if (client->dev.of_node) { 928 - m41t80_data->features = (unsigned long) 929 - of_device_get_match_data(&client->dev); 930 - } else { 931 - const struct i2c_device_id *id = i2c_match_id(m41t80_id, client); 932 - m41t80_data->features = id->driver_data; 933 - } 927 + m41t80_data->features = (unsigned long)i2c_get_match_data(client); 934 928 i2c_set_clientdata(client, m41t80_data); 935 929 936 930 m41t80_data->rtc = devm_rtc_allocate_device(&client->dev);
+12 -2
drivers/rtc/rtc-max77686.c
··· 686 686 return ret; 687 687 } 688 688 689 + static void max77686_rtc_release_dev(void *client) 690 + { 691 + i2c_unregister_device(client); 692 + } 693 + 689 694 static int max77686_init_rtc_regmap(struct max77686_rtc_info *info) 690 695 { 691 696 struct device *parent = info->dev->parent; ··· 718 713 goto add_rtc_irq; 719 714 } 720 715 721 - client = devm_i2c_new_dummy_device(info->dev, parent_i2c->adapter, 722 - info->drv_data->rtc_i2c_addr); 716 + client = i2c_new_ancillary_device(parent_i2c, "rtc", 717 + info->drv_data->rtc_i2c_addr); 723 718 if (IS_ERR(client)) 724 719 return dev_err_probe(info->dev, PTR_ERR(client), 725 720 "Failed to allocate I2C device for RTC\n"); 721 + 722 + ret = devm_add_action_or_reset(info->dev, max77686_rtc_release_dev, 723 + client); 724 + if (ret) 725 + return ret; 726 726 727 727 info->rtc_regmap = devm_regmap_init_i2c(client, 728 728 info->drv_data->regmap_config);
+1 -1
drivers/rtc/rtc-ntxec.c
··· 110 110 struct rtc_device *dev; 111 111 struct ntxec_rtc *rtc; 112 112 113 - pdev->dev.of_node = pdev->dev.parent->of_node; 113 + device_set_of_node_from_dev(&pdev->dev, pdev->dev.parent); 114 114 115 115 rtc = devm_kzalloc(&pdev->dev, sizeof(*rtc), GFP_KERNEL); 116 116 if (!rtc)
+7 -16
drivers/rtc/rtc-pcf2127.c
··· 1449 1449 static struct i2c_driver pcf2127_i2c_driver; 1450 1450 1451 1451 static const struct i2c_device_id pcf2127_i2c_id[] = { 1452 - { "pcf2127", PCF2127 }, 1453 - { "pcf2129", PCF2129 }, 1454 - { "pca2129", PCF2129 }, 1455 - { "pcf2131", PCF2131 }, 1452 + { "pcf2127", (kernel_ulong_t)&pcf21xx_cfg[PCF2127] }, 1453 + { "pcf2129", (kernel_ulong_t)&pcf21xx_cfg[PCF2129] }, 1454 + { "pca2129", (kernel_ulong_t)&pcf21xx_cfg[PCF2129] }, 1455 + { "pcf2131", (kernel_ulong_t)&pcf21xx_cfg[PCF2131] }, 1456 1456 { } 1457 1457 }; 1458 1458 MODULE_DEVICE_TABLE(i2c, pcf2127_i2c_id); ··· 1469 1469 if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) 1470 1470 return -ENODEV; 1471 1471 1472 - if (client->dev.of_node) { 1473 - variant = of_device_get_match_data(&client->dev); 1474 - if (!variant) 1475 - return -ENODEV; 1476 - } else { 1477 - enum pcf21xx_type type = 1478 - i2c_match_id(pcf2127_i2c_id, client)->driver_data; 1479 - 1480 - if (type >= PCF21XX_LAST_ID) 1481 - return -ENODEV; 1482 - variant = &pcf21xx_cfg[type]; 1483 - } 1472 + variant = i2c_get_match_data(client); 1473 + if (!variant) 1474 + return -ENODEV; 1484 1475 1485 1476 config.max_register = variant->max_register, 1486 1477
+1 -6
drivers/rtc/rtc-rs5c372.c
··· 825 825 826 826 rs5c372->client = client; 827 827 i2c_set_clientdata(client, rs5c372); 828 - if (client->dev.of_node) { 829 - rs5c372->type = (uintptr_t)of_device_get_match_data(&client->dev); 830 - } else { 831 - const struct i2c_device_id *id = i2c_match_id(rs5c372_id, client); 832 - rs5c372->type = id->driver_data; 833 - } 828 + rs5c372->type = (uintptr_t)i2c_get_match_data(client); 834 829 835 830 /* we read registers 0x0f then 0x00-0x0f; skip the first one */ 836 831 rs5c372->regs = &rs5c372->buf[1];
+1 -7
drivers/rtc/rtc-rv8803.c
··· 667 667 668 668 mutex_init(&rv8803->flags_lock); 669 669 rv8803->client = client; 670 - if (client->dev.of_node) { 671 - rv8803->type = (uintptr_t)of_device_get_match_data(&client->dev); 672 - } else { 673 - const struct i2c_device_id *id = i2c_match_id(rv8803_id, client); 674 - 675 - rv8803->type = id->driver_data; 676 - } 670 + rv8803->type = (uintptr_t)i2c_get_match_data(client); 677 671 i2c_set_clientdata(client, rv8803); 678 672 679 673 flags = rv8803_read_reg(client, RV8803_FLAG);
+1 -3
drivers/rtc/rtc-rx8025.c
··· 522 522 523 523 static int rx8025_probe(struct i2c_client *client) 524 524 { 525 - const struct i2c_device_id *id = i2c_match_id(rx8025_id, client); 526 525 struct i2c_adapter *adapter = client->adapter; 527 526 struct rx8025_data *rx8025; 528 527 int err = 0; ··· 539 540 540 541 i2c_set_clientdata(client, rx8025); 541 542 542 - if (id) 543 - rx8025->model = id->driver_data; 543 + rx8025->model = (uintptr_t)i2c_get_match_data(client); 544 544 545 545 err = rx8025_init_client(client); 546 546 if (err)
+9 -1
drivers/rtc/rtc-ti-k3.c
··· 640 640 static int __maybe_unused ti_k3_rtc_resume(struct device *dev) 641 641 { 642 642 struct ti_k3_rtc *priv = dev_get_drvdata(dev); 643 + int ret = 0; 644 + 645 + if (k3rtc_check_unlocked(priv)) { 646 + /* RTC locked implies low power mode exit where RTC loses context */ 647 + ret = k3rtc_configure(dev); 648 + if (ret) 649 + return ret; 650 + } 643 651 644 652 if (device_may_wakeup(dev)) 645 653 disable_irq_wake(priv->irq); 646 - return 0; 654 + return ret; 647 655 } 648 656 649 657 static SIMPLE_DEV_PM_OPS(ti_k3_rtc_pm_ops, ti_k3_rtc_suspend, ti_k3_rtc_resume);