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

rtc: s5m: Drop S5M8763 support

The S5M8763 MFD has no device tree compatible, and since board file
support for it was removed, there's no way to use this MFD. After
removing the remaining code for it from the MFD driver, also remove
support for it in the s5m RTC driver, and all remaining references to
it.

Signed-off-by: David Virag <virag.david003@gmail.com>
Acked-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20230131183008.4451-3-virag.david003@gmail.com

authored by

David Virag and committed by
Lee Jones
a3165aba f736d2c0

+3 -130
+3 -79
drivers/rtc/rtc-s5m.c
··· 85 85 unsigned int write_alarm_udr_mask; 86 86 }; 87 87 88 - /* Register map for S5M8763 and S5M8767 */ 88 + /* Register map for S5M8767 */ 89 89 static const struct s5m_rtc_reg_config s5m_rtc_regs = { 90 90 .regs_count = 8, 91 91 .time = S5M_RTC_SEC, ··· 236 236 237 237 switch (info->device_type) { 238 238 case S5M8767X: 239 - case S5M8763X: 240 239 ret = regmap_read(info->regmap, S5M_RTC_STATUS, &val); 241 240 val &= S5M_ALARM0_STATUS; 242 241 break; ··· 298 299 299 300 data |= info->regs->write_alarm_udr_mask; 300 301 switch (info->device_type) { 301 - case S5M8763X: 302 302 case S5M8767X: 303 303 data &= ~S5M_RTC_TIME_EN_MASK; 304 304 break; ··· 327 329 return ret; 328 330 } 329 331 330 - static void s5m8763_data_to_tm(u8 *data, struct rtc_time *tm) 331 - { 332 - tm->tm_sec = bcd2bin(data[RTC_SEC]); 333 - tm->tm_min = bcd2bin(data[RTC_MIN]); 334 - 335 - if (data[RTC_HOUR] & HOUR_12) { 336 - tm->tm_hour = bcd2bin(data[RTC_HOUR] & 0x1f); 337 - if (data[RTC_HOUR] & HOUR_PM) 338 - tm->tm_hour += 12; 339 - } else { 340 - tm->tm_hour = bcd2bin(data[RTC_HOUR] & 0x3f); 341 - } 342 - 343 - tm->tm_wday = data[RTC_WEEKDAY] & 0x07; 344 - tm->tm_mday = bcd2bin(data[RTC_DATE]); 345 - tm->tm_mon = bcd2bin(data[RTC_MONTH]); 346 - tm->tm_year = bcd2bin(data[RTC_YEAR1]) + bcd2bin(data[RTC_YEAR2]) * 100; 347 - tm->tm_year -= 1900; 348 - } 349 - 350 - static void s5m8763_tm_to_data(struct rtc_time *tm, u8 *data) 351 - { 352 - data[RTC_SEC] = bin2bcd(tm->tm_sec); 353 - data[RTC_MIN] = bin2bcd(tm->tm_min); 354 - data[RTC_HOUR] = bin2bcd(tm->tm_hour); 355 - data[RTC_WEEKDAY] = tm->tm_wday; 356 - data[RTC_DATE] = bin2bcd(tm->tm_mday); 357 - data[RTC_MONTH] = bin2bcd(tm->tm_mon); 358 - data[RTC_YEAR1] = bin2bcd(tm->tm_year % 100); 359 - data[RTC_YEAR2] = bin2bcd((tm->tm_year + 1900) / 100); 360 - } 361 - 362 332 static int s5m_rtc_read_time(struct device *dev, struct rtc_time *tm) 363 333 { 364 334 struct s5m_rtc_info *info = dev_get_drvdata(dev); ··· 351 385 return ret; 352 386 353 387 switch (info->device_type) { 354 - case S5M8763X: 355 - s5m8763_data_to_tm(data, tm); 356 - break; 357 - 358 388 case S5M8767X: 359 389 case S2MPS15X: 360 390 case S2MPS14X: ··· 374 412 int ret = 0; 375 413 376 414 switch (info->device_type) { 377 - case S5M8763X: 378 - s5m8763_tm_to_data(tm, data); 379 - break; 380 415 case S5M8767X: 381 416 case S2MPS15X: 382 417 case S2MPS14X: ··· 403 444 { 404 445 struct s5m_rtc_info *info = dev_get_drvdata(dev); 405 446 u8 data[RTC_MAX_NUM_TIME_REGS]; 406 - unsigned int val; 407 447 int ret, i; 408 448 409 449 ret = regmap_bulk_read(info->regmap, info->regs->alarm0, data, ··· 411 453 return ret; 412 454 413 455 switch (info->device_type) { 414 - case S5M8763X: 415 - s5m8763_data_to_tm(data, &alrm->time); 416 - ret = regmap_read(info->regmap, S5M_ALARM0_CONF, &val); 417 - if (ret < 0) 418 - return ret; 419 - 420 - alrm->enabled = !!val; 421 - break; 422 - 423 456 case S5M8767X: 424 457 case S2MPS15X: 425 458 case S2MPS14X: ··· 449 500 dev_dbg(info->dev, "%s: %ptR(%d)\n", __func__, &tm, tm.tm_wday); 450 501 451 502 switch (info->device_type) { 452 - case S5M8763X: 453 - ret = regmap_write(info->regmap, S5M_ALARM0_CONF, 0); 454 - break; 455 - 456 503 case S5M8767X: 457 504 case S2MPS15X: 458 505 case S2MPS14X: ··· 476 531 { 477 532 int ret; 478 533 u8 data[RTC_MAX_NUM_TIME_REGS]; 479 - u8 alarm0_conf; 480 534 struct rtc_time tm; 481 535 482 536 ret = regmap_bulk_read(info->regmap, info->regs->alarm0, data, ··· 487 543 dev_dbg(info->dev, "%s: %ptR(%d)\n", __func__, &tm, tm.tm_wday); 488 544 489 545 switch (info->device_type) { 490 - case S5M8763X: 491 - alarm0_conf = 0x77; 492 - ret = regmap_write(info->regmap, S5M_ALARM0_CONF, alarm0_conf); 493 - break; 494 - 495 546 case S5M8767X: 496 547 case S2MPS15X: 497 548 case S2MPS14X: ··· 524 585 int ret; 525 586 526 587 switch (info->device_type) { 527 - case S5M8763X: 528 - s5m8763_tm_to_data(&alrm->time, data); 529 - break; 530 - 531 588 case S5M8767X: 532 589 case S2MPS15X: 533 590 case S2MPS14X: ··· 590 655 int ret; 591 656 592 657 switch (info->device_type) { 593 - case S5M8763X: 594 658 case S5M8767X: 595 659 /* UDR update time. Default of 7.32 ms is too long. */ 596 660 ret = regmap_update_bits(info->regmap, S5M_RTC_UDR_CON, ··· 663 729 info->regs = &s2mps13_rtc_regs; 664 730 alarm_irq = S2MPS14_IRQ_RTCA0; 665 731 break; 666 - case S5M8763X: 667 - regmap_cfg = &s5m_rtc_regmap_config; 668 - info->regs = &s5m_rtc_regs; 669 - alarm_irq = S5M8763_IRQ_ALARM0; 670 - break; 671 732 case S5M8767X: 672 733 regmap_cfg = &s5m_rtc_regmap_config; 673 734 info->regs = &s5m_rtc_regs; ··· 715 786 716 787 info->rtc_dev->ops = &s5m_rtc_ops; 717 788 718 - if (info->device_type == S5M8763X) { 719 - info->rtc_dev->range_min = RTC_TIMESTAMP_BEGIN_0000; 720 - info->rtc_dev->range_max = RTC_TIMESTAMP_END_9999; 721 - } else { 722 - info->rtc_dev->range_min = RTC_TIMESTAMP_BEGIN_2000; 723 - info->rtc_dev->range_max = RTC_TIMESTAMP_END_2099; 724 - } 789 + info->rtc_dev->range_min = RTC_TIMESTAMP_BEGIN_2000; 790 + info->rtc_dev->range_max = RTC_TIMESTAMP_END_2099; 725 791 726 792 if (!info->irq) { 727 793 clear_bit(RTC_FEATURE_ALARM, info->rtc_dev->features);
-1
include/linux/mfd/samsung/core.h
··· 36 36 struct gpio_desc; 37 37 38 38 enum sec_device_type { 39 - S5M8763X, 40 39 S5M8767X, 41 40 S2MPA01, 42 41 S2MPS11X,
-50
include/linux/mfd/samsung/irq.h
··· 194 194 #define S5M8767_IRQ_RTC1S_MASK (1 << 4) 195 195 #define S5M8767_IRQ_WTSR_MASK (1 << 5) 196 196 197 - enum s5m8763_irq { 198 - S5M8763_IRQ_DCINF, 199 - S5M8763_IRQ_DCINR, 200 - S5M8763_IRQ_JIGF, 201 - S5M8763_IRQ_JIGR, 202 - S5M8763_IRQ_PWRONF, 203 - S5M8763_IRQ_PWRONR, 204 - 205 - S5M8763_IRQ_WTSREVNT, 206 - S5M8763_IRQ_SMPLEVNT, 207 - S5M8763_IRQ_ALARM1, 208 - S5M8763_IRQ_ALARM0, 209 - 210 - S5M8763_IRQ_ONKEY1S, 211 - S5M8763_IRQ_TOPOFFR, 212 - S5M8763_IRQ_DCINOVPR, 213 - S5M8763_IRQ_CHGRSTF, 214 - S5M8763_IRQ_DONER, 215 - S5M8763_IRQ_CHGFAULT, 216 - 217 - S5M8763_IRQ_LOBAT1, 218 - S5M8763_IRQ_LOBAT2, 219 - 220 - S5M8763_IRQ_NR, 221 - }; 222 - 223 - #define S5M8763_IRQ_DCINF_MASK (1 << 2) 224 - #define S5M8763_IRQ_DCINR_MASK (1 << 3) 225 - #define S5M8763_IRQ_JIGF_MASK (1 << 4) 226 - #define S5M8763_IRQ_JIGR_MASK (1 << 5) 227 - #define S5M8763_IRQ_PWRONF_MASK (1 << 6) 228 - #define S5M8763_IRQ_PWRONR_MASK (1 << 7) 229 - 230 - #define S5M8763_IRQ_WTSREVNT_MASK (1 << 0) 231 - #define S5M8763_IRQ_SMPLEVNT_MASK (1 << 1) 232 - #define S5M8763_IRQ_ALARM1_MASK (1 << 2) 233 - #define S5M8763_IRQ_ALARM0_MASK (1 << 3) 234 - 235 - #define S5M8763_IRQ_ONKEY1S_MASK (1 << 0) 236 - #define S5M8763_IRQ_TOPOFFR_MASK (1 << 2) 237 - #define S5M8763_IRQ_DCINOVPR_MASK (1 << 3) 238 - #define S5M8763_IRQ_CHGRSTF_MASK (1 << 4) 239 - #define S5M8763_IRQ_DONER_MASK (1 << 5) 240 - #define S5M8763_IRQ_CHGFAULT_MASK (1 << 7) 241 - 242 - #define S5M8763_IRQ_LOBAT1_MASK (1 << 0) 243 - #define S5M8763_IRQ_LOBAT2_MASK (1 << 1) 244 - 245 - #define S5M8763_ENRAMP (1 << 4) 246 - 247 197 #endif /* __LINUX_MFD_SEC_IRQ_H */