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