mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
Build i2c_gpio module and add a device tree overlay to configure it.
This commit is contained in:
committed by
popcornmix
parent
9499c67a83
commit
f557945d13
@@ -25,6 +25,7 @@ dtb-$(RPI_DT_OVERLAYS) += hifiberry-digi-overlay.dtb
|
||||
dtb-$(RPI_DT_OVERLAYS) += hy28a-overlay.dtb
|
||||
dtb-$(RPI_DT_OVERLAYS) += hy28b-overlay.dtb
|
||||
dtb-$(RPI_DT_OVERLAYS) += i2c-rtc-overlay.dtb
|
||||
dtb-$(RPI_DT_OVERLAYS) += i2c-gpio-overlay.dtb
|
||||
dtb-$(RPI_DT_OVERLAYS) += i2s-mmap-overlay.dtb
|
||||
dtb-$(RPI_DT_OVERLAYS) += iqaudio-dac-overlay.dtb
|
||||
dtb-$(RPI_DT_OVERLAYS) += iqaudio-dacplus-overlay.dtb
|
||||
|
||||
@@ -284,6 +284,17 @@ Params: speed Display SPI bus speed
|
||||
ledgpio GPIO used to control backlight
|
||||
|
||||
|
||||
Name: i2c-gpio
|
||||
Info: Adds support for software i2c controller on gpio pins
|
||||
Load: dtoverlay=i2c-gpio,<param>
|
||||
Params: i2c_gpio_sda GPIO used for I2C data (default "23")
|
||||
|
||||
i2c_gpio_scl GPIO used for I2C clock (default "24")
|
||||
|
||||
i2c_gpio_delay_us Clock delay in microseconds
|
||||
(default "2" = ~100kHz)
|
||||
|
||||
|
||||
Name: i2c-rtc
|
||||
Info: Adds support for a number of I2C Real Time Clock devices
|
||||
Load: dtoverlay=i2c-rtc,<param>
|
||||
|
||||
28
arch/arm/boot/dts/overlays/i2c-gpio-overlay.dts
Normal file
28
arch/arm/boot/dts/overlays/i2c-gpio-overlay.dts
Normal file
@@ -0,0 +1,28 @@
|
||||
// Overlay for i2c_gpio bitbanging host bus.
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2708";
|
||||
|
||||
fragment@0 {
|
||||
target-path = "/";
|
||||
__overlay__ {
|
||||
i2c_gpio: i2c@0 {
|
||||
compatible = "i2c-gpio";
|
||||
gpios = <&gpio 23 0 /* sda */
|
||||
&gpio 24 0 /* scl */
|
||||
>;
|
||||
i2c-gpio,delay-us = <2>; /* ~100 kHz */
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
};
|
||||
};
|
||||
};
|
||||
__overrides__ {
|
||||
i2c_gpio_sda = <&i2c_gpio>,"gpios:4";
|
||||
i2c_gpio_scl = <&i2c_gpio>,"gpios:16";
|
||||
i2c_gpio_delay_us = <&i2c_gpio>,"i2c-gpio,delay-us:0";
|
||||
};
|
||||
};
|
||||
|
||||
@@ -595,6 +595,7 @@ CONFIG_RAW_DRIVER=y
|
||||
CONFIG_I2C=y
|
||||
CONFIG_I2C_CHARDEV=m
|
||||
CONFIG_I2C_BCM2708=m
|
||||
CONFIG_I2C_GPIO=m
|
||||
CONFIG_SPI=y
|
||||
CONFIG_SPI_BCM2835=m
|
||||
CONFIG_SPI_BCM2708=m
|
||||
|
||||
@@ -588,6 +588,7 @@ CONFIG_RAW_DRIVER=y
|
||||
CONFIG_I2C=y
|
||||
CONFIG_I2C_CHARDEV=m
|
||||
CONFIG_I2C_BCM2708=m
|
||||
CONFIG_I2C_GPIO=m
|
||||
CONFIG_SPI=y
|
||||
CONFIG_SPI_BCM2835=m
|
||||
CONFIG_SPI_BCM2708=m
|
||||
|
||||
Reference in New Issue
Block a user