提交 fd9b5d3b 编写于 作者: D Dave Stevenson 提交者: Zheng Zengkai

dt: Add a camera regulator node to all downstream Pi platforms

raspberrypi inclusion
category: feature
bugzilla: 50432

--------------------------------

The current firmware fixup of camera sensor overlays is not
particularly nice, and it stops you being able to load them
dynamically.
It's also incompatible with creating a simple DT that can be
loaded for both CAM1 and CAM0 on a CM as they would both
try to claim the one GPIO.

Almost all sensors have a hook of some form for a regulator, so
it's relatively straightforward to convert them all to use a
fixed regulator with GPIO control.

Add a fixed regulator node for each platform with the GPIO
correctly configured for the camera shutdown line. (The LED line
is ignored).
Signed-off-by: NDave Stevenson <dave.stevenson@raspberrypi.com>
Signed-off-by: NFang Yafen <yafen@iscas.ac.cn>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 bfd3db04
......@@ -5,6 +5,7 @@
#include "bcm283x-rpi-smsc9514.dtsi"
#include "bcm283x-rpi-csi1-2lane.dtsi"
#include "bcm283x-rpi-i2c0mux_0_28.dtsi"
#include "bcm283x-rpi-cam1-regulator.dtsi"
/ {
compatible = "raspberrypi,model-b-plus", "brcm,bcm2835";
......@@ -111,6 +112,10 @@
pinctrl-0 = <&audio_pins>;
};
&cam1_reg {
gpio = <&gpio 41 GPIO_ACTIVE_HIGH>;
};
/ {
__overrides__ {
act_led_gpio = <&act_led>,"gpios:4";
......
......@@ -4,6 +4,7 @@
#include "bcm2708-rpi.dtsi"
#include "bcm283x-rpi-smsc9512.dtsi"
#include "bcm283x-rpi-csi1-2lane.dtsi"
#include "bcm283x-rpi-cam1-regulator.dtsi"
/ {
compatible = "raspberrypi,model-b", "brcm,bcm2835";
......@@ -118,6 +119,10 @@ i2c_csi_dsi: &i2c1 {
pinctrl-0 = <&audio_pins>;
};
&cam1_reg {
gpio = <&gpio 27 GPIO_ACTIVE_HIGH>;
};
/ {
__overrides__ {
act_led_gpio = <&act_led>,"gpios:4";
......
......@@ -5,6 +5,7 @@
#include "bcm283x-rpi-smsc9512.dtsi"
#include "bcm283x-rpi-csi1-2lane.dtsi"
#include "bcm283x-rpi-i2c0mux_0_28.dtsi"
#include "bcm283x-rpi-cam1-regulator.dtsi"
/ {
compatible = "raspberrypi,model-b", "brcm,bcm2835";
......@@ -105,6 +106,10 @@
pinctrl-0 = <&audio_pins>;
};
&cam1_reg {
gpio = <&gpio 21 GPIO_ACTIVE_HIGH>;
};
/ {
__overrides__ {
act_led_gpio = <&act_led>,"gpios:4";
......
......@@ -8,6 +8,21 @@
/ {
compatible = "raspberrypi,compute-module", "brcm,bcm2835";
model = "Raspberry Pi Compute Module";
cam1_reg: cam1_reg {
compatible = "regulator-fixed";
regulator-name = "cam1-regulator";
gpio = <&gpio 2 GPIO_ACTIVE_HIGH>;
enable-active-high;
status = "disabled";
};
cam0_reg: cam0_reg {
compatible = "regulator-fixed";
regulator-name = "cam0-regulator";
gpio = <&gpio 30 GPIO_ACTIVE_HIGH>;
enable-active-high;
status = "disabled";
};
};
&uart0 {
......
......@@ -5,6 +5,7 @@
#include "bcm283x-rpi-csi1-2lane.dtsi"
#include "bcm283x-rpi-i2c0mux_0_28.dtsi"
#include "bcm2708-rpi-bt.dtsi"
#include "bcm283x-rpi-cam1-regulator.dtsi"
/ {
compatible = "raspberrypi,model-zero-w", "brcm,bcm2835";
......@@ -155,6 +156,10 @@
brcm,disable-headphones = <1>;
};
&cam1_reg {
gpio = <&gpio 44 GPIO_ACTIVE_HIGH>;
};
/ {
__overrides__ {
act_led_gpio = <&act_led>,"gpios:4";
......
......@@ -4,6 +4,7 @@
#include "bcm2708-rpi.dtsi"
#include "bcm283x-rpi-csi1-2lane.dtsi"
#include "bcm283x-rpi-i2c0mux_0_28.dtsi"
#include "bcm283x-rpi-cam1-regulator.dtsi"
/ {
compatible = "raspberrypi,model-zero", "brcm,bcm2835";
......@@ -109,6 +110,10 @@
brcm,disable-headphones = <1>;
};
&cam1_reg {
gpio = <&gpio 41 GPIO_ACTIVE_HIGH>;
};
/ {
__overrides__ {
act_led_gpio = <&act_led>,"gpios:4";
......
......@@ -5,6 +5,7 @@
#include "bcm283x-rpi-smsc9514.dtsi"
#include "bcm283x-rpi-csi1-2lane.dtsi"
#include "bcm283x-rpi-i2c0mux_0_28.dtsi"
#include "bcm283x-rpi-cam1-regulator.dtsi"
/ {
compatible = "raspberrypi,2-model-b", "brcm,bcm2836";
......@@ -111,6 +112,10 @@
pinctrl-0 = <&audio_pins>;
};
&cam1_reg {
gpio = <&gpio 41 GPIO_ACTIVE_HIGH>;
};
/ {
__overrides__ {
act_led_gpio = <&act_led>,"gpios:4";
......
......@@ -5,6 +5,7 @@
#include "bcm283x-rpi-smsc9514.dtsi"
#include "bcm283x-rpi-csi1-2lane.dtsi"
#include "bcm283x-rpi-i2c0mux_0_28.dtsi"
#include "bcm283x-rpi-cam1-regulator.dtsi"
/ {
compatible = "raspberrypi,2-model-b-rev2", "brcm,bcm2837";
......@@ -111,6 +112,10 @@
pinctrl-0 = <&audio_pins>;
};
&cam1_reg {
gpio = <&gpio 41 GPIO_ACTIVE_HIGH>;
};
/ {
__overrides__ {
act_led_gpio = <&act_led>,"gpios:4";
......
......@@ -6,6 +6,7 @@
#include "bcm283x-rpi-csi1-2lane.dtsi"
#include "bcm283x-rpi-i2c0mux_0_44.dtsi"
#include "bcm271x-rpi-bt.dtsi"
#include "bcm283x-rpi-cam1-regulator.dtsi"
/ {
compatible = "raspberrypi,3-model-b-plus", "brcm,bcm2837";
......@@ -176,6 +177,10 @@
microchip,downshift-after = <2>;
};
&cam1_reg {
gpio = <&expgpio 5 GPIO_ACTIVE_HIGH>;
};
/ {
__overrides__ {
act_led_gpio = <&act_led>,"gpios:4";
......
......@@ -6,6 +6,7 @@
#include "bcm283x-rpi-csi1-2lane.dtsi"
#include "bcm283x-rpi-i2c0mux_0_44.dtsi"
#include "bcm271x-rpi-bt.dtsi"
#include "bcm283x-rpi-cam1-regulator.dtsi"
/ {
compatible = "raspberrypi,3-model-b", "brcm,bcm2837";
......@@ -185,6 +186,10 @@
pinctrl-0 = <&audio_pins>;
};
&cam1_reg {
gpio = <&expgpio 5 GPIO_ACTIVE_HIGH>;
};
/ {
__overrides__ {
act_led_gpio = <&act_led>,"gpios:4";
......
......@@ -8,6 +8,21 @@
/ {
compatible = "raspberrypi,3-compute-module", "brcm,bcm2837";
model = "Raspberry Pi Compute Module 3";
cam1_reg: cam1_reg {
compatible = "regulator-fixed";
regulator-name = "cam1-regulator";
gpio = <&gpio 2 GPIO_ACTIVE_HIGH>;
enable-active-high;
status = "disabled";
};
cam0_reg: cam0_reg {
compatible = "regulator-fixed";
regulator-name = "cam0-regulator";
gpio = <&gpio 30 GPIO_ACTIVE_HIGH>;
enable-active-high;
status = "disabled";
};
};
&uart0 {
......
......@@ -319,6 +319,7 @@
#include "bcm2711-rpi.dtsi"
#include "bcm283x-rpi-csi1-2lane.dtsi"
#include "bcm283x-rpi-i2c0mux_0_44.dtsi"
#include "bcm283x-rpi-cam1-regulator.dtsi"
/ {
chosen {
......@@ -585,6 +586,10 @@
pinctrl-0 = <&audio_pins>;
};
&cam1_reg {
gpio = <&expgpio 5 GPIO_ACTIVE_HIGH>;
};
/ {
__overrides__ {
act_led_gpio = <&act_led>,"gpios:4";
......
......@@ -327,6 +327,14 @@
};
/delete-node/ wifi-pwrseq;
cam0_reg: cam1_reg: cam1_reg {
compatible = "regulator-fixed";
regulator-name = "cam1-reg";
gpio = <&expgpio 5 GPIO_ACTIVE_HIGH>;
enable-active-high;
status = "disabled";
};
};
&mmcnr {
......
// SPDX-License-Identifier: GPL-2.0
/ {
cam1_reg: cam1_reg {
compatible = "regulator-fixed";
regulator-name = "cam1-reg";
enable-active-high;
status = "disabled";
};
};
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册