grove/lcd: add an option to specify I2C master

Add an option to specify to which I2C master the Grove LCD
is connected, instead of already using the i2c_dw driver
port #0.

Change-Id: I4e61ef8e31c75ae912e2d16f8939369c0b8bbc2c
Signed-off-by: Daniel Leung <daniel.leung@intel.com>
This commit is contained in:
Daniel Leung 2015-12-15 16:13:47 -08:00 committed by Anas Nashif
commit b90cb66afd
2 changed files with 10 additions and 1 deletions

View file

@ -39,6 +39,14 @@ config GROVE_LCD_RGB
Setting this value will enable driver support for the Groove-LCD RGB
Backlight.
config GROVE_LCD_RGB_I2C_MASTER_DEV_NAME
string "I2C Master where Grove LCD is connected"
depends on GROVE_LCD_RGB
default "I2C0"
help
Specify the device name of the I2C master device to which the
Grove LCD is connected.
config GROVE_LCD_RGB_INIT_PRIORITY
int
prompt "Init priority"

View file

@ -281,7 +281,8 @@ int glcd_initialize(struct device *port)
* First set up the device driver...
* we need a pointer to the I2C device we are bound to
*/
dev->i2c = device_get_binding(CONFIG_I2C_DW_0_NAME);
dev->i2c = device_get_binding(
CONFIG_GROVE_LCD_RGB_I2C_MASTER_DEV_NAME);
if (!dev->i2c) {
return DEV_NOT_CONFIG;