ramips: add support for PandoraBox PBR-M1
[15.05/openwrt.git] / target / linux / brcm2708 / patches-3.18 / 0080-I2C-Only-register-the-I2C-device-for-the-current-boa.patch
1 From 6a63fb6bd7120af9a760fa0f2db9461bfcf29791 Mon Sep 17 00:00:00 2001
2 From: Serge Schneider <serge@raspberrypi.org>
3 Date: Wed, 3 Sep 2014 14:44:22 +0100
4 Subject: [PATCH 080/114] I2C: Only register the I2C device for the current
5  board revision
6
7 ---
8  arch/arm/mach-bcm2708/bcm2708.c | 14 ++++++++++++--
9  1 file changed, 12 insertions(+), 2 deletions(-)
10
11 --- a/arch/arm/mach-bcm2708/bcm2708.c
12 +++ b/arch/arm/mach-bcm2708/bcm2708.c
13 @@ -93,6 +93,7 @@ static unsigned disk_led_active_low = 1;
14  static unsigned reboot_part = 0;
15  static unsigned w1_gpio_pin = W1_GPIO;
16  static unsigned w1_gpio_pullup = W1_PULLUP;
17 +static bool vc_i2c_override = false;
18  
19  static unsigned use_dt = 0;
20  
21 @@ -862,8 +863,15 @@ void __init bcm2708_init(void)
22         bcm_register_device(&bcm2835_thermal_device);
23  
24         bcm_register_device_dt(&bcm2708_spi_device);
25 -       bcm_register_device_dt(&bcm2708_bsc0_device);
26 -       bcm_register_device_dt(&bcm2708_bsc1_device);
27 +
28 +       if (vc_i2c_override) {
29 +               bcm_register_device_dt(&bcm2708_bsc0_device);
30 +               bcm_register_device_dt(&bcm2708_bsc1_device);
31 +       } else if ((boardrev & 0xffffff) == 0x2 || (boardrev & 0xffffff) == 0x3) {
32 +               bcm_register_device_dt(&bcm2708_bsc0_device);
33 +       } else {
34 +               bcm_register_device_dt(&bcm2708_bsc1_device);
35 +       }
36  
37  #if defined(CONFIG_SND_BCM2708_SOC_I2S) || defined(CONFIG_SND_BCM2708_SOC_I2S_MODULE)
38         bcm_register_device_dt(&bcm2708_i2s_device);
39 @@ -1093,3 +1101,5 @@ module_param(disk_led_active_low, uint,
40  module_param(reboot_part, uint, 0644);
41  module_param(w1_gpio_pin, uint, 0644);
42  module_param(w1_gpio_pullup, uint, 0644);
43 +module_param(vc_i2c_override, bool, 0644);
44 +MODULE_PARM_DESC(vc_i2c_override, "Allow the use of VC's I2C peripheral.");