File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -97,16 +97,17 @@ struct bcm2708_i2c {
97
97
*
98
98
* FIXME: This is a hack. Use pinmux / pinctrl.
99
99
*/
100
- static void bcm2708_i2c_init_pinmode (void )
100
+ static void bcm2708_i2c_init_pinmode (int id )
101
101
{
102
102
#define INP_GPIO (g ) *(gpio+((g)/10)) &= ~(7<<(((g)%10)*3))
103
103
#define SET_GPIO_ALT (g ,a ) *(gpio+(((g)/10))) |= (((a)<=3?(a)+4:(a)==4?3:2)<<(((g)%10)*3))
104
104
105
105
int pin ;
106
106
u32 * gpio = ioremap (0x20200000 , SZ_16K );
107
107
108
+ BUG_ON (id != 0 && id != 1 );
108
109
/* BSC0 is on GPIO 0 & 1, BSC1 is on GPIO 2 & 3 */
109
- for (pin = 0 ; pin <= 3 ; pin ++ ) {
110
+ for (pin = id * 2 + 0 ; pin <= id * 2 + 1 ; pin ++ ) {
110
111
INP_GPIO (pin ); /* set mode to GPIO input first */
111
112
SET_GPIO_ALT (pin , 0 ); /* set mode to ALT 0 */
112
113
}
@@ -279,7 +280,7 @@ static int __devinit bcm2708_i2c_probe(struct platform_device *pdev)
279
280
return PTR_ERR (clk );
280
281
}
281
282
282
- bcm2708_i2c_init_pinmode ();
283
+ bcm2708_i2c_init_pinmode (pdev -> id );
283
284
284
285
bi = kzalloc (sizeof (* bi ), GFP_KERNEL );
285
286
if (!bi )
You can’t perform that action at this time.
0 commit comments