@@ -762,105 +762,115 @@ __init int exynos_eint_wkup_init(struct samsung_pinctrl_drv_data *d)
762
762
return 0 ;
763
763
}
764
764
765
- static void exynos_pinctrl_suspend_bank (struct samsung_pin_bank * bank )
765
+ static void exynos_set_wakeup (struct samsung_pin_bank * bank )
766
766
{
767
- struct exynos_eint_gpio_save * save = bank -> soc_priv ;
768
- const void __iomem * regs = bank -> eint_base ;
767
+ struct exynos_irq_chip * irq_chip ;
769
768
770
- save -> eint_con = readl (regs + EXYNOS_GPIO_ECON_OFFSET
771
- + bank -> eint_offset );
772
- save -> eint_fltcon0 = readl (regs + EXYNOS_GPIO_EFLTCON_OFFSET
773
- + 2 * bank -> eint_offset );
774
- save -> eint_fltcon1 = readl (regs + EXYNOS_GPIO_EFLTCON_OFFSET
775
- + 2 * bank -> eint_offset + 4 );
776
- save -> eint_mask = readl (regs + bank -> irq_chip -> eint_mask
777
- + bank -> eint_offset );
778
-
779
- pr_debug ("%s: save con %#010x\n" , bank -> name , save -> eint_con );
780
- pr_debug ("%s: save fltcon0 %#010x\n" , bank -> name , save -> eint_fltcon0 );
781
- pr_debug ("%s: save fltcon1 %#010x\n" , bank -> name , save -> eint_fltcon1 );
782
- pr_debug ("%s: save mask %#010x\n" , bank -> name , save -> eint_mask );
769
+ if (bank -> irq_chip ) {
770
+ irq_chip = bank -> irq_chip ;
771
+ irq_chip -> set_eint_wakeup_mask (bank -> drvdata , irq_chip );
772
+ }
783
773
}
784
774
785
- static void exynosauto_pinctrl_suspend_bank (struct samsung_pin_bank * bank )
775
+ void exynos_pinctrl_suspend (struct samsung_pin_bank * bank )
786
776
{
787
777
struct exynos_eint_gpio_save * save = bank -> soc_priv ;
788
778
const void __iomem * regs = bank -> eint_base ;
789
779
790
- save -> eint_con = readl (regs + bank -> pctl_offset + bank -> eint_con_offset );
791
- save -> eint_mask = readl (regs + bank -> pctl_offset + bank -> eint_mask_offset );
792
-
793
- pr_debug ("%s: save con %#010x\n" , bank -> name , save -> eint_con );
794
- pr_debug ("%s: save mask %#010x\n" , bank -> name , save -> eint_mask );
780
+ if (bank -> eint_type == EINT_TYPE_GPIO ) {
781
+ save -> eint_con = readl (regs + EXYNOS_GPIO_ECON_OFFSET
782
+ + bank -> eint_offset );
783
+ save -> eint_fltcon0 = readl (regs + EXYNOS_GPIO_EFLTCON_OFFSET
784
+ + 2 * bank -> eint_offset );
785
+ save -> eint_fltcon1 = readl (regs + EXYNOS_GPIO_EFLTCON_OFFSET
786
+ + 2 * bank -> eint_offset + 4 );
787
+ save -> eint_mask = readl (regs + bank -> irq_chip -> eint_mask
788
+ + bank -> eint_offset );
789
+
790
+ pr_debug ("%s: save con %#010x\n" ,
791
+ bank -> name , save -> eint_con );
792
+ pr_debug ("%s: save fltcon0 %#010x\n" ,
793
+ bank -> name , save -> eint_fltcon0 );
794
+ pr_debug ("%s: save fltcon1 %#010x\n" ,
795
+ bank -> name , save -> eint_fltcon1 );
796
+ pr_debug ("%s: save mask %#010x\n" ,
797
+ bank -> name , save -> eint_mask );
798
+ } else if (bank -> eint_type == EINT_TYPE_WKUP ) {
799
+ exynos_set_wakeup (bank );
800
+ }
795
801
}
796
802
797
- void exynos_pinctrl_suspend (struct samsung_pin_bank * bank )
803
+ void exynosautov920_pinctrl_suspend (struct samsung_pin_bank * bank )
798
804
{
799
- struct exynos_irq_chip * irq_chip = NULL ;
805
+ struct exynos_eint_gpio_save * save = bank -> soc_priv ;
806
+ const void __iomem * regs = bank -> eint_base ;
800
807
801
808
if (bank -> eint_type == EINT_TYPE_GPIO ) {
802
- if (bank -> eint_con_offset )
803
- exynosauto_pinctrl_suspend_bank (bank );
804
- else
805
- exynos_pinctrl_suspend_bank (bank );
809
+ save -> eint_con = readl (regs + bank -> pctl_offset +
810
+ bank -> eint_con_offset );
811
+ save -> eint_mask = readl (regs + bank -> pctl_offset +
812
+ bank -> eint_mask_offset );
813
+ pr_debug ("%s: save con %#010x\n" ,
814
+ bank -> name , save -> eint_con );
815
+ pr_debug ("%s: save mask %#010x\n" ,
816
+ bank -> name , save -> eint_mask );
806
817
} else if (bank -> eint_type == EINT_TYPE_WKUP ) {
807
- if (!irq_chip ) {
808
- irq_chip = bank -> irq_chip ;
809
- irq_chip -> set_eint_wakeup_mask (bank -> drvdata , irq_chip );
810
- }
818
+ exynos_set_wakeup (bank );
811
819
}
812
820
}
813
821
814
- static void exynos_pinctrl_resume_bank (struct samsung_pin_bank * bank )
822
+ void exynos_pinctrl_resume (struct samsung_pin_bank * bank )
815
823
{
816
824
struct exynos_eint_gpio_save * save = bank -> soc_priv ;
817
825
void __iomem * regs = bank -> eint_base ;
818
826
819
- pr_debug ("%s: con %#010x => %#010x\n" , bank -> name ,
820
- readl (regs + EXYNOS_GPIO_ECON_OFFSET
821
- + bank -> eint_offset ), save -> eint_con );
822
- pr_debug ("%s: fltcon0 %#010x => %#010x\n" , bank -> name ,
823
- readl (regs + EXYNOS_GPIO_EFLTCON_OFFSET
824
- + 2 * bank -> eint_offset ), save -> eint_fltcon0 );
825
- pr_debug ("%s: fltcon1 %#010x => %#010x\n" , bank -> name ,
826
- readl (regs + EXYNOS_GPIO_EFLTCON_OFFSET
827
- + 2 * bank -> eint_offset + 4 ), save -> eint_fltcon1 );
828
- pr_debug ("%s: mask %#010x => %#010x\n" , bank -> name ,
829
- readl (regs + bank -> irq_chip -> eint_mask
830
- + bank -> eint_offset ), save -> eint_mask );
831
-
832
- writel (save -> eint_con , regs + EXYNOS_GPIO_ECON_OFFSET
833
- + bank -> eint_offset );
834
- writel (save -> eint_fltcon0 , regs + EXYNOS_GPIO_EFLTCON_OFFSET
835
- + 2 * bank -> eint_offset );
836
- writel (save -> eint_fltcon1 , regs + EXYNOS_GPIO_EFLTCON_OFFSET
837
- + 2 * bank -> eint_offset + 4 );
838
- writel (save -> eint_mask , regs + bank -> irq_chip -> eint_mask
839
- + bank -> eint_offset );
827
+ if (bank -> eint_type == EINT_TYPE_GPIO ) {
828
+ pr_debug ("%s: con %#010x => %#010x\n" , bank -> name ,
829
+ readl (regs + EXYNOS_GPIO_ECON_OFFSET
830
+ + bank -> eint_offset ), save -> eint_con );
831
+ pr_debug ("%s: fltcon0 %#010x => %#010x\n" , bank -> name ,
832
+ readl (regs + EXYNOS_GPIO_EFLTCON_OFFSET
833
+ + 2 * bank -> eint_offset ), save -> eint_fltcon0 );
834
+ pr_debug ("%s: fltcon1 %#010x => %#010x\n" , bank -> name ,
835
+ readl (regs + EXYNOS_GPIO_EFLTCON_OFFSET
836
+ + 2 * bank -> eint_offset + 4 ),
837
+ save -> eint_fltcon1 );
838
+ pr_debug ("%s: mask %#010x => %#010x\n" , bank -> name ,
839
+ readl (regs + bank -> irq_chip -> eint_mask
840
+ + bank -> eint_offset ), save -> eint_mask );
841
+
842
+ writel (save -> eint_con , regs + EXYNOS_GPIO_ECON_OFFSET
843
+ + bank -> eint_offset );
844
+ writel (save -> eint_fltcon0 , regs + EXYNOS_GPIO_EFLTCON_OFFSET
845
+ + 2 * bank -> eint_offset );
846
+ writel (save -> eint_fltcon1 , regs + EXYNOS_GPIO_EFLTCON_OFFSET
847
+ + 2 * bank -> eint_offset + 4 );
848
+ writel (save -> eint_mask , regs + bank -> irq_chip -> eint_mask
849
+ + bank -> eint_offset );
850
+ }
840
851
}
841
852
842
- static void exynosauto_pinctrl_resume_bank (struct samsung_pin_bank * bank )
853
+ void exynosautov920_pinctrl_resume (struct samsung_pin_bank * bank )
843
854
{
844
855
struct exynos_eint_gpio_save * save = bank -> soc_priv ;
845
856
void __iomem * regs = bank -> eint_base ;
846
857
847
- pr_debug ("%s: con %#010x => %#010x\n" , bank -> name ,
848
- readl (regs + bank -> pctl_offset + bank -> eint_con_offset ), save -> eint_con );
849
- pr_debug ("%s: mask %#010x => %#010x\n" , bank -> name ,
850
- readl (regs + bank -> pctl_offset + bank -> eint_mask_offset ), save -> eint_mask );
851
-
852
- writel (save -> eint_con , regs + bank -> pctl_offset + bank -> eint_con_offset );
853
- writel (save -> eint_mask , regs + bank -> pctl_offset + bank -> eint_mask_offset );
854
-
855
- }
856
-
857
- void exynos_pinctrl_resume (struct samsung_pin_bank * bank )
858
- {
859
858
if (bank -> eint_type == EINT_TYPE_GPIO ) {
860
- if (bank -> eint_con_offset )
861
- exynosauto_pinctrl_resume_bank (bank );
862
- else
863
- exynos_pinctrl_resume_bank (bank );
859
+ /* exynosautov920 has eint_con_offset for all but one bank */
860
+ if (!bank -> eint_con_offset )
861
+ exynos_pinctrl_resume (bank );
862
+
863
+ pr_debug ("%s: con %#010x => %#010x\n" , bank -> name ,
864
+ readl (regs + bank -> pctl_offset + bank -> eint_con_offset ),
865
+ save -> eint_con );
866
+ pr_debug ("%s: mask %#010x => %#010x\n" , bank -> name ,
867
+ readl (regs + bank -> pctl_offset +
868
+ bank -> eint_mask_offset ), save -> eint_mask );
869
+
870
+ writel (save -> eint_con ,
871
+ regs + bank -> pctl_offset + bank -> eint_con_offset );
872
+ writel (save -> eint_mask ,
873
+ regs + bank -> pctl_offset + bank -> eint_mask_offset );
864
874
}
865
875
}
866
876
0 commit comments