5555
5656#define CONFIG_PMU BIT(4)
5757
58- static int dove_pmu_mpp_ctrl_get (struct mvebu_mpp_ctrl * ctrl ,
59- unsigned long * config )
58+ static int dove_pmu_mpp_ctrl_get (unsigned pid , unsigned long * config )
6059{
61- unsigned off = (ctrl -> pid / MPPS_PER_REG ) * MPP_BITS ;
62- unsigned shift = (ctrl -> pid % MPPS_PER_REG ) * MPP_BITS ;
60+ unsigned off = (pid / MPPS_PER_REG ) * MPP_BITS ;
61+ unsigned shift = (pid % MPPS_PER_REG ) * MPP_BITS ;
6362 unsigned long pmu = readl (DOVE_PMU_MPP_GENERAL_CTRL );
6463 unsigned long func ;
6564
66- if (pmu & (1 << ctrl -> pid )) {
65+ if (pmu & (1 << pid )) {
6766 func = readl (DOVE_PMU_SIGNAL_SELECT_0 + off );
6867 * config = (func >> shift ) & MPP_MASK ;
6968 * config |= CONFIG_PMU ;
@@ -74,22 +73,21 @@ static int dove_pmu_mpp_ctrl_get(struct mvebu_mpp_ctrl *ctrl,
7473 return 0 ;
7574}
7675
77- static int dove_pmu_mpp_ctrl_set (struct mvebu_mpp_ctrl * ctrl ,
78- unsigned long config )
76+ static int dove_pmu_mpp_ctrl_set (unsigned pid , unsigned long config )
7977{
80- unsigned off = (ctrl -> pid / MPPS_PER_REG ) * MPP_BITS ;
81- unsigned shift = (ctrl -> pid % MPPS_PER_REG ) * MPP_BITS ;
78+ unsigned off = (pid / MPPS_PER_REG ) * MPP_BITS ;
79+ unsigned shift = (pid % MPPS_PER_REG ) * MPP_BITS ;
8280 unsigned long pmu = readl (DOVE_PMU_MPP_GENERAL_CTRL );
8381 unsigned long func ;
8482
8583 if (config & CONFIG_PMU ) {
86- writel (pmu | (1 << ctrl -> pid ), DOVE_PMU_MPP_GENERAL_CTRL );
84+ writel (pmu | (1 << pid ), DOVE_PMU_MPP_GENERAL_CTRL );
8785 func = readl (DOVE_PMU_SIGNAL_SELECT_0 + off );
8886 func &= ~(MPP_MASK << shift );
8987 func |= (config & MPP_MASK ) << shift ;
9088 writel (func , DOVE_PMU_SIGNAL_SELECT_0 + off );
9189 } else {
92- writel (pmu & ~(1 << ctrl -> pid ), DOVE_PMU_MPP_GENERAL_CTRL );
90+ writel (pmu & ~(1 << pid ), DOVE_PMU_MPP_GENERAL_CTRL );
9391 func = readl (DOVE_MPP_VIRT_BASE + off );
9492 func &= ~(MPP_MASK << shift );
9593 func |= (config & MPP_MASK ) << shift ;
@@ -98,13 +96,12 @@ static int dove_pmu_mpp_ctrl_set(struct mvebu_mpp_ctrl *ctrl,
9896 return 0 ;
9997}
10098
101- static int dove_mpp4_ctrl_get (struct mvebu_mpp_ctrl * ctrl ,
102- unsigned long * config )
99+ static int dove_mpp4_ctrl_get (unsigned pid , unsigned long * config )
103100{
104101 unsigned long mpp4 = readl (DOVE_MPP_CTRL4_VIRT_BASE );
105102 unsigned long mask ;
106103
107- switch (ctrl -> pid ) {
104+ switch (pid ) {
108105 case 24 : /* mpp_camera */
109106 mask = DOVE_CAM_GPIO_SEL ;
110107 break ;
@@ -129,13 +126,12 @@ static int dove_mpp4_ctrl_get(struct mvebu_mpp_ctrl *ctrl,
129126 return 0 ;
130127}
131128
132- static int dove_mpp4_ctrl_set (struct mvebu_mpp_ctrl * ctrl ,
133- unsigned long config )
129+ static int dove_mpp4_ctrl_set (unsigned pid , unsigned long config )
134130{
135131 unsigned long mpp4 = readl (DOVE_MPP_CTRL4_VIRT_BASE );
136132 unsigned long mask ;
137133
138- switch (ctrl -> pid ) {
134+ switch (pid ) {
139135 case 24 : /* mpp_camera */
140136 mask = DOVE_CAM_GPIO_SEL ;
141137 break ;
@@ -164,8 +160,7 @@ static int dove_mpp4_ctrl_set(struct mvebu_mpp_ctrl *ctrl,
164160 return 0 ;
165161}
166162
167- static int dove_nand_ctrl_get (struct mvebu_mpp_ctrl * ctrl ,
168- unsigned long * config )
163+ static int dove_nand_ctrl_get (unsigned pid , unsigned long * config )
169164{
170165 unsigned long gmpp = readl (DOVE_MPP_GENERAL_VIRT_BASE );
171166
@@ -174,8 +169,7 @@ static int dove_nand_ctrl_get(struct mvebu_mpp_ctrl *ctrl,
174169 return 0 ;
175170}
176171
177- static int dove_nand_ctrl_set (struct mvebu_mpp_ctrl * ctrl ,
178- unsigned long config )
172+ static int dove_nand_ctrl_set (unsigned pid , unsigned long config )
179173{
180174 unsigned long gmpp = readl (DOVE_MPP_GENERAL_VIRT_BASE );
181175
@@ -188,8 +182,7 @@ static int dove_nand_ctrl_set(struct mvebu_mpp_ctrl *ctrl,
188182 return 0 ;
189183}
190184
191- static int dove_audio0_ctrl_get (struct mvebu_mpp_ctrl * ctrl ,
192- unsigned long * config )
185+ static int dove_audio0_ctrl_get (unsigned pid , unsigned long * config )
193186{
194187 unsigned long pmu = readl (DOVE_PMU_MPP_GENERAL_CTRL );
195188
@@ -198,8 +191,7 @@ static int dove_audio0_ctrl_get(struct mvebu_mpp_ctrl *ctrl,
198191 return 0 ;
199192}
200193
201- static int dove_audio0_ctrl_set (struct mvebu_mpp_ctrl * ctrl ,
202- unsigned long config )
194+ static int dove_audio0_ctrl_set (unsigned pid , unsigned long config )
203195{
204196 unsigned long pmu = readl (DOVE_PMU_MPP_GENERAL_CTRL );
205197
@@ -211,8 +203,7 @@ static int dove_audio0_ctrl_set(struct mvebu_mpp_ctrl *ctrl,
211203 return 0 ;
212204}
213205
214- static int dove_audio1_ctrl_get (struct mvebu_mpp_ctrl * ctrl ,
215- unsigned long * config )
206+ static int dove_audio1_ctrl_get (unsigned pid , unsigned long * config )
216207{
217208 unsigned long mpp4 = readl (DOVE_MPP_CTRL4_VIRT_BASE );
218209 unsigned long sspc1 = readl (DOVE_SSP_CTRL_STATUS_1 );
@@ -238,8 +229,7 @@ static int dove_audio1_ctrl_get(struct mvebu_mpp_ctrl *ctrl,
238229 return 0 ;
239230}
240231
241- static int dove_audio1_ctrl_set (struct mvebu_mpp_ctrl * ctrl ,
242- unsigned long config )
232+ static int dove_audio1_ctrl_set (unsigned pid , unsigned long config )
243233{
244234 unsigned long mpp4 = readl (DOVE_MPP_CTRL4_VIRT_BASE );
245235 unsigned long sspc1 = readl (DOVE_SSP_CTRL_STATUS_1 );
@@ -276,11 +266,11 @@ static int dove_audio1_ctrl_set(struct mvebu_mpp_ctrl *ctrl,
276266 * break other functions. If you require all mpps as gpio
277267 * enforce gpio setting by pinctrl mapping.
278268 */
279- static int dove_audio1_ctrl_gpio_req (struct mvebu_mpp_ctrl * ctrl , u8 pid )
269+ static int dove_audio1_ctrl_gpio_req (unsigned pid )
280270{
281271 unsigned long config ;
282272
283- dove_audio1_ctrl_get (ctrl , & config );
273+ dove_audio1_ctrl_get (pid , & config );
284274
285275 switch (config ) {
286276 case 0x02 : /* i2s1 : gpio[56:57] */
@@ -303,16 +293,14 @@ static int dove_audio1_ctrl_gpio_req(struct mvebu_mpp_ctrl *ctrl, u8 pid)
303293}
304294
305295/* mpp[52:57] has gpio pins capable of in and out */
306- static int dove_audio1_ctrl_gpio_dir (struct mvebu_mpp_ctrl * ctrl , u8 pid ,
307- bool input )
296+ static int dove_audio1_ctrl_gpio_dir (unsigned pid , bool input )
308297{
309298 if (pid < 52 || pid > 57 )
310299 return - ENOTSUPP ;
311300 return 0 ;
312301}
313302
314- static int dove_twsi_ctrl_get (struct mvebu_mpp_ctrl * ctrl ,
315- unsigned long * config )
303+ static int dove_twsi_ctrl_get (unsigned pid , unsigned long * config )
316304{
317305 unsigned long gcfg1 = readl (DOVE_GLOBAL_CONFIG_1 );
318306 unsigned long gcfg2 = readl (DOVE_GLOBAL_CONFIG_2 );
@@ -328,8 +316,7 @@ static int dove_twsi_ctrl_get(struct mvebu_mpp_ctrl *ctrl,
328316 return 0 ;
329317}
330318
331- static int dove_twsi_ctrl_set (struct mvebu_mpp_ctrl * ctrl ,
332- unsigned long config )
319+ static int dove_twsi_ctrl_set (unsigned pid , unsigned long config )
333320{
334321 unsigned long gcfg1 = readl (DOVE_GLOBAL_CONFIG_1 );
335322 unsigned long gcfg2 = readl (DOVE_GLOBAL_CONFIG_2 );
0 commit comments