feat(rtc/ir): add rtc func and fix ir pro
.. | .. |
---|
104 | 104 | allwinner,pins = "PH12", "PH13"; |
---|
105 | 105 | allwinner,pname = "twi3_scl", "twi3_sda"; |
---|
106 | 106 | allwinner,function = "twi3"; |
---|
107 | | - allwinner,muxsel = <2>; |
---|
| 107 | + allwinner,muxsel = <3>; |
---|
108 | 108 | allwinner,drive = <1>; |
---|
109 | 109 | allwinner,pull = <1>; |
---|
110 | 110 | }; |
---|
.. | .. |
---|
373 | 373 | pcf8563@51 { |
---|
374 | 374 | compatible = "haoyu,hym8563"; |
---|
375 | 375 | reg = <0x51>; |
---|
| 376 | + interrupt-parent = <&pio>; |
---|
| 377 | + interrupts = <PB 8 IRQ_TYPE_LEVEL_LOW>; |
---|
376 | 378 | status = "okay"; |
---|
| 379 | + //wakeup-source; |
---|
377 | 380 | }; |
---|
378 | 381 | }; |
---|
379 | 382 | |
---|
.. | .. |
---|
1365 | 1368 | ir_addr_code1 = <0x7f80>; |
---|
1366 | 1369 | ir_power_key_code2 = <0x1c>; |
---|
1367 | 1370 | ir_addr_code2 = <0xdf00>; |
---|
1368 | | - wakeup-source; |
---|
| 1371 | + //wakeup-source; |
---|
1369 | 1372 | }; |
---|
1370 | 1373 | |
---|
1371 | 1374 | //#include "lcd-lvds-21-1920-1080.dtsi" |
---|
.. | .. |
---|
347 | 347 | CONFIG_LIRC=y |
---|
348 | 348 | CONFIG_RC_DEVICES=y |
---|
349 | 349 | CONFIG_IR_SUNXI=y |
---|
| 350 | +CONFIG_SUNXI_MULTI_IR_SUPPORT=y |
---|
350 | 351 | CONFIG_V4L_PLATFORM_DRIVERS=y |
---|
351 | 352 | CONFIG_VIDEO_SUNXI_VIN=m |
---|
352 | 353 | # CONFIG_CSI_CCI is not set |
---|
.. | .. |
---|
438 | 438 | { |
---|
439 | 439 | struct hym8563 *hym8563 = (struct hym8563 *)dev_id; |
---|
440 | 440 | struct i2c_client *client = hym8563->client; |
---|
441 | | - struct mutex *lock = &hym8563->rtc->ops_lock; |
---|
| 441 | + //struct mutex *lock = &hym8563->rtc->ops_lock; |
---|
442 | 442 | int data, ret; |
---|
443 | 443 | |
---|
444 | | - mutex_lock(lock); |
---|
| 444 | + //mutex_lock(lock); |
---|
445 | 445 | |
---|
446 | 446 | /* Clear the alarm flag */ |
---|
447 | 447 | |
---|
.. | .. |
---|
461 | 461 | } |
---|
462 | 462 | |
---|
463 | 463 | out: |
---|
464 | | - mutex_unlock(lock); |
---|
| 464 | + //mutex_unlock(lock); |
---|
465 | 465 | return IRQ_HANDLED; |
---|
466 | 466 | } |
---|
467 | 467 | |
---|
.. | .. |
---|
529 | 529 | { |
---|
530 | 530 | struct hym8563 *hym8563; |
---|
531 | 531 | int ret; |
---|
532 | | - |
---|
| 532 | + struct rtc_time tm = { |
---|
| 533 | + .tm_year = 2024 - 1900, |
---|
| 534 | + .tm_mon = 7, |
---|
| 535 | + .tm_mday = 23, |
---|
| 536 | + .tm_wday = 5, |
---|
| 537 | + .tm_hour = 13, |
---|
| 538 | + }; |
---|
533 | 539 | hym8563 = devm_kzalloc(&client->dev, sizeof(*hym8563), GFP_KERNEL); |
---|
534 | 540 | if (!hym8563) |
---|
535 | 541 | return -ENOMEM; |
---|
.. | .. |
---|
565 | 571 | hym8563->valid = !(ret & HYM8563_SEC_VL); |
---|
566 | 572 | dev_dbg(&client->dev, "rtc information is %s\n", |
---|
567 | 573 | hym8563->valid ? "valid" : "invalid"); |
---|
| 574 | + if (!hym8563->valid) { |
---|
| 575 | + dev_err(&client->dev, "rtc use default time !!!\n"); |
---|
| 576 | + hym8563_rtc_set_time(&client->dev, &tm); |
---|
| 577 | + } |
---|
568 | 578 | |
---|
569 | 579 | hym8563->rtc = devm_rtc_device_register(&client->dev, client->name, |
---|
570 | 580 | &hym8563_rtc_ops, THIS_MODULE); |
---|