0050-pinctrl-mediatek-data-struct-optimize-and-remove-unu.patch 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. From 3eeb897a627e26083472f14e7512f53276a5e7ce Mon Sep 17 00:00:00 2001
  2. From: Yingjoe Chen <[email protected]>
  3. Date: Mon, 18 May 2015 23:11:14 -0700
  4. Subject: [PATCH 50/76] pinctrl: mediatek: data struct optimize and remove
  5. unused member
  6. struct mtk_desc_pin.chip, mtk_pinctrl_devdata.invser_offset
  7. and mtk_pinctrl_devdata.chip_type are never used in code.
  8. Remove them.
  9. Some per-pin data are using int for pin number and offsets.
  10. Change to short and rearrange to reduce const data size.
  11. Signed-off-by: Yingjoe Chen <[email protected]>
  12. Signed-off-by: Hongzhou Yang <[email protected]>
  13. ---
  14. drivers/pinctrl/mediatek/pinctrl-mt8135.c | 10 ++++------
  15. drivers/pinctrl/mediatek/pinctrl-mtk-common.h | 10 ++--------
  16. 2 files changed, 6 insertions(+), 14 deletions(-)
  17. diff --git a/drivers/pinctrl/mediatek/pinctrl-mt8135.c b/drivers/pinctrl/mediatek/pinctrl-mt8135.c
  18. index f1e1e18..8e6abd5 100644
  19. --- a/drivers/pinctrl/mediatek/pinctrl-mt8135.c
  20. +++ b/drivers/pinctrl/mediatek/pinctrl-mt8135.c
  21. @@ -32,12 +32,12 @@
  22. #define R1_BASE2 0x250
  23. struct mtk_spec_pull_set {
  24. - unsigned int pin;
  25. - unsigned int pupd_offset;
  26. + unsigned char pin;
  27. unsigned char pupd_bit;
  28. - unsigned int r0_offset;
  29. + unsigned short pupd_offset;
  30. + unsigned short r0_offset;
  31. + unsigned short r1_offset;
  32. unsigned char r0_bit;
  33. - unsigned int r1_offset;
  34. unsigned char r1_bit;
  35. };
  36. @@ -305,7 +305,6 @@ static const struct mtk_pinctrl_devdata mt8135_pinctrl_data = {
  37. .pullen_offset = 0x0200,
  38. .smt_offset = 0x0300,
  39. .pullsel_offset = 0x0400,
  40. - .invser_offset = 0x0600,
  41. .dout_offset = 0x0800,
  42. .din_offset = 0x0A00,
  43. .pinmux_offset = 0x0C00,
  44. @@ -314,7 +313,6 @@ static const struct mtk_pinctrl_devdata mt8135_pinctrl_data = {
  45. .port_shf = 4,
  46. .port_mask = 0xf,
  47. .port_align = 4,
  48. - .chip_type = MTK_CHIP_TYPE_BASE,
  49. .eint_offsets = {
  50. .name = "mt8135_eint",
  51. .stat = 0x000,
  52. diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.h b/drivers/pinctrl/mediatek/pinctrl-mtk-common.h
  53. index 375771d..1508849 100644
  54. --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.h
  55. +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.h
  56. @@ -19,8 +19,6 @@
  57. #include <linux/regmap.h>
  58. #define NO_EINT_SUPPORT 255
  59. -#define MTK_CHIP_TYPE_BASE 0
  60. -#define MTK_CHIP_TYPE_PMIC 1
  61. #define MT_EDGE_SENSITIVE 0
  62. #define MT_LEVEL_SENSITIVE 1
  63. #define EINT_DBNC_SET_DBNC_BITS 4
  64. @@ -39,7 +37,6 @@ struct mtk_desc_eint {
  65. struct mtk_desc_pin {
  66. struct pinctrl_pin_desc pin;
  67. - const char *chip;
  68. const struct mtk_desc_eint eint;
  69. const struct mtk_desc_function *functions;
  70. };
  71. @@ -47,7 +44,6 @@ struct mtk_desc_pin {
  72. #define MTK_PIN(_pin, _pad, _chip, _eint, ...) \
  73. { \
  74. .pin = _pin, \
  75. - .chip = _chip, \
  76. .eint = _eint, \
  77. .functions = (struct mtk_desc_function[]){ \
  78. __VA_ARGS__, { } }, \
  79. @@ -107,8 +103,8 @@ struct mtk_drv_group_desc {
  80. * @grp: The group for this pin belongs to.
  81. */
  82. struct mtk_pin_drv_grp {
  83. - unsigned int pin;
  84. - unsigned int offset;
  85. + unsigned short pin;
  86. + unsigned short offset;
  87. unsigned char bit;
  88. unsigned char grp;
  89. };
  90. @@ -193,7 +189,6 @@ struct mtk_pinctrl_devdata {
  91. unsigned int pullen_offset;
  92. unsigned int pullsel_offset;
  93. unsigned int drv_offset;
  94. - unsigned int invser_offset;
  95. unsigned int dout_offset;
  96. unsigned int din_offset;
  97. unsigned int pinmux_offset;
  98. @@ -202,7 +197,6 @@ struct mtk_pinctrl_devdata {
  99. unsigned char port_shf;
  100. unsigned char port_mask;
  101. unsigned char port_align;
  102. - unsigned char chip_type;
  103. struct mtk_eint_offsets eint_offsets;
  104. unsigned int ap_num;
  105. unsigned int db_cnt;
  106. --
  107. 1.7.10.4