Changeset 4057
- Timestamp:
- 02/13/08 02:29:25 (5 years ago)
- Location:
- branches/src/target/kernel/2.6.24.x/patches
- Files:
-
- 3 edited
-
gta01-pcf50606.patch (modified) (18 diffs)
-
pcf50633.patch (modified) (12 diffs)
-
series (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/src/target/kernel/2.6.24.x/patches/gta01-pcf50606.patch
r4056 r4057 9 9 --- /dev/null 10 10 +++ linux-2.6.24/drivers/i2c/chips/pcf50606.c 11 @@ -0,0 +1,19 33@@11 @@ -0,0 +1,1941 @@ 12 12 +/* Philips/NXP PCF50606 Power Management Unit (PMU) driver 13 13 + * … … 567 567 + struct pcf50606_data *pcf = 568 568 + container_of(work, struct pcf50606_data, work); 569 + u_int8_t int1, int2, int3; 569 + u_int8_t pcfirq[3]; 570 + int ret; 570 571 + 571 572 + mutex_lock(&pcf->working_lock); 572 573 + pcf->working = 1; 573 + 574 + int1 = __reg_read(pcf, PCF50606_REG_INT1); 575 + int2 = __reg_read(pcf, PCF50606_REG_INT2); 576 + int3 = __reg_read(pcf, PCF50606_REG_INT3); 574 + /* 575 + * p35 pcf50606 datasheet rev 2.2: 576 + * ''The system controller shall read all interrupt registers in 577 + * one I2C read action'' 578 + * because if you don't INT# gets stuck asserted forever after a 579 + * while 580 + */ 581 + ret = i2c_smbus_read_i2c_block_data(&pcf->client, PCF50606_REG_INT1, 3, 582 + pcfirq); 583 + if (ret != 3) 584 + DEBUGPC("Oh crap PMU IRQ register read failed %d\n", ret); 577 585 + 578 586 + dev_dbg(&pcf->client.dev, "INT1=0x%02x INT2=0x%02x INT3=0x%02x:", 579 + int1, int2, int3);580 + 581 + if ( int1& PCF50606_INT1_ONKEYF) {587 + pcfirq[0], pcfirq[1], pcfirq[2]); 588 + 589 + if (pcfirq[0] & PCF50606_INT1_ONKEYF) { 582 590 + /* ONKEY falling edge (start of button press) */ 583 591 + DEBUGPC("ONKEYF "); … … 585 593 + input_report_key(pcf->input_dev, KEY_POWER, 1); 586 594 + } 587 + if ( int1& PCF50606_INT1_ONKEY1S) {595 + if (pcfirq[0] & PCF50606_INT1_ONKEY1S) { 588 596 + /* ONKEY pressed for more than 1 second */ 589 597 + pcf->onkey_seconds = 0; … … 596 604 + reg_clear_bits(pcf, PCF50606_REG_INT1M, PCF50606_INT1_SECOND); 597 605 + } 598 + if ( int1& PCF50606_INT1_ONKEYR) {606 + if (pcfirq[0] & PCF50606_INT1_ONKEYR) { 599 607 + /* ONKEY rising edge (end of button press) */ 600 608 + DEBUGPC("ONKEYR "); … … 609 617 + PCF50606_INT1_SECOND); 610 618 + } 611 + if ( int1& PCF50606_INT1_EXTONR) {619 + if (pcfirq[0] & PCF50606_INT1_EXTONR) { 612 620 + DEBUGPC("EXTONR "); 613 621 + input_report_key(pcf->input_dev, KEY_POWER2, 1); 614 622 + } 615 + if ( int1& PCF50606_INT1_EXTONF) {623 + if (pcfirq[0] & PCF50606_INT1_EXTONF) { 616 624 + DEBUGPC("EXTONF "); 617 625 + input_report_key(pcf->input_dev, KEY_POWER2, 0); 618 626 + } 619 + if ( int1& PCF50606_INT1_SECOND) {627 + if (pcfirq[0] & PCF50606_INT1_SECOND) { 620 628 + DEBUGPC("SECOND "); 621 629 + if (pcf->flags & PCF50606_F_RTC_SECOND) … … 639 647 + } 640 648 + } 641 + if ( int1& PCF50606_INT1_ALARM) {649 + if (pcfirq[0] & PCF50606_INT1_ALARM) { 642 650 + DEBUGPC("ALARM "); 643 651 + if (pcf->pdata->used_features & PCF50606_FEAT_RTC) … … 646 654 + } 647 655 + 648 + if ( int2& PCF50606_INT2_CHGINS) {656 + if (pcfirq[1] & PCF50606_INT2_CHGINS) { 649 657 + /* Charger inserted */ 650 658 + DEBUGPC("CHGINS "); … … 657 665 + /* FIXME: how to signal this to userspace */ 658 666 + } 659 + if ( int2& PCF50606_INT2_CHGRM) {667 + if (pcfirq[1] & PCF50606_INT2_CHGRM) { 660 668 + /* Charger removed */ 661 669 + DEBUGPC("CHGRM "); … … 668 676 + /* FIXME: how signal this to userspace */ 669 677 + } 670 + if ( int2& PCF50606_INT2_CHGFOK) {678 + if (pcfirq[1] & PCF50606_INT2_CHGFOK) { 671 679 + /* Battery ready for fast charging */ 672 680 + DEBUGPC("CHGFOK "); … … 674 682 + /* FIXME: how to signal this to userspace */ 675 683 + } 676 + if ( int2& PCF50606_INT2_CHGERR) {684 + if (pcfirq[1] & PCF50606_INT2_CHGERR) { 677 685 + /* Error in charge mode */ 678 686 + DEBUGPC("CHGERR "); … … 681 689 + /* FIXME: how to signal this to userspace */ 682 690 + } 683 + if ( int2& PCF50606_INT2_CHGFRDY) {691 + if (pcfirq[1] & PCF50606_INT2_CHGFRDY) { 684 692 + /* Fast charge completed */ 685 693 + DEBUGPC("CHGFRDY "); … … 688 696 + /* FIXME: how to signal this to userspace */ 689 697 + } 690 + if ( int2& PCF50606_INT2_CHGPROT) {698 + if (pcfirq[1] & PCF50606_INT2_CHGPROT) { 691 699 + /* Charging protection interrupt */ 692 700 + DEBUGPC("CHGPROT "); … … 694 702 + /* FIXME: signal this to userspace */ 695 703 + } 696 + if ( int2& PCF50606_INT2_CHGWD10S) {704 + if (pcfirq[1] & PCF50606_INT2_CHGWD10S) { 697 705 + /* Charger watchdog will expire in 10 seconds */ 698 706 + DEBUGPC("CHGWD10S "); … … 701 709 + PCF50606_OOCC1_WDTRST); 702 710 + } 703 + if ( int2& PCF50606_INT2_CHGWDEXP) {711 + if (pcfirq[1] & PCF50606_INT2_CHGWDEXP) { 704 712 + /* Charger watchdog expires */ 705 713 + DEBUGPC("CHGWDEXP "); … … 707 715 + } 708 716 + 709 + if ( int3& PCF50606_INT3_ADCRDY) {717 + if (pcfirq[2] & PCF50606_INT3_ADCRDY) { 710 718 + /* ADC result ready */ 711 719 + DEBUGPC("ADCRDY "); 712 720 + } 713 + if ( int3& PCF50606_INT3_ACDINS) {721 + if (pcfirq[2] & PCF50606_INT3_ACDINS) { 714 722 + /* Accessory insertion detected */ 715 723 + DEBUGPC("ACDINS "); … … 718 726 + PCF50606_FEAT_ACD, PMU_EVT_INSERT); 719 727 + } 720 + if ( int3& PCF50606_INT3_ACDREM) {728 + if (pcfirq[2] & PCF50606_INT3_ACDREM) { 721 729 + /* Accessory removal detected */ 722 730 + DEBUGPC("ACDREM "); … … 726 734 + } 727 735 + /* FIXME: TSCPRES */ 728 + if ( int3& PCF50606_INT3_LOWBAT) {736 + if (pcfirq[2] & PCF50606_INT3_LOWBAT) { 729 737 + /* Really low battery voltage, we have 8 seconds left */ 730 738 + DEBUGPC("LOWBAT "); … … 737 745 + PCF50606_OOCC1_TOTRST); 738 746 + } 739 + if ( int3& PCF50606_INT3_HIGHTMP) {747 + if (pcfirq[2] & PCF50606_INT3_HIGHTMP) { 740 748 + /* High temperature */ 741 749 + DEBUGPC("HIGHTMP "); -
branches/src/target/kernel/2.6.24.x/patches/pcf50633.patch
r4056 r4057 35 35 --- /dev/null 36 36 +++ linux-2.6.24/drivers/i2c/chips/pcf50633.c 37 @@ -0,0 +1,17 89@@37 @@ -0,0 +1,1791 @@ 38 38 +/* Philips PCF50633 Power Management Unit (PMU) driver 39 39 + * … … 527 527 + struct pcf50633_data *pcf = 528 528 + container_of(work, struct pcf50633_data, work); 529 + u_int8_t int1, int2, int3, int4, int5; 529 + u_int8_t pcfirq[5]; 530 + int ret; 530 531 + 531 532 + mutex_lock(&pcf->working_lock); 532 533 + pcf->working = 1; 533 + 534 + /* FIXME: read in one i2c transaction */ 535 + int1 = __reg_read(pcf, PCF50633_REG_INT1); 536 + int2 = __reg_read(pcf, PCF50633_REG_INT2); 537 + int3 = __reg_read(pcf, PCF50633_REG_INT3); 538 + int4 = __reg_read(pcf, PCF50633_REG_INT4); 539 + int5 = __reg_read(pcf, PCF50633_REG_INT5); 534 + /* 535 + * datasheet says we have to read the five IRQ 536 + * status regs in one transaction 537 + */ 538 + ret = i2c_smbus_read_i2c_block_data(&pcf->client, PCF50633_REG_INT1, 5, 539 + pcfirq); 540 + if (ret != 5) 541 + DEBUGP("Oh crap PMU IRQ register read failed %d\n", ret); 540 542 + 541 543 + DEBUGP("INT1=0x%02x INT2=0x%02x INT3=0x%02x INT4=0x%02x INT5=0x%02x\n", 542 + int1, int2, int3, int4, int5);543 + 544 + if ( int1& PCF50633_INT1_ADPINS) {544 + pcfirq[0], pcfirq[1], pcfirq[2], pcfirq[3], pcfirq[4]); 545 + 546 + if (pcfirq[0] & PCF50633_INT1_ADPINS) { 545 547 + /* Charger inserted */ 546 548 + DEBUGPC("ADPINS "); … … 554 556 + //kobject_uevent( ,KOBJ_ADD); 555 557 + } 556 + if ( int1& PCF50633_INT1_ADPREM) {558 + if (pcfirq[0] & PCF50633_INT1_ADPREM) { 557 559 + /* Charger removed */ 558 560 + DEBUGPC("ADPREM "); … … 566 568 + //kobject_uevent( ,KOBJ_ADD); 567 569 + } 568 + if ( int1& PCF50633_INT1_USBINS) {570 + if (pcfirq[0] & PCF50633_INT1_USBINS) { 569 571 + DEBUGPC("USBINS "); 570 572 + input_report_key(pcf->input_dev, KEY_POWER2, 1); … … 576 578 + 577 579 + } 578 + if ( int1& PCF50633_INT1_USBREM) {580 + if (pcfirq[0] & PCF50633_INT1_USBREM) { 579 581 + DEBUGPC("USBREM "); 580 582 + input_report_key(pcf->input_dev, KEY_POWER2, 0); … … 585 587 + PCF50633_FEAT_MBC, PMU_EVT_USB_REMOVE); 586 588 + } 587 + if ( int1& PCF50633_INT1_ALARM) {589 + if (pcfirq[0] & PCF50633_INT1_ALARM) { 588 590 + DEBUGPC("ALARM "); 589 591 + if (pcf->pdata->used_features & PCF50633_FEAT_RTC) … … 591 593 + RTC_AF | RTC_IRQF); 592 594 + } 593 + if ( int1& PCF50633_INT1_SECOND) {595 + if (pcfirq[0] & PCF50633_INT1_SECOND) { 594 596 + DEBUGPC("SECOND "); 595 597 + if (pcf->flags & PCF50633_F_RTC_SECOND) … … 613 615 + } 614 616 + 615 + if ( int2& PCF50633_INT2_ONKEYF) {617 + if (pcfirq[1] & PCF50633_INT2_ONKEYF) { 616 618 + /* ONKEY falling edge (start of button press) */ 617 619 + DEBUGPC("ONKEYF "); … … 619 621 + input_report_key(pcf->input_dev, KEY_POWER, 1); 620 622 + } 621 + if ( int2& PCF50633_INT2_ONKEYR) {623 + if (pcfirq[1] & PCF50633_INT2_ONKEYR) { 622 624 + /* ONKEY rising edge (end of button press) */ 623 625 + DEBUGPC("ONKEYR "); … … 634 636 + /* FIXME: we don't use EXTON1/2/3. thats why we skip it */ 635 637 + 636 + if ( int3& PCF50633_INT3_BATFULL) {638 + if (pcfirq[2] & PCF50633_INT3_BATFULL) { 637 639 + DEBUGPC("BATFULL "); 638 640 + /* FIXME: signal this to userspace */ 639 641 + } 640 + if ( int3& PCF50633_INT3_CHGHALT) {642 + if (pcfirq[2] & PCF50633_INT3_CHGHALT) { 641 643 + DEBUGPC("CHGHALT "); 642 644 + /* FIXME: signal this to userspace */ 643 645 + } 644 + if ( int3& PCF50633_INT3_THLIMON) {646 + if (pcfirq[2] & PCF50633_INT3_THLIMON) { 645 647 + DEBUGPC("THLIMON "); 646 648 + pcf->flags |= PCF50633_F_CHG_PROT; 647 649 + /* FIXME: signal this to userspace */ 648 650 + } 649 + if ( int3& PCF50633_INT3_THLIMOFF) {651 + if (pcfirq[2] & PCF50633_INT3_THLIMOFF) { 650 652 + DEBUGPC("THLIMOFF "); 651 653 + pcf->flags &= ~PCF50633_F_CHG_PROT; 652 654 + /* FIXME: signal this to userspace */ 653 655 + } 654 + if ( int3& PCF50633_INT3_USBLIMON) {656 + if (pcfirq[2] & PCF50633_INT3_USBLIMON) { 655 657 + DEBUGPC("USBLIMON "); 656 658 + /* FIXME: signal this to userspace */ 657 659 + } 658 + if ( int3& PCF50633_INT3_USBLIMOFF) {660 + if (pcfirq[2] & PCF50633_INT3_USBLIMOFF) { 659 661 + DEBUGPC("USBLIMOFF "); 660 662 + /* FIXME: signal this to userspace */ 661 663 + } 662 + if ( int3& PCF50633_INT3_ADCRDY) {664 + if (pcfirq[2] & PCF50633_INT3_ADCRDY) { 663 665 + /* ADC result ready */ 664 666 + DEBUGPC("ADCRDY "); 665 667 + } 666 + if ( int3& PCF50633_INT3_ONKEY1S) {668 + if (pcfirq[2] & PCF50633_INT3_ONKEY1S) { 667 669 + /* ONKEY pressed for more than 1 second */ 668 670 + pcf->onkey_seconds = 0; … … 676 678 + } 677 679 + 678 + if ( int4& (PCF50633_INT4_LOWBAT|PCF50633_INT4_LOWSYS)) {680 + if (pcfirq[3] & (PCF50633_INT4_LOWBAT|PCF50633_INT4_LOWSYS)) { 679 681 + /* Really low battery voltage, we have 8 seconds left */ 680 682 + DEBUGPC("LOWBAT "); … … 687 689 + PCF50633_OOCSHDWN_TOTRST); 688 690 + } 689 + if ( int4& PCF50633_INT4_HIGHTMP) {691 + if (pcfirq[3] & PCF50633_INT4_HIGHTMP) { 690 692 + /* High temperature */ 691 693 + DEBUGPC("HIGHTMP "); 692 694 + apm_queue_event(APM_CRITICAL_SUSPEND); 693 695 + } 694 + if ( int4& (PCF50633_INT4_AUTOPWRFAIL|PCF50633_INT4_DWN1PWRFAIL|696 + if (pcfirq[3] & (PCF50633_INT4_AUTOPWRFAIL|PCF50633_INT4_DWN1PWRFAIL| 695 697 + PCF50633_INT4_DWN2PWRFAIL|PCF50633_INT4_LEDPWRFAIL| 696 698 + PCF50633_INT4_LEDOVP)) { -
branches/src/target/kernel/2.6.24.x/patches/series
r4054 r4057 96 96 97 97 # this may not be the last word on this issue, but the patch certainly helps 98 fix-pcf50633-LOWBAT-kill-init.patch 98 # backed out temporarily since the patch fails and there's a new version of 99 # this just around the corner anyway 100 ##fix-pcf50633-LOWBAT-kill-init.patch 99 101 100 102 # temporary work-around. awaiting decision on correct fix from upstream.
Note: See TracChangeset
for help on using the changeset viewer.
