Openwrt/target/linux/brcm2708/patches-4.4/0231-RPi-config-Add-CONFIG_PWM_PCA9685-for-NXP-PCA9685-dr.patch
Álvaro Fernández Rojas 525b311bf8 brcm2708: update linux 4.4 patches to latest version
As usual these patches were extracted from the raspberry pi repo:
https://github.com/raspberrypi/linux/tree/rpi-4.4.y

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2016-04-24 13:03:39 +02:00

93 lines
2.8 KiB
Diff

From 6273867fcddb010a62be4d1d5dcba124b1661681 Mon Sep 17 00:00:00 2001
From: Dave Stevenson <6by9@users.noreply.github.com>
Date: Fri, 1 Apr 2016 15:28:46 +0100
Subject: [PATCH 231/304] RPi config: Add CONFIG_PWM_PCA9685 for NXP PCA9685
driver over I2C
Includes DT overlay to configure it.
Signed-off-by: Dave Stevenson <6by9@users.noreply.github.com>
---
arch/arm/boot/dts/overlays/Makefile | 1 +
arch/arm/boot/dts/overlays/README | 6 +++++
.../boot/dts/overlays/i2c-pwm-pca9685a-overlay.dts | 26 ++++++++++++++++++++++
arch/arm/configs/bcm2709_defconfig | 1 +
arch/arm/configs/bcmrpi_defconfig | 1 +
5 files changed, 35 insertions(+)
create mode 100644 arch/arm/boot/dts/overlays/i2c-pwm-pca9685a-overlay.dts
--- a/arch/arm/boot/dts/overlays/Makefile
+++ b/arch/arm/boot/dts/overlays/Makefile
@@ -30,6 +30,7 @@ dtbo-$(RPI_DT_OVERLAYS) += hy28b.dtbo
dtbo-$(RPI_DT_OVERLAYS) += i2c-rtc.dtbo
dtbo-$(RPI_DT_OVERLAYS) += i2c-gpio.dtbo
dtbo-$(RPI_DT_OVERLAYS) += i2c-mux-pca9548a.dtbo
+dtbo-$(RPI_DT_OVERLAYS) += i2c-pwm-pca9685a.dtbo
dtbo-$(RPI_DT_OVERLAYS) += i2c0-bcm2708.dtbo
dtbo-$(RPI_DT_OVERLAYS) += i2c1-bcm2708.dtbo
dtbo-$(RPI_DT_OVERLAYS) += i2s-mmap.dtbo
--- a/arch/arm/boot/dts/overlays/README
+++ b/arch/arm/boot/dts/overlays/README
@@ -366,6 +366,12 @@ Load: dtoverlay=i2c-mux-pca9548a,<para
Params: addr I2C address of PCA9548A (default 0x70)
+Name: i2c-pwm-pca9685a
+Info: Adds support for an NXP PCA9685A I2C PWM controller on i2c_arm
+Load: dtoverlay=i2c-pwm-pca9685a,<param>=<val>
+Params: addr I2C address of PCA9685A (default 0x40)
+
+
Name: i2c-rtc
Info: Adds support for a number of I2C Real Time Clock devices
Load: dtoverlay=i2c-rtc,<param>=<val>
--- /dev/null
+++ b/arch/arm/boot/dts/overlays/i2c-pwm-pca9685a-overlay.dts
@@ -0,0 +1,26 @@
+// Definitions for NXP PCA9685A I2C PWM controller on ARM I2C bus.
+/dts-v1/;
+/plugin/;
+
+/{
+ compatible = "brcm,bcm2708";
+
+ fragment@0 {
+ target = <&i2c_arm>;
+ __overlay__ {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "okay";
+
+ pca: pca@40 {
+ compatible = "nxp,pca9685";
+ #pwm-cells = <2>;
+ reg = <0x40>;
+ status = "okay";
+ };
+ };
+ };
+ __overrides__ {
+ addr = <&pca>,"reg:0";
+ };
+};
--- a/arch/arm/configs/bcm2709_defconfig
+++ b/arch/arm/configs/bcm2709_defconfig
@@ -1122,6 +1122,7 @@ CONFIG_MCP320X=m
CONFIG_MCP3422=m
CONFIG_DHT11=m
CONFIG_PWM_BCM2835=m
+CONFIG_PWM_PCA9685=m
CONFIG_RASPBERRYPI_FIRMWARE=y
CONFIG_EXT4_FS=y
CONFIG_EXT4_FS_POSIX_ACL=y
--- a/arch/arm/configs/bcmrpi_defconfig
+++ b/arch/arm/configs/bcmrpi_defconfig
@@ -1129,6 +1129,7 @@ CONFIG_MCP320X=m
CONFIG_MCP3422=m
CONFIG_DHT11=m
CONFIG_PWM_BCM2835=m
+CONFIG_PWM_PCA9685=m
CONFIG_RASPBERRYPI_FIRMWARE=y
CONFIG_EXT4_FS=y
CONFIG_EXT4_FS_POSIX_ACL=y