diff options
Diffstat (limited to 'include/linux/mfd/db8500-prcmu.h')
-rw-r--r-- | include/linux/mfd/db8500-prcmu.h | 183 |
1 files changed, 102 insertions, 81 deletions
diff --git a/include/linux/mfd/db8500-prcmu.h b/include/linux/mfd/db8500-prcmu.h index 60d27f7bfc1f..b3a43b1263fe 100644 --- a/include/linux/mfd/db8500-prcmu.h +++ b/include/linux/mfd/db8500-prcmu.h | |||
@@ -11,6 +11,24 @@ | |||
11 | #define __MFD_DB8500_PRCMU_H | 11 | #define __MFD_DB8500_PRCMU_H |
12 | 12 | ||
13 | #include <linux/interrupt.h> | 13 | #include <linux/interrupt.h> |
14 | #include <linux/bitops.h> | ||
15 | |||
16 | /* | ||
17 | * Registers | ||
18 | */ | ||
19 | #define DB8500_PRCM_GPIOCR 0x138 | ||
20 | #define DB8500_PRCM_GPIOCR_DBG_UARTMOD_CMD0 BIT(0) | ||
21 | #define DB8500_PRCM_GPIOCR_DBG_STM_APE_CMD BIT(9) | ||
22 | #define DB8500_PRCM_GPIOCR_DBG_STM_MOD_CMD1 BIT(11) | ||
23 | #define DB8500_PRCM_GPIOCR_SPI2_SELECT BIT(23) | ||
24 | |||
25 | #define DB8500_PRCM_LINE_VALUE 0x170 | ||
26 | #define DB8500_PRCM_LINE_VALUE_HSI_CAWAKE0 BIT(3) | ||
27 | |||
28 | #define DB8500_PRCM_DSI_SW_RESET 0x324 | ||
29 | #define DB8500_PRCM_DSI_SW_RESET_DSI0_SW_RESETN BIT(0) | ||
30 | #define DB8500_PRCM_DSI_SW_RESET_DSI1_SW_RESETN BIT(1) | ||
31 | #define DB8500_PRCM_DSI_SW_RESET_DSI2_SW_RESETN BIT(2) | ||
14 | 32 | ||
15 | /* This portion previously known as <mach/prcmu-fw-defs_v1.h> */ | 33 | /* This portion previously known as <mach/prcmu-fw-defs_v1.h> */ |
16 | 34 | ||
@@ -421,40 +439,22 @@ enum auto_enable { | |||
421 | /* End of file previously known as prcmu-fw-defs_v1.h */ | 439 | /* End of file previously known as prcmu-fw-defs_v1.h */ |
422 | 440 | ||
423 | /** | 441 | /** |
424 | * enum hw_acc_dev - enum for hw accelerators | 442 | * enum prcmu_power_status - results from set_power_state |
425 | * @HW_ACC_SVAMMDSP: for SVAMMDSP | 443 | * @PRCMU_SLEEP_OK: Sleep went ok |
426 | * @HW_ACC_SVAPIPE: for SVAPIPE | 444 | * @PRCMU_DEEP_SLEEP_OK: DeepSleep went ok |
427 | * @HW_ACC_SIAMMDSP: for SIAMMDSP | 445 | * @PRCMU_IDLE_OK: Idle went ok |
428 | * @HW_ACC_SIAPIPE: for SIAPIPE | 446 | * @PRCMU_DEEPIDLE_OK: DeepIdle went ok |
429 | * @HW_ACC_SGA: for SGA | 447 | * @PRCMU_PRCMU2ARMPENDINGIT_ER: Pending interrupt detected |
430 | * @HW_ACC_B2R2: for B2R2 | 448 | * @PRCMU_ARMPENDINGIT_ER: Pending interrupt detected |
431 | * @HW_ACC_MCDE: for MCDE | ||
432 | * @HW_ACC_ESRAM1: for ESRAM1 | ||
433 | * @HW_ACC_ESRAM2: for ESRAM2 | ||
434 | * @HW_ACC_ESRAM3: for ESRAM3 | ||
435 | * @HW_ACC_ESRAM4: for ESRAM4 | ||
436 | * @NUM_HW_ACC: number of hardware accelerators | ||
437 | * | ||
438 | * Different hw accelerators which can be turned ON/ | ||
439 | * OFF or put into retention (MMDSPs and ESRAMs). | ||
440 | * Used with EPOD API. | ||
441 | * | 449 | * |
442 | * NOTE! Deprecated, to be removed when all users switched over to use the | ||
443 | * regulator API. | ||
444 | */ | 450 | */ |
445 | enum hw_acc_dev { | 451 | enum prcmu_power_status { |
446 | HW_ACC_SVAMMDSP, | 452 | PRCMU_SLEEP_OK = 0xf3, |
447 | HW_ACC_SVAPIPE, | 453 | PRCMU_DEEP_SLEEP_OK = 0xf6, |
448 | HW_ACC_SIAMMDSP, | 454 | PRCMU_IDLE_OK = 0xf0, |
449 | HW_ACC_SIAPIPE, | 455 | PRCMU_DEEPIDLE_OK = 0xe3, |
450 | HW_ACC_SGA, | 456 | PRCMU_PRCMU2ARMPENDINGIT_ER = 0x91, |
451 | HW_ACC_B2R2, | 457 | PRCMU_ARMPENDINGIT_ER = 0x93, |
452 | HW_ACC_MCDE, | ||
453 | HW_ACC_ESRAM1, | ||
454 | HW_ACC_ESRAM2, | ||
455 | HW_ACC_ESRAM3, | ||
456 | HW_ACC_ESRAM4, | ||
457 | NUM_HW_ACC | ||
458 | }; | 458 | }; |
459 | 459 | ||
460 | /* | 460 | /* |
@@ -493,6 +493,20 @@ struct prcmu_auto_pm_config { | |||
493 | u8 sva_policy; | 493 | u8 sva_policy; |
494 | }; | 494 | }; |
495 | 495 | ||
496 | #define PRCMU_FW_PROJECT_U8500 2 | ||
497 | #define PRCMU_FW_PROJECT_U9500 4 | ||
498 | #define PRCMU_FW_PROJECT_U8500_C2 7 | ||
499 | #define PRCMU_FW_PROJECT_U9500_C2 11 | ||
500 | #define PRCMU_FW_PROJECT_U8520 13 | ||
501 | #define PRCMU_FW_PROJECT_U8420 14 | ||
502 | |||
503 | struct prcmu_fw_version { | ||
504 | u8 project; | ||
505 | u8 api_version; | ||
506 | u8 func_version; | ||
507 | u8 errata; | ||
508 | }; | ||
509 | |||
496 | #ifdef CONFIG_MFD_DB8500_PRCMU | 510 | #ifdef CONFIG_MFD_DB8500_PRCMU |
497 | 511 | ||
498 | void db8500_prcmu_early_init(void); | 512 | void db8500_prcmu_early_init(void); |
@@ -500,42 +514,41 @@ int prcmu_set_rc_a2p(enum romcode_write); | |||
500 | enum romcode_read prcmu_get_rc_p2a(void); | 514 | enum romcode_read prcmu_get_rc_p2a(void); |
501 | enum ap_pwrst prcmu_get_xp70_current_state(void); | 515 | enum ap_pwrst prcmu_get_xp70_current_state(void); |
502 | bool prcmu_has_arm_maxopp(void); | 516 | bool prcmu_has_arm_maxopp(void); |
503 | bool prcmu_is_u8400(void); | 517 | struct prcmu_fw_version *prcmu_get_fw_version(void); |
504 | int prcmu_set_ape_opp(u8 opp); | ||
505 | int prcmu_get_ape_opp(void); | ||
506 | int prcmu_request_ape_opp_100_voltage(bool enable); | 518 | int prcmu_request_ape_opp_100_voltage(bool enable); |
507 | int prcmu_release_usb_wakeup_state(void); | 519 | int prcmu_release_usb_wakeup_state(void); |
508 | int prcmu_set_ddr_opp(u8 opp); | ||
509 | int prcmu_get_ddr_opp(void); | ||
510 | /* NOTE! Use regulator framework instead */ | ||
511 | int prcmu_set_hwacc(u16 hw_acc_dev, u8 state); | ||
512 | void prcmu_configure_auto_pm(struct prcmu_auto_pm_config *sleep, | 520 | void prcmu_configure_auto_pm(struct prcmu_auto_pm_config *sleep, |
513 | struct prcmu_auto_pm_config *idle); | 521 | struct prcmu_auto_pm_config *idle); |
514 | bool prcmu_is_auto_pm_enabled(void); | 522 | bool prcmu_is_auto_pm_enabled(void); |
515 | 523 | ||
516 | int prcmu_config_clkout(u8 clkout, u8 source, u8 div); | 524 | int prcmu_config_clkout(u8 clkout, u8 source, u8 div); |
517 | int prcmu_set_clock_divider(u8 clock, u8 divider); | 525 | int prcmu_set_clock_divider(u8 clock, u8 divider); |
518 | int prcmu_config_hotdog(u8 threshold); | 526 | int db8500_prcmu_config_hotdog(u8 threshold); |
519 | int prcmu_config_hotmon(u8 low, u8 high); | 527 | int db8500_prcmu_config_hotmon(u8 low, u8 high); |
520 | int prcmu_start_temp_sense(u16 cycles32k); | 528 | int db8500_prcmu_start_temp_sense(u16 cycles32k); |
521 | int prcmu_stop_temp_sense(void); | 529 | int db8500_prcmu_stop_temp_sense(void); |
522 | int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size); | 530 | int prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size); |
523 | int prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size); | 531 | int prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size); |
524 | 532 | ||
525 | void prcmu_ac_wake_req(void); | 533 | void prcmu_ac_wake_req(void); |
526 | void prcmu_ac_sleep_req(void); | 534 | void prcmu_ac_sleep_req(void); |
527 | void prcmu_modem_reset(void); | 535 | void db8500_prcmu_modem_reset(void); |
528 | void prcmu_enable_spi2(void); | ||
529 | void prcmu_disable_spi2(void); | ||
530 | 536 | ||
531 | int prcmu_config_a9wdog(u8 num, bool sleep_auto_off); | 537 | int db8500_prcmu_config_a9wdog(u8 num, bool sleep_auto_off); |
532 | int prcmu_enable_a9wdog(u8 id); | 538 | int db8500_prcmu_enable_a9wdog(u8 id); |
533 | int prcmu_disable_a9wdog(u8 id); | 539 | int db8500_prcmu_disable_a9wdog(u8 id); |
534 | int prcmu_kick_a9wdog(u8 id); | 540 | int db8500_prcmu_kick_a9wdog(u8 id); |
535 | int prcmu_load_a9wdog(u8 id, u32 val); | 541 | int db8500_prcmu_load_a9wdog(u8 id, u32 val); |
536 | 542 | ||
537 | void db8500_prcmu_system_reset(u16 reset_code); | 543 | void db8500_prcmu_system_reset(u16 reset_code); |
538 | int db8500_prcmu_set_power_state(u8 state, bool keep_ulp_clk, bool keep_ap_pll); | 544 | int db8500_prcmu_set_power_state(u8 state, bool keep_ulp_clk, bool keep_ap_pll); |
545 | u8 db8500_prcmu_get_power_state_result(void); | ||
546 | int db8500_prcmu_gic_decouple(void); | ||
547 | int db8500_prcmu_gic_recouple(void); | ||
548 | int db8500_prcmu_copy_gic_settings(void); | ||
549 | bool db8500_prcmu_gic_pending_irq(void); | ||
550 | bool db8500_prcmu_pending_irq(void); | ||
551 | bool db8500_prcmu_is_cpu_in_wfi(int cpu); | ||
539 | void db8500_prcmu_enable_wakeups(u32 wakeups); | 552 | void db8500_prcmu_enable_wakeups(u32 wakeups); |
540 | int db8500_prcmu_set_epod(u16 epod_id, u8 epod_state); | 553 | int db8500_prcmu_set_epod(u16 epod_id, u8 epod_state); |
541 | int db8500_prcmu_request_clock(u8 clock, bool enable); | 554 | int db8500_prcmu_request_clock(u8 clock, bool enable); |
@@ -549,6 +562,14 @@ u16 db8500_prcmu_get_reset_code(void); | |||
549 | bool db8500_prcmu_is_ac_wake_requested(void); | 562 | bool db8500_prcmu_is_ac_wake_requested(void); |
550 | int db8500_prcmu_set_arm_opp(u8 opp); | 563 | int db8500_prcmu_set_arm_opp(u8 opp); |
551 | int db8500_prcmu_get_arm_opp(void); | 564 | int db8500_prcmu_get_arm_opp(void); |
565 | int db8500_prcmu_set_ape_opp(u8 opp); | ||
566 | int db8500_prcmu_get_ape_opp(void); | ||
567 | int db8500_prcmu_set_ddr_opp(u8 opp); | ||
568 | int db8500_prcmu_get_ddr_opp(void); | ||
569 | |||
570 | u32 db8500_prcmu_read(unsigned int reg); | ||
571 | void db8500_prcmu_write(unsigned int reg, u32 value); | ||
572 | void db8500_prcmu_write_masked(unsigned int reg, u32 mask, u32 value); | ||
552 | 573 | ||
553 | #else /* !CONFIG_MFD_DB8500_PRCMU */ | 574 | #else /* !CONFIG_MFD_DB8500_PRCMU */ |
554 | 575 | ||
@@ -574,17 +595,17 @@ static inline bool prcmu_has_arm_maxopp(void) | |||
574 | return false; | 595 | return false; |
575 | } | 596 | } |
576 | 597 | ||
577 | static inline bool prcmu_is_u8400(void) | 598 | static inline struct prcmu_fw_version *prcmu_get_fw_version(void) |
578 | { | 599 | { |
579 | return false; | 600 | return NULL; |
580 | } | 601 | } |
581 | 602 | ||
582 | static inline int prcmu_set_ape_opp(u8 opp) | 603 | static inline int db8500_prcmu_set_ape_opp(u8 opp) |
583 | { | 604 | { |
584 | return 0; | 605 | return 0; |
585 | } | 606 | } |
586 | 607 | ||
587 | static inline int prcmu_get_ape_opp(void) | 608 | static inline int db8500_prcmu_get_ape_opp(void) |
588 | { | 609 | { |
589 | return APE_100_OPP; | 610 | return APE_100_OPP; |
590 | } | 611 | } |
@@ -599,21 +620,16 @@ static inline int prcmu_release_usb_wakeup_state(void) | |||
599 | return 0; | 620 | return 0; |
600 | } | 621 | } |
601 | 622 | ||
602 | static inline int prcmu_set_ddr_opp(u8 opp) | 623 | static inline int db8500_prcmu_set_ddr_opp(u8 opp) |
603 | { | 624 | { |
604 | return 0; | 625 | return 0; |
605 | } | 626 | } |
606 | 627 | ||
607 | static inline int prcmu_get_ddr_opp(void) | 628 | static inline int db8500_prcmu_get_ddr_opp(void) |
608 | { | 629 | { |
609 | return DDR_100_OPP; | 630 | return DDR_100_OPP; |
610 | } | 631 | } |
611 | 632 | ||
612 | static inline int prcmu_set_hwacc(u16 hw_acc_dev, u8 state) | ||
613 | { | ||
614 | return 0; | ||
615 | } | ||
616 | |||
617 | static inline void prcmu_configure_auto_pm(struct prcmu_auto_pm_config *sleep, | 633 | static inline void prcmu_configure_auto_pm(struct prcmu_auto_pm_config *sleep, |
618 | struct prcmu_auto_pm_config *idle) | 634 | struct prcmu_auto_pm_config *idle) |
619 | { | 635 | { |
@@ -634,22 +650,22 @@ static inline int prcmu_set_clock_divider(u8 clock, u8 divider) | |||
634 | return 0; | 650 | return 0; |
635 | } | 651 | } |
636 | 652 | ||
637 | static inline int prcmu_config_hotdog(u8 threshold) | 653 | static inline int db8500_prcmu_config_hotdog(u8 threshold) |
638 | { | 654 | { |
639 | return 0; | 655 | return 0; |
640 | } | 656 | } |
641 | 657 | ||
642 | static inline int prcmu_config_hotmon(u8 low, u8 high) | 658 | static inline int db8500_prcmu_config_hotmon(u8 low, u8 high) |
643 | { | 659 | { |
644 | return 0; | 660 | return 0; |
645 | } | 661 | } |
646 | 662 | ||
647 | static inline int prcmu_start_temp_sense(u16 cycles32k) | 663 | static inline int db8500_prcmu_start_temp_sense(u16 cycles32k) |
648 | { | 664 | { |
649 | return 0; | 665 | return 0; |
650 | } | 666 | } |
651 | 667 | ||
652 | static inline int prcmu_stop_temp_sense(void) | 668 | static inline int db8500_prcmu_stop_temp_sense(void) |
653 | { | 669 | { |
654 | return 0; | 670 | return 0; |
655 | } | 671 | } |
@@ -668,22 +684,17 @@ static inline void prcmu_ac_wake_req(void) {} | |||
668 | 684 | ||
669 | static inline void prcmu_ac_sleep_req(void) {} | 685 | static inline void prcmu_ac_sleep_req(void) {} |
670 | 686 | ||
671 | static inline void prcmu_modem_reset(void) {} | 687 | static inline void db8500_prcmu_modem_reset(void) {} |
672 | 688 | ||
673 | static inline int prcmu_enable_spi2(void) | 689 | static inline void db8500_prcmu_system_reset(u16 reset_code) {} |
674 | { | ||
675 | return 0; | ||
676 | } | ||
677 | 690 | ||
678 | static inline int prcmu_disable_spi2(void) | 691 | static inline int db8500_prcmu_set_power_state(u8 state, bool keep_ulp_clk, |
692 | bool keep_ap_pll) | ||
679 | { | 693 | { |
680 | return 0; | 694 | return 0; |
681 | } | 695 | } |
682 | 696 | ||
683 | static inline void db8500_prcmu_system_reset(u16 reset_code) {} | 697 | static inline u8 db8500_prcmu_get_power_state_result(void) |
684 | |||
685 | static inline int db8500_prcmu_set_power_state(u8 state, bool keep_ulp_clk, | ||
686 | bool keep_ap_pll) | ||
687 | { | 698 | { |
688 | return 0; | 699 | return 0; |
689 | } | 700 | } |
@@ -729,27 +740,27 @@ static inline u16 db8500_prcmu_get_reset_code(void) | |||
729 | return 0; | 740 | return 0; |
730 | } | 741 | } |
731 | 742 | ||
732 | static inline int prcmu_config_a9wdog(u8 num, bool sleep_auto_off) | 743 | static inline int db8500_prcmu_config_a9wdog(u8 num, bool sleep_auto_off) |
733 | { | 744 | { |
734 | return 0; | 745 | return 0; |
735 | } | 746 | } |
736 | 747 | ||
737 | static inline int prcmu_enable_a9wdog(u8 id) | 748 | static inline int db8500_prcmu_enable_a9wdog(u8 id) |
738 | { | 749 | { |
739 | return 0; | 750 | return 0; |
740 | } | 751 | } |
741 | 752 | ||
742 | static inline int prcmu_disable_a9wdog(u8 id) | 753 | static inline int db8500_prcmu_disable_a9wdog(u8 id) |
743 | { | 754 | { |
744 | return 0; | 755 | return 0; |
745 | } | 756 | } |
746 | 757 | ||
747 | static inline int prcmu_kick_a9wdog(u8 id) | 758 | static inline int db8500_prcmu_kick_a9wdog(u8 id) |
748 | { | 759 | { |
749 | return 0; | 760 | return 0; |
750 | } | 761 | } |
751 | 762 | ||
752 | static inline int prcmu_load_a9wdog(u8 id, u32 val) | 763 | static inline int db8500_prcmu_load_a9wdog(u8 id, u32 val) |
753 | { | 764 | { |
754 | return 0; | 765 | return 0; |
755 | } | 766 | } |
@@ -769,6 +780,16 @@ static inline int db8500_prcmu_get_arm_opp(void) | |||
769 | return 0; | 780 | return 0; |
770 | } | 781 | } |
771 | 782 | ||
783 | static inline u32 db8500_prcmu_read(unsigned int reg) | ||
784 | { | ||
785 | return 0; | ||
786 | } | ||
787 | |||
788 | static inline void db8500_prcmu_write(unsigned int reg, u32 value) {} | ||
789 | |||
790 | static inline void db8500_prcmu_write_masked(unsigned int reg, u32 mask, | ||
791 | u32 value) {} | ||
792 | |||
772 | #endif /* !CONFIG_MFD_DB8500_PRCMU */ | 793 | #endif /* !CONFIG_MFD_DB8500_PRCMU */ |
773 | 794 | ||
774 | #endif /* __MFD_DB8500_PRCMU_H */ | 795 | #endif /* __MFD_DB8500_PRCMU_H */ |