-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drivers: i2c: Add dts support for i2c slaves.
Adding i2c slave requires overlay with node definitions and proper aliases depending on driver implementation. Modified i2c_slave_api test to use information from dts. Signed-off-by: Mieszko Mierunski <[email protected]>
- Loading branch information
Mieszko Mierunski
committed
Sep 24, 2018
1 parent
a7ddb1f
commit de228ec
Showing
8 changed files
with
114 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# | ||
# Copyright (c) 2018, Nordic Semiconductor | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
--- | ||
title: Virtual I2C slave eeprom | ||
id: i2c,eeprom | ||
version: 0.1 | ||
|
||
description: > | ||
This binding gives a base representation of I2C slave eeprom | ||
inherits: | ||
!include i2c-device.yaml | ||
|
||
properties: | ||
compatible: | ||
constraint: "i2c,eeprom" | ||
size: | ||
type: int | ||
category: required | ||
description: I2C Slave EEPROM Size in KiB | ||
generation: define | ||
|
||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
CONFIG_I2C_STM32_V2=y | ||
CONFIG_I2C_STM32_INTERRUPT=y | ||
CONFIG_I2C_1=y | ||
CONFIG_I2C_EEPROM_SLAVE_0_CONTROLLER_DEV_NAME="I2C_1" | ||
CONFIG_I2C_2=y | ||
CONFIG_I2C_EEPROM_SLAVE_1_CONTROLLER_DEV_NAME="I2C_2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
CONFIG_I2C_STM32_V2=y | ||
CONFIG_I2C_STM32_INTERRUPT=y | ||
CONFIG_I2C_1=y | ||
CONFIG_I2C_EEPROM_SLAVE_0_CONTROLLER_DEV_NAME="I2C_1" | ||
CONFIG_I2C_2=y | ||
CONFIG_I2C_EEPROM_SLAVE_1_CONTROLLER_DEV_NAME="I2C_2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/ { | ||
aliases { | ||
eeprom-slave-0 = &ep_0; | ||
eeprom-slave-1 = &ep_1; | ||
}; | ||
}; | ||
|
||
&i2c1 { | ||
ep_0: eeprom@54 { | ||
compatible = "i2c,eeprom"; | ||
reg = <0x54>; | ||
label = "EEPROM_SLAVE_0"; | ||
size = <1>; | ||
}; | ||
}; | ||
|
||
|
||
&i2c2 { | ||
ep_1: eeprom@56 { | ||
compatible = "i2c,eeprom"; | ||
reg = <0x56>; | ||
label = "EEPROM_SLAVE_1"; | ||
size = <1>; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/ { | ||
aliases { | ||
eeprom-slave-0 = &ep_0; | ||
eeprom-slave-1 = &ep_1; | ||
}; | ||
}; | ||
|
||
&i2c1 { | ||
ep_0: eeprom@54 { | ||
compatible = "i2c,eeprom"; | ||
reg = <0x54>; | ||
label = "EEPROM_SLAVE_0"; | ||
size = <1>; | ||
}; | ||
}; | ||
|
||
|
||
&i2c2 { | ||
ep_1: eeprom@56 { | ||
compatible = "i2c,eeprom"; | ||
reg = <0x56>; | ||
label = "EEPROM_SLAVE_1"; | ||
size = <1>; | ||
}; | ||
}; |