ar71xx/sysmocom: register i2c bus + devices
This commit is contained in:
parent
1755472d2e
commit
607bcc2386
|
@ -10,6 +10,10 @@
|
||||||
|
|
||||||
#include <asm/mach-ath79/ath79.h>
|
#include <asm/mach-ath79/ath79.h>
|
||||||
#include <asm/mach-ath79/ar71xx_regs.h>
|
#include <asm/mach-ath79/ar71xx_regs.h>
|
||||||
|
#include <linux/i2c.h>
|
||||||
|
#include <linux/i2c-algo-bit.h>
|
||||||
|
#include <linux/i2c-gpio.h>
|
||||||
|
#include <linux/platform_device.h>
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
#include "dev-eth.h"
|
#include "dev-eth.h"
|
||||||
#include "dev-gpio-buttons.h"
|
#include "dev-gpio-buttons.h"
|
||||||
|
@ -24,6 +28,12 @@
|
||||||
#define SYSMOCOM_GPIO_LED_ETH0 13
|
#define SYSMOCOM_GPIO_LED_ETH0 13
|
||||||
#define SYSMOCOM_GPIO_LED_PSE 15
|
#define SYSMOCOM_GPIO_LED_PSE 15
|
||||||
|
|
||||||
|
#define SYSMOCOM_SOB_AP1_GPIO_I2C_SDA 18
|
||||||
|
#define SYSMOCOM_SOB_AP1_GPIO_I2C_SCL 19
|
||||||
|
|
||||||
|
#define SYSMOCOM_SOB_AP2_GPIO_I2C_SDA 26
|
||||||
|
#define SYSMOCOM_SOB_AP2_GPIO_I2C_SCL 27
|
||||||
|
|
||||||
#define SYSMOCOM_MAC0_OFFSET 0x0000
|
#define SYSMOCOM_MAC0_OFFSET 0x0000
|
||||||
#define SYSMOCOM_MAC1_OFFSET 0x0006
|
#define SYSMOCOM_MAC1_OFFSET 0x0006
|
||||||
#define SYSMOCOM_CALDATA_OFFSET 0x1000
|
#define SYSMOCOM_CALDATA_OFFSET 0x1000
|
||||||
|
@ -65,6 +75,43 @@ static struct gpio_led sysmocom_sob_jb02_leds_gpio[] __initdata = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static struct i2c_gpio_platform_data sob_ap1_i2c_gpio_data = {
|
||||||
|
.sda_pin = SYSMOCOM_SOB_AP1_GPIO_I2C_SDA,
|
||||||
|
.scl_pin = SYSMOCOM_SOB_AP1_GPIO_I2C_SCL,
|
||||||
|
.udelay = 20,
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct i2c_gpio_platform_data sob_ap2_i2c_gpio_data = {
|
||||||
|
.sda_pin = SYSMOCOM_SOB_AP2_GPIO_I2C_SDA,
|
||||||
|
.scl_pin = SYSMOCOM_SOB_AP2_GPIO_I2C_SCL,
|
||||||
|
.udelay = 20,
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct platform_device sob_ap1_i2c_gpio_device = {
|
||||||
|
.name = "i2c-gpio",
|
||||||
|
.id = 0,
|
||||||
|
.dev = {
|
||||||
|
.platform_data = &sob_ap1_i2c_gpio_data,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct platform_device sob_ap2_i2c_gpio_device = {
|
||||||
|
.name = "i2c-gpio",
|
||||||
|
.id = 0,
|
||||||
|
.dev = {
|
||||||
|
.platform_data = &sob_ap2_i2c_gpio_data,
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
static struct i2c_board_info sob_ap_i2c_devs[] __initdata = {
|
||||||
|
{
|
||||||
|
I2C_BOARD_INFO("apds9300", 0x29),
|
||||||
|
}, {
|
||||||
|
I2C_BOARD_INFO("lm75b", 0x48),
|
||||||
|
}, {
|
||||||
|
I2C_BOARD_INFO("24c00", 0x50),
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
static void __init sysmocom_common_setup(void)
|
static void __init sysmocom_common_setup(void)
|
||||||
{
|
{
|
||||||
|
@ -94,6 +141,10 @@ static void __init sysmocom_sob_ap1_setup(void)
|
||||||
ath79_register_leds_gpio(-1, ARRAY_SIZE(sysmocom_sob_ap1_leds_gpio),
|
ath79_register_leds_gpio(-1, ARRAY_SIZE(sysmocom_sob_ap1_leds_gpio),
|
||||||
sysmocom_sob_ap1_leds_gpio);
|
sysmocom_sob_ap1_leds_gpio);
|
||||||
ath79_register_usb();
|
ath79_register_usb();
|
||||||
|
|
||||||
|
platform_device_register(&sob_ap1_i2c_gpio_device);
|
||||||
|
i2c_register_board_info(0, sob_ap_i2c_devs,
|
||||||
|
ARRAY_SIZE(sob_ap_i2c_devs));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __init sysmocom_sob_ap2_setup(void)
|
static void __init sysmocom_sob_ap2_setup(void)
|
||||||
|
@ -127,6 +178,9 @@ static void __init sysmocom_sob_ap2_setup(void)
|
||||||
ath79_reset_rr(AR933X_RESET_REG_BOOTSTRAP) |
|
ath79_reset_rr(AR933X_RESET_REG_BOOTSTRAP) |
|
||||||
AR933X_BOOTSTRAP_MDIO_GPIO_EN);
|
AR933X_BOOTSTRAP_MDIO_GPIO_EN);
|
||||||
|
|
||||||
|
platform_device_register(&sob_ap2_i2c_gpio_device);
|
||||||
|
i2c_register_board_info(0, sob_ap_i2c_devs,
|
||||||
|
ARRAY_SIZE(sob_ap_i2c_devs));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void __init sysmocom_sob_jb02_setup(void)
|
static void __init sysmocom_sob_jb02_setup(void)
|
||||||
|
|
Loading…
Reference in New Issue