Commit 91910f80 authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

posix: configurable i2c bus

parent 7c52c7ea
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -12,6 +12,11 @@ config arch_posix_driver_i2c
bool "I2C via /dev/i2c"
select meta_driver_i2c

config arch_posix_driver_i2c_bus
string "I2C bus (/dev/i2c-* device)"
default "/dev/i2c-1"
depends on arch_posix_driver_i2c

config arch_posix_driver_uptime
bool "Uptime counter"
select meta_driver_uptime
+4 −1
Original line number Diff line number Diff line
@@ -13,6 +13,9 @@
#include <linux/i2c-dev.h>
#include <i2c/smbus.h>

#define STRINGIFY(x) #x
#define TOSTRING(x) STRINGIFY(x)
#define I2C_BUS TOSTRING(CONFIG_arch_posix_driver_i2c_bus)

signed char I2C::setup()
{
@@ -57,4 +60,4 @@ signed char I2C::xmit(unsigned char address,
	return 0;
}

I2C i2c("/dev/i2c-1");
I2C i2c(I2C_BUS);