summaryrefslogtreecommitdiff
path: root/arch/arm/mach-bcm2708
diff options
context:
space:
mode:
authorSerge Schneider <serge@raspberrypi.org>2014-09-03 14:44:22 +0100
committerpopcornmix <popcornmix@gmail.com>2015-05-18 14:11:32 +0100
commit1eee348208f0154e72113379af062498c7b92bc0 (patch)
tree687342ab61c6d7de4590ec27e8f0d4ba5842cd93 /arch/arm/mach-bcm2708
parent4b28c08f946a818dd9d7772a0f7bfdcdba6203e1 (diff)
downloadlinux-1eee348208f0154e72113379af062498c7b92bc0.tar.gz
I2C: Only register the I2C device for the current board revision
Diffstat (limited to 'arch/arm/mach-bcm2708')
-rw-r--r--arch/arm/mach-bcm2708/bcm2708.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/arch/arm/mach-bcm2708/bcm2708.c b/arch/arm/mach-bcm2708/bcm2708.c
index cc3e56ccdc09..c8aea5bd22fd 100644
--- a/arch/arm/mach-bcm2708/bcm2708.c
+++ b/arch/arm/mach-bcm2708/bcm2708.c
@@ -95,6 +95,7 @@ static unsigned reboot_part = 0;
static unsigned w1_gpio_pin = W1_GPIO;
static unsigned w1_gpio_pullup = W1_PULLUP;
static int pps_gpio_pin = -1;
+static bool vc_i2c_override = false;
static unsigned use_dt = 0;
@@ -890,8 +891,15 @@ void __init bcm2708_init(void)
bcm_register_device(&bcm2708_alsa_devices[i]);
bcm_register_device_dt(&bcm2708_spi_device);
- bcm_register_device_dt(&bcm2708_bsc0_device);
- bcm_register_device_dt(&bcm2708_bsc1_device);
+
+ if (vc_i2c_override) {
+ bcm_register_device_dt(&bcm2708_bsc0_device);
+ bcm_register_device_dt(&bcm2708_bsc1_device);
+ } else if ((boardrev & 0xffffff) == 0x2 || (boardrev & 0xffffff) == 0x3) {
+ bcm_register_device_dt(&bcm2708_bsc0_device);
+ } else {
+ bcm_register_device_dt(&bcm2708_bsc1_device);
+ }
bcm_register_device(&bcm2835_hwmon_device);
bcm_register_device(&bcm2835_thermal_device);
@@ -1126,3 +1134,5 @@ module_param(w1_gpio_pin, uint, 0644);
module_param(w1_gpio_pullup, uint, 0644);
module_param(pps_gpio_pin, int, 0644);
MODULE_PARM_DESC(pps_gpio_pin, "Set GPIO pin to reserve for PPS");
+module_param(vc_i2c_override, bool, 0644);
+MODULE_PARM_DESC(vc_i2c_override, "Allow the use of VC's I2C peripheral.");