mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
Compare commits
21 Commits
raspberryp
...
raspberryp
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f2f7e4b23d | ||
|
|
8ae5f3e1ec | ||
|
|
237e899fed | ||
|
|
33115317f0 | ||
|
|
42a52f1a2a | ||
|
|
5790594366 | ||
|
|
5e1be66754 | ||
|
|
068c6b23e9 | ||
|
|
1baaf03127 | ||
|
|
7bbf6b4eee | ||
|
|
472be8a851 | ||
|
|
8db1715b59 | ||
|
|
aac47fd9e0 | ||
|
|
f0eeafb5d9 | ||
|
|
8a0c16cb89 | ||
|
|
0fe13a5838 | ||
|
|
d10760af02 | ||
|
|
deca5e6cfa | ||
|
|
c4aa56bb29 | ||
|
|
1c64f4bc22 | ||
|
|
9d49ae69a1 |
@@ -102,6 +102,14 @@
|
||||
};
|
||||
};
|
||||
|
||||
&uart0 {
|
||||
skip-init;
|
||||
};
|
||||
|
||||
&uart1 {
|
||||
skip-init;
|
||||
};
|
||||
|
||||
&txp {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
clocks = <&clk_108MHz>;
|
||||
#clock-cells = <1>;
|
||||
#reset-cells = <1>;
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
hdmi0: hdmi@7ef00700 {
|
||||
@@ -193,8 +194,7 @@
|
||||
<0x0 0x40000000 0x0 0xff800000 0x0 0x00800000>,
|
||||
<0x6 0x00000000 0x6 0x00000000 0x0 0x40000000>,
|
||||
<0x0 0x00000000 0x0 0x00000000 0x0 0xfc000000>;
|
||||
dma-ranges = <0x0 0x00000000 0x0 0x00000000 0x0 0xfc000000>,
|
||||
<0x1 0x00000000 0x1 0x00000000 0x1 0x00000000>;
|
||||
dma-ranges = <0x0 0x00000000 0x0 0x00000000 0x4 0x00000000>;
|
||||
|
||||
dma40: dma@7e007b00 {
|
||||
compatible = "brcm,bcm2711-dma";
|
||||
|
||||
@@ -98,6 +98,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
|
||||
justboom-digi.dtbo \
|
||||
ltc294x.dtbo \
|
||||
max98357a.dtbo \
|
||||
maxtherm.dtbo \
|
||||
mbed-dac.dtbo \
|
||||
mcp23017.dtbo \
|
||||
mcp23s17.dtbo \
|
||||
@@ -159,7 +160,6 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
|
||||
spi-gpio40-45.dtbo \
|
||||
spi-rtc.dtbo \
|
||||
spi0-cs.dtbo \
|
||||
spi0-hw-cs.dtbo \
|
||||
spi1-1cs.dtbo \
|
||||
spi1-2cs.dtbo \
|
||||
spi1-3cs.dtbo \
|
||||
|
||||
@@ -1622,6 +1622,36 @@ Params: no-sdmode Driver does not manage the state of the DAC's
|
||||
of the DAC (default GPIO4 if parameter omitted).
|
||||
|
||||
|
||||
Name: maxtherm
|
||||
Info: Configure a MAX6675 or MAX31855 thermocouple as an IIO device.
|
||||
|
||||
For devices on spi1 or spi2, the interfaces should be enabled
|
||||
with one of the spi1-1/2/3cs and/or spi2-1/2/3cs overlays.
|
||||
The overlay expects to disable the relevant spidev node, so also using
|
||||
e.g. cs0_spidev=off is unnecessary.
|
||||
|
||||
Note: with the 5.7 kernel (and later) there will also be
|
||||
overlays for MAX31855E, MAX31855J, MAX31855K,
|
||||
MAX31885N, MAX31855R, MAX31855S and MAX31855T.
|
||||
|
||||
Example:
|
||||
MAX31855 on /dev/spidev0.0
|
||||
dtoverlay=maxtherm,spi0-0,max31855
|
||||
|
||||
Load: dtoverlay=maxtherm,<param>=<val>
|
||||
Params: spi<n>-<m> Configure device at spi<n>, cs<m>
|
||||
(boolean, required)
|
||||
max6675 Enable support for the MAX6675 (default)
|
||||
max31855 Enable support for the MAX31855
|
||||
max31855e Enable support for the MAX31855E
|
||||
max31855j Enable support for the MAX31855J
|
||||
max31855k Enable support for the MAX31855K
|
||||
max31855n Enable support for the MAX31855N
|
||||
max31855r Enable support for the MAX31855R
|
||||
max31855s Enable support for the MAX31855S
|
||||
max31855t Enable support for the MAX31855T
|
||||
|
||||
|
||||
Name: mbed-dac
|
||||
Info: Configures the mbed AudioCODEC (TLV320AIC23B)
|
||||
Load: dtoverlay=mbed-dac
|
||||
@@ -2346,9 +2376,9 @@ Params: cs0_pin GPIO pin for CS0 (default 8)
|
||||
|
||||
|
||||
Name: spi0-hw-cs
|
||||
Info: Re-enables hardware CS/CE (chip selects) for SPI0
|
||||
Load: dtoverlay=spi0-hw-cs
|
||||
Params: <None>
|
||||
Info: This overlay has been deprecated and removed because it is no longer
|
||||
necessary and has been seen to prevent spi0 from working.
|
||||
Load: <Deprecated>
|
||||
|
||||
|
||||
Name: spi1-1cs
|
||||
|
||||
@@ -45,6 +45,13 @@
|
||||
gpios = <&gpio 7 0>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
iio-hwmon {
|
||||
compatible = "iio-hwmon";
|
||||
status = "okay";
|
||||
io-channels = <&tla2024 4>, <&tla2024 5>, <&tla2024 6>,
|
||||
<&tla2024 7>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -91,6 +98,7 @@
|
||||
reg = <0x48>;
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
#io-channel-cells = <1>;
|
||||
|
||||
adc_ch4: channel@4 {
|
||||
reg = <4>;
|
||||
|
||||
166
arch/arm/boot/dts/overlays/maxtherm-overlay.dts
Normal file
166
arch/arm/boot/dts/overlays/maxtherm-overlay.dts
Normal file
@@ -0,0 +1,166 @@
|
||||
/*
|
||||
* Universal device tree overlay for SPI devices
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2835";
|
||||
|
||||
fragment@0 {
|
||||
target = <&spidev0>;
|
||||
__dormant__ {
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
|
||||
fragment@1 {
|
||||
target = <&spidev1>;
|
||||
__dormant__ {
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
|
||||
fragment@2 {
|
||||
target-path = "spi1/spidev@0";
|
||||
__dormant__ {
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
|
||||
fragment@3 {
|
||||
target-path = "spi1/spidev@1";
|
||||
__dormant__ {
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
|
||||
fragment@4 {
|
||||
target-path = "spi1/spidev@2";
|
||||
__dormant__ {
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
|
||||
fragment@5 {
|
||||
target-path = "spi2/spidev@0";
|
||||
__dormant__ {
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
|
||||
fragment@6 {
|
||||
target-path = "spi2/spidev@1";
|
||||
__dormant__ {
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
|
||||
fragment@7 {
|
||||
target-path = "spi2/spidev@2";
|
||||
__dormant__ {
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
|
||||
maxfrag: fragment@8 {
|
||||
target = <&spi0>;
|
||||
__overlay__ {
|
||||
status = "okay";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
|
||||
max: maxtherm@0 {
|
||||
compatible = "maxim,max6675";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <500000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fragment@9 {
|
||||
target = <&max>;
|
||||
__dormant__ {
|
||||
compatible = "maxim,max31855e", "maxim,max31855";
|
||||
};
|
||||
};
|
||||
|
||||
fragment@10 {
|
||||
target = <&max>;
|
||||
__dormant__ {
|
||||
compatible = "maxim,max31855j", "maxim,max31855";
|
||||
};
|
||||
};
|
||||
|
||||
fragment@11 {
|
||||
target = <&max>;
|
||||
__dormant__ {
|
||||
compatible = "maxim,max31855k", "maxim,max31855";
|
||||
};
|
||||
};
|
||||
|
||||
fragment@12 {
|
||||
target = <&max>;
|
||||
__dormant__ {
|
||||
compatible = "maxim,max31855n", "maxim,max31855";
|
||||
};
|
||||
};
|
||||
|
||||
fragment@13 {
|
||||
target = <&max>;
|
||||
__dormant__ {
|
||||
compatible = "maxim,max31855r", "maxim,max31855";
|
||||
};
|
||||
};
|
||||
|
||||
fragment@14 {
|
||||
target = <&max>;
|
||||
__dormant__ {
|
||||
compatible = "maxim,max31855s", "maxim,max31855";
|
||||
};
|
||||
};
|
||||
|
||||
fragment@15 {
|
||||
target = <&max>;
|
||||
__dormant__ {
|
||||
compatible = "maxim,max31855t", "maxim,max31855";
|
||||
};
|
||||
};
|
||||
|
||||
__overrides__ {
|
||||
spi0-0 = <0>, "+0",
|
||||
<&maxfrag>,"target:0=",<&spi0>,
|
||||
<&max>,"reg:0=0";
|
||||
spi0-1 = <0>, "+1",
|
||||
<&maxfrag>,"target:0=",<&spi0>,
|
||||
<&max>,"reg:0=1";
|
||||
spi1-0 = <0>, "+2",
|
||||
<&maxfrag>,"target:0=",<&spi1>,
|
||||
<&max>,"reg:0=0";
|
||||
spi1-1 = <0>, "+3",
|
||||
<&maxfrag>,"target:0=",<&spi1>,
|
||||
<&max>,"reg:0=1";
|
||||
spi1-2 = <0>, "+4",
|
||||
<&maxfrag>,"target:0=",<&spi1>,
|
||||
<&max>,"reg:0=2";
|
||||
spi2-0 = <0>, "+5",
|
||||
<&maxfrag>,"target:0=",<&spi2>,
|
||||
<&max>,"reg:0=0";
|
||||
spi2-1 = <0>, "+6",
|
||||
<&maxfrag>,"target:0=",<&spi2>,
|
||||
<&max>,"reg:0=1";
|
||||
spi2-2 = <0>, "+7",
|
||||
<&maxfrag>,"target:0=",<&spi2>,
|
||||
<&max>,"reg:0=2";
|
||||
max6675 = <&max>,"compatible=maxim,max6675";
|
||||
max31855 = <&max>,"compatible=maxim,max31855";
|
||||
max31855e = <0>,"+9";
|
||||
max31855j = <0>,"+10";
|
||||
max31855k = <0>,"+11";
|
||||
max31855n = <0>,"+12";
|
||||
max31855r = <0>,"+13";
|
||||
max31855s = <0>,"+14";
|
||||
max31855t = <0>,"+15";
|
||||
};
|
||||
};
|
||||
@@ -61,6 +61,10 @@
|
||||
deprecated = "use sdio,bus_width=1,gpios_22_25";
|
||||
};
|
||||
|
||||
spi0-hw-cs {
|
||||
deprecated = "no longer necessary";
|
||||
};
|
||||
|
||||
spi3-1cs {
|
||||
bcm2711;
|
||||
};
|
||||
|
||||
@@ -13,26 +13,31 @@
|
||||
|
||||
sc16is750: sc16is750@48 {
|
||||
compatible = "nxp,sc16is750";
|
||||
reg = <0x48>; /* address */
|
||||
reg = <0x48>; /* i2c address */
|
||||
clocks = <&sc16is750_clk>;
|
||||
interrupt-parent = <&gpio>;
|
||||
interrupts = <24 2>; /* IRQ_TYPE_EDGE_FALLING */
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
|
||||
sc16is750_clk: sc16is750_clk {
|
||||
compatible = "fixed-clock";
|
||||
#clock-cells = <0>;
|
||||
clock-frequency = <14745600>;
|
||||
};
|
||||
i2c-max-frequency = <400000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
fragment@1 {
|
||||
target-path = "/";
|
||||
__overlay__ {
|
||||
sc16is750_clk: sc16is750_i2c_clk@48 {
|
||||
compatible = "fixed-clock";
|
||||
#clock-cells = <0>;
|
||||
clock-frequency = <14745600>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
__overrides__ {
|
||||
int_pin = <&sc16is750>,"interrupts:0";
|
||||
addr = <&sc16is750>,"reg:0",<&sc16is750_clk>,"name";
|
||||
addr = <&sc16is750>,"reg:0", <&sc16is750_clk>,"name";
|
||||
xtal = <&sc16is750_clk>,"clock-frequency:0";
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
@@ -5,29 +5,32 @@
|
||||
compatible = "brcm,bcm2835";
|
||||
|
||||
fragment@0 {
|
||||
target = <&i2c1>;
|
||||
|
||||
frag1: __overlay__ {
|
||||
target = <&i2c_arm>;
|
||||
__overlay__ {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
status = "okay";
|
||||
|
||||
sc16is752: sc16is752@48 {
|
||||
compatible = "nxp,sc16is752";
|
||||
reg = <0x48>; // i2c address
|
||||
reg = <0x48>; /* i2c address */
|
||||
clocks = <&sc16is752_clk>;
|
||||
interrupt-parent = <&gpio>;
|
||||
interrupts = <24 0x2>; /* IRQ_TYPE_EDGE_FALLING */
|
||||
interrupts = <24 2>; /* IRQ_TYPE_EDGE_FALLING */
|
||||
gpio-controller;
|
||||
#gpio-cells = <0>;
|
||||
#gpio-cells = <2>;
|
||||
i2c-max-frequency = <400000>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
sc16is752_clk: sc16is752_clk {
|
||||
compatible = "fixed-clock";
|
||||
#clock-cells = <0>;
|
||||
clock-frequency = <14745600>;
|
||||
};
|
||||
fragment@1 {
|
||||
target-path = "/";
|
||||
__overlay__ {
|
||||
sc16is752_clk: sc16is752_i2c_clk@48 {
|
||||
compatible = "fixed-clock";
|
||||
#clock-cells = <0>;
|
||||
clock-frequency = <14745600>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -17,15 +17,9 @@
|
||||
clocks = <&sc16is752_clk>;
|
||||
interrupt-parent = <&gpio>;
|
||||
interrupts = <24 2>; /* IRQ_TYPE_EDGE_FALLING */
|
||||
#gpio-controller;
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
spi-max-frequency = <4000000>;
|
||||
|
||||
sc16is752_clk: sc16is752_clk {
|
||||
compatible = "fixed-clock";
|
||||
#clock-cells = <0>;
|
||||
clock-frequency = <14745600>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -37,8 +31,19 @@
|
||||
};
|
||||
};
|
||||
|
||||
fragment@2 {
|
||||
target-path = "/";
|
||||
__overlay__ {
|
||||
sc16is752_clk: sc16is752_spi0_0_clk {
|
||||
compatible = "fixed-clock";
|
||||
#clock-cells = <0>;
|
||||
clock-frequency = <14745600>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
__overrides__ {
|
||||
int_pin = <&sc16is752>,"interrupts:0";
|
||||
xtal = <&sc16is752_clk>, "clock-frequency:0";
|
||||
xtal = <&sc16is752_clk>,"clock-frequency:0";
|
||||
};
|
||||
};
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
fragment@1 {
|
||||
target = <&spi1>;
|
||||
frag1: __overlay__ {
|
||||
__overlay__ {
|
||||
#address-cells = <1>;
|
||||
#size-cells = <0>;
|
||||
pinctrl-names = "default";
|
||||
@@ -35,7 +35,7 @@
|
||||
clocks = <&sc16is752_clk>;
|
||||
interrupt-parent = <&gpio>;
|
||||
interrupts = <24 2>; /* IRQ_TYPE_EDGE_FALLING */
|
||||
#gpio-controller;
|
||||
gpio-controller;
|
||||
#gpio-cells = <2>;
|
||||
spi-max-frequency = <4000000>;
|
||||
};
|
||||
@@ -52,7 +52,7 @@
|
||||
fragment@3 {
|
||||
target-path = "/";
|
||||
__overlay__ {
|
||||
sc16is752_clk: sc16is752_spi1_clk {
|
||||
sc16is752_clk: sc16is752_spi1_0_clk {
|
||||
compatible = "fixed-clock";
|
||||
#clock-cells = <0>;
|
||||
clock-frequency = <14745600>;
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
/*
|
||||
* Device tree overlay to re-enable hardware CS for SPI0
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
/plugin/;
|
||||
|
||||
/ {
|
||||
compatible = "brcm,bcm2835";
|
||||
|
||||
fragment@0 {
|
||||
target = <&spi0>;
|
||||
__overlay__ {
|
||||
cs-gpios = <0>, <0>;
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
fragment@1 {
|
||||
target = <&spi0_cs_pins>;
|
||||
__overlay__ {
|
||||
brcm,pins = <8 7>;
|
||||
brcm,function = <4>; /* alt0 */
|
||||
};
|
||||
};
|
||||
};
|
||||
@@ -145,6 +145,13 @@
|
||||
};
|
||||
};
|
||||
|
||||
fragment@20 {
|
||||
target = <&dvp>;
|
||||
__overlay__ {
|
||||
status = "okay";
|
||||
};
|
||||
};
|
||||
|
||||
__overrides__ {
|
||||
audio = <0>,"!17";
|
||||
audio1 = <0>,"!18";
|
||||
|
||||
@@ -14,6 +14,8 @@ CONFIG_TASK_XACCT=y
|
||||
CONFIG_TASK_IO_ACCOUNTING=y
|
||||
CONFIG_IKCONFIG=m
|
||||
CONFIG_IKCONFIG_PROC=y
|
||||
CONFIG_MEMCG=y
|
||||
CONFIG_BLK_CGROUP=y
|
||||
CONFIG_CGROUP_PIDS=y
|
||||
CONFIG_CGROUP_FREEZER=y
|
||||
CONFIG_CPUSETS=y
|
||||
@@ -710,6 +712,7 @@ CONFIG_BATTERY_MAX17040=m
|
||||
CONFIG_BATTERY_GAUGE_LTC2941=m
|
||||
CONFIG_SENSORS_DS1621=m
|
||||
CONFIG_SENSORS_GPIO_FAN=m
|
||||
CONFIG_SENSORS_IIO_HWMON=m
|
||||
CONFIG_SENSORS_JC42=m
|
||||
CONFIG_SENSORS_LM75=m
|
||||
CONFIG_SENSORS_RASPBERRYPI_HWMON=m
|
||||
@@ -1319,6 +1322,7 @@ CONFIG_APDS9960=m
|
||||
CONFIG_TSL4531=m
|
||||
CONFIG_VEML6070=m
|
||||
CONFIG_BMP280=m
|
||||
CONFIG_MAXIM_THERMOCOUPLE=m
|
||||
CONFIG_PWM_BCM2835=m
|
||||
CONFIG_PWM_PCA9685=m
|
||||
CONFIG_RPI_AXIPERF=m
|
||||
@@ -1442,7 +1446,10 @@ CONFIG_CRYPTO_WP512=m
|
||||
CONFIG_CRYPTO_CAST5=m
|
||||
CONFIG_CRYPTO_DES=y
|
||||
CONFIG_CRYPTO_LZ4=m
|
||||
CONFIG_CRYPTO_USER_API_HASH=m
|
||||
CONFIG_CRYPTO_USER_API_SKCIPHER=m
|
||||
CONFIG_CRYPTO_USER_API_RNG=m
|
||||
CONFIG_CRYPTO_USER_API_AEAD=m
|
||||
# CONFIG_CRYPTO_HW is not set
|
||||
CONFIG_CRC_ITU_T=y
|
||||
CONFIG_LIBCRC32C=y
|
||||
|
||||
@@ -722,6 +722,7 @@ CONFIG_BATTERY_MAX17040=m
|
||||
CONFIG_BATTERY_GAUGE_LTC2941=m
|
||||
CONFIG_SENSORS_DS1621=m
|
||||
CONFIG_SENSORS_GPIO_FAN=m
|
||||
CONFIG_SENSORS_IIO_HWMON=m
|
||||
CONFIG_SENSORS_JC42=m
|
||||
CONFIG_SENSORS_LM75=m
|
||||
CONFIG_SENSORS_RASPBERRYPI_HWMON=m
|
||||
@@ -1357,6 +1358,7 @@ CONFIG_APDS9960=m
|
||||
CONFIG_TSL4531=m
|
||||
CONFIG_VEML6070=m
|
||||
CONFIG_BMP280=m
|
||||
CONFIG_MAXIM_THERMOCOUPLE=m
|
||||
CONFIG_PWM_BCM2835=m
|
||||
CONFIG_PWM_PCA9685=m
|
||||
CONFIG_GENERIC_PHY=y
|
||||
@@ -1481,7 +1483,10 @@ CONFIG_CRYPTO_WP512=m
|
||||
CONFIG_CRYPTO_CAST5=m
|
||||
CONFIG_CRYPTO_DES=y
|
||||
CONFIG_CRYPTO_LZ4=m
|
||||
CONFIG_CRYPTO_USER_API_HASH=m
|
||||
CONFIG_CRYPTO_USER_API_SKCIPHER=m
|
||||
CONFIG_CRYPTO_USER_API_RNG=m
|
||||
CONFIG_CRYPTO_USER_API_AEAD=m
|
||||
# CONFIG_CRYPTO_HW is not set
|
||||
CONFIG_CRC_ITU_T=y
|
||||
CONFIG_LIBCRC32C=y
|
||||
|
||||
@@ -13,6 +13,8 @@ CONFIG_TASK_XACCT=y
|
||||
CONFIG_TASK_IO_ACCOUNTING=y
|
||||
CONFIG_IKCONFIG=m
|
||||
CONFIG_IKCONFIG_PROC=y
|
||||
CONFIG_MEMCG=y
|
||||
CONFIG_BLK_CGROUP=y
|
||||
CONFIG_CGROUP_FREEZER=y
|
||||
CONFIG_CGROUP_DEVICE=y
|
||||
CONFIG_CGROUP_CPUACCT=y
|
||||
@@ -699,6 +701,7 @@ CONFIG_BATTERY_MAX17040=m
|
||||
CONFIG_BATTERY_GAUGE_LTC2941=m
|
||||
CONFIG_SENSORS_DS1621=m
|
||||
CONFIG_SENSORS_GPIO_FAN=m
|
||||
CONFIG_SENSORS_IIO_HWMON=m
|
||||
CONFIG_SENSORS_JC42=m
|
||||
CONFIG_SENSORS_LM75=m
|
||||
CONFIG_SENSORS_RASPBERRYPI_HWMON=m
|
||||
@@ -1325,6 +1328,7 @@ CONFIG_APDS9960=m
|
||||
CONFIG_TSL4531=m
|
||||
CONFIG_VEML6070=m
|
||||
CONFIG_BMP280=m
|
||||
CONFIG_MAXIM_THERMOCOUPLE=m
|
||||
CONFIG_PWM_BCM2835=m
|
||||
CONFIG_PWM_PCA9685=m
|
||||
CONFIG_RPI_AXIPERF=m
|
||||
@@ -1451,7 +1455,10 @@ CONFIG_CRYPTO_WP512=m
|
||||
CONFIG_CRYPTO_CAST5=m
|
||||
CONFIG_CRYPTO_DES=y
|
||||
CONFIG_CRYPTO_LZ4=m
|
||||
CONFIG_CRYPTO_USER_API_HASH=m
|
||||
CONFIG_CRYPTO_USER_API_SKCIPHER=m
|
||||
CONFIG_CRYPTO_USER_API_RNG=m
|
||||
CONFIG_CRYPTO_USER_API_AEAD=m
|
||||
# CONFIG_CRYPTO_HW is not set
|
||||
CONFIG_CRC_ITU_T=y
|
||||
CONFIG_LIBCRC32C=y
|
||||
|
||||
@@ -287,6 +287,8 @@ __v7_ca17mp_setup:
|
||||
mov r10, #0
|
||||
1: adr r0, __v7_setup_stack_ptr
|
||||
ldr r12, [r0]
|
||||
tst r12, #0x1f
|
||||
addeq r12, r12, #4
|
||||
add r12, r12, r0 @ the local stack
|
||||
stmia r12, {r1-r6, lr} @ v7_invalidate_l1 touches r0-r6
|
||||
bl v7_invalidate_l1
|
||||
@@ -474,6 +476,8 @@ __v7_setup:
|
||||
adr r0, __v7_setup_stack_ptr
|
||||
ldr r12, [r0]
|
||||
add r12, r12, r0 @ the local stack
|
||||
tst r12, #0x1f
|
||||
addeq r12, r12, #4
|
||||
stmia r12, {r1-r6, lr} @ v7_invalidate_l1 touches r0-r6
|
||||
bl v7_invalidate_l1
|
||||
ldmia r12, {r1-r6, lr}
|
||||
@@ -557,7 +561,7 @@ ENDPROC(__v7_setup)
|
||||
.bss
|
||||
.align 2
|
||||
__v7_setup_stack:
|
||||
.space 4 * 7 @ 7 registers
|
||||
.space 4 * 8 @ 7 registers + 1 spare
|
||||
|
||||
__INITDATA
|
||||
|
||||
|
||||
@@ -716,6 +716,7 @@ CONFIG_BATTERY_MAX17040=m
|
||||
CONFIG_BATTERY_GAUGE_LTC2941=m
|
||||
CONFIG_SENSORS_DS1621=m
|
||||
CONFIG_SENSORS_GPIO_FAN=m
|
||||
CONFIG_SENSORS_IIO_HWMON=m
|
||||
CONFIG_SENSORS_JC42=m
|
||||
CONFIG_SENSORS_LM75=m
|
||||
CONFIG_SENSORS_RASPBERRYPI_HWMON=m
|
||||
@@ -1349,6 +1350,7 @@ CONFIG_APDS9960=m
|
||||
CONFIG_TSL4531=m
|
||||
CONFIG_VEML6070=m
|
||||
CONFIG_BMP280=m
|
||||
CONFIG_MAXIM_THERMOCOUPLE=m
|
||||
CONFIG_PWM_BCM2835=m
|
||||
CONFIG_PWM_PCA9685=m
|
||||
CONFIG_GENERIC_PHY=y
|
||||
@@ -1473,7 +1475,10 @@ CONFIG_CRYPTO_WP512=m
|
||||
CONFIG_CRYPTO_CAST5=m
|
||||
CONFIG_CRYPTO_DES=y
|
||||
CONFIG_CRYPTO_LZ4=m
|
||||
CONFIG_CRYPTO_USER_API_HASH=m
|
||||
CONFIG_CRYPTO_USER_API_SKCIPHER=m
|
||||
CONFIG_CRYPTO_USER_API_RNG=m
|
||||
CONFIG_CRYPTO_USER_API_AEAD=m
|
||||
# CONFIG_CRYPTO_HW is not set
|
||||
CONFIG_CRC_ITU_T=y
|
||||
CONFIG_LIBCRC32C=y
|
||||
|
||||
@@ -13,6 +13,8 @@ CONFIG_TASK_XACCT=y
|
||||
CONFIG_TASK_IO_ACCOUNTING=y
|
||||
CONFIG_IKCONFIG=m
|
||||
CONFIG_IKCONFIG_PROC=y
|
||||
CONFIG_MEMCG=y
|
||||
CONFIG_BLK_CGROUP=y
|
||||
CONFIG_CGROUP_FREEZER=y
|
||||
CONFIG_CPUSETS=y
|
||||
CONFIG_CGROUP_DEVICE=y
|
||||
@@ -679,6 +681,7 @@ CONFIG_W1_SLAVE_DS28E17=m
|
||||
CONFIG_POWER_RESET_GPIO=y
|
||||
CONFIG_BATTERY_DS2760=m
|
||||
CONFIG_BATTERY_MAX17040=m
|
||||
CONFIG_SENSORS_IIO_HWMON=m
|
||||
CONFIG_SENSORS_LM75=m
|
||||
CONFIG_SENSORS_SHT21=m
|
||||
CONFIG_SENSORS_SHTC1=m
|
||||
@@ -1194,6 +1197,7 @@ CONFIG_BME680=m
|
||||
CONFIG_DHT11=m
|
||||
CONFIG_HTU21=m
|
||||
CONFIG_APDS9960=m
|
||||
CONFIG_MAXIM_THERMOCOUPLE=m
|
||||
CONFIG_PWM_BCM2835=m
|
||||
CONFIG_PWM_PCA9685=m
|
||||
CONFIG_EXT4_FS=y
|
||||
@@ -1316,7 +1320,10 @@ CONFIG_CRYPTO_WP512=m
|
||||
CONFIG_CRYPTO_CAST5=m
|
||||
CONFIG_CRYPTO_DES=y
|
||||
CONFIG_CRYPTO_LZ4=m
|
||||
CONFIG_CRYPTO_USER_API_HASH=m
|
||||
CONFIG_CRYPTO_USER_API_SKCIPHER=m
|
||||
CONFIG_CRYPTO_USER_API_RNG=m
|
||||
CONFIG_CRYPTO_USER_API_AEAD=m
|
||||
CONFIG_CRC_ITU_T=y
|
||||
CONFIG_LIBCRC32C=y
|
||||
CONFIG_DMA_CMA=y
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#define BCM2711_DMA_MEMCPY_CHAN 14
|
||||
|
||||
struct bcm2835_dma_cfg_data {
|
||||
u64 dma_mask;
|
||||
u32 chan_40bit_mask;
|
||||
};
|
||||
|
||||
@@ -302,10 +303,12 @@ DEFINE_SPINLOCK(memcpy_lock);
|
||||
|
||||
static const struct bcm2835_dma_cfg_data bcm2835_dma_cfg = {
|
||||
.chan_40bit_mask = 0,
|
||||
.dma_mask = DMA_BIT_MASK(32),
|
||||
};
|
||||
|
||||
static const struct bcm2835_dma_cfg_data bcm2711_dma_cfg = {
|
||||
.chan_40bit_mask = BIT(11) | BIT(12) | BIT(13) | BIT(14),
|
||||
.dma_mask = DMA_BIT_MASK(36),
|
||||
};
|
||||
|
||||
static inline size_t bcm2835_dma_max_frame_length(struct bcm2835_chan *c)
|
||||
@@ -1185,6 +1188,8 @@ static struct dma_chan *bcm2835_dma_xlate(struct of_phandle_args *spec,
|
||||
|
||||
static int bcm2835_dma_probe(struct platform_device *pdev)
|
||||
{
|
||||
const struct bcm2835_dma_cfg_data *cfg_data;
|
||||
const struct of_device_id *of_id;
|
||||
struct bcm2835_dmadev *od;
|
||||
struct resource *res;
|
||||
void __iomem *base;
|
||||
@@ -1194,13 +1199,20 @@ static int bcm2835_dma_probe(struct platform_device *pdev)
|
||||
int irq_flags;
|
||||
uint32_t chans_available;
|
||||
char chan_name[BCM2835_DMA_CHAN_NAME_SIZE];
|
||||
const struct of_device_id *of_id;
|
||||
int chan_count, chan_start, chan_end;
|
||||
|
||||
of_id = of_match_node(bcm2835_dma_of_match, pdev->dev.of_node);
|
||||
if (!of_id) {
|
||||
dev_err(&pdev->dev, "Failed to match compatible string\n");
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
cfg_data = of_id->data;
|
||||
|
||||
if (!pdev->dev.dma_mask)
|
||||
pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask;
|
||||
|
||||
rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
|
||||
rc = dma_set_mask_and_coherent(&pdev->dev, cfg_data->dma_mask);
|
||||
if (rc) {
|
||||
dev_err(&pdev->dev, "Unable to set DMA mask\n");
|
||||
return rc;
|
||||
@@ -1266,7 +1278,7 @@ static int bcm2835_dma_probe(struct platform_device *pdev)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
od->cfg_data = of_id->data;
|
||||
od->cfg_data = cfg_data;
|
||||
|
||||
/* Request DMA channel mask from device tree */
|
||||
if (of_property_read_u32(pdev->dev.of_node,
|
||||
|
||||
@@ -718,7 +718,6 @@ static bool vc4_fkms_format_mod_supported(struct drm_plane *plane,
|
||||
switch (modifier) {
|
||||
case DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED:
|
||||
case DRM_FORMAT_MOD_LINEAR:
|
||||
case DRM_FORMAT_MOD_BROADCOM_UIF:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
#include <sound/pcm_drm_eld.h>
|
||||
#include <sound/pcm_params.h>
|
||||
#include <sound/soc.h>
|
||||
#include <sound/tlv.h>
|
||||
#include "media/cec.h"
|
||||
#include "vc4_drv.h"
|
||||
#include "vc4_hdmi.h"
|
||||
@@ -82,6 +83,311 @@
|
||||
#define CEC_CLOCK_FREQ 40000
|
||||
#define VC4_HSM_CLOCK 163682864
|
||||
|
||||
#define HDMI_CODEC_CHMAP_IDX_UNKNOWN -1
|
||||
|
||||
/*
|
||||
* CEA speaker placement for HDMI 1.4:
|
||||
*
|
||||
* FL FLC FC FRC FR FRW
|
||||
*
|
||||
* LFE
|
||||
*
|
||||
* RL RLC RC RRC RR
|
||||
*
|
||||
* Speaker placement has to be extended to support HDMI 2.0
|
||||
*/
|
||||
enum hdmi_codec_cea_spk_placement {
|
||||
FL = BIT(0), /* Front Left */
|
||||
FC = BIT(1), /* Front Center */
|
||||
FR = BIT(2), /* Front Right */
|
||||
FLC = BIT(3), /* Front Left Center */
|
||||
FRC = BIT(4), /* Front Right Center */
|
||||
RL = BIT(5), /* Rear Left */
|
||||
RC = BIT(6), /* Rear Center */
|
||||
RR = BIT(7), /* Rear Right */
|
||||
RLC = BIT(8), /* Rear Left Center */
|
||||
RRC = BIT(9), /* Rear Right Center */
|
||||
LFE = BIT(10), /* Low Frequency Effect */
|
||||
};
|
||||
|
||||
/*
|
||||
* cea Speaker allocation structure
|
||||
*/
|
||||
struct hdmi_codec_cea_spk_alloc {
|
||||
const int ca_id;
|
||||
unsigned int n_ch;
|
||||
unsigned long mask;
|
||||
};
|
||||
|
||||
/* Channel maps stereo HDMI */
|
||||
static const struct snd_pcm_chmap_elem hdmi_codec_stereo_chmaps[] = {
|
||||
{ .channels = 2,
|
||||
.map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
|
||||
{ }
|
||||
};
|
||||
|
||||
/* Channel maps for multi-channel playbacks, up to 8 n_ch */
|
||||
static const struct snd_pcm_chmap_elem hdmi_codec_8ch_chmaps[] = {
|
||||
{ .channels = 2, /* CA_ID 0x00 */
|
||||
.map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR } },
|
||||
{ .channels = 4, /* CA_ID 0x01 */
|
||||
.map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_LFE,
|
||||
SNDRV_CHMAP_NA } },
|
||||
{ .channels = 4, /* CA_ID 0x02 */
|
||||
.map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_NA,
|
||||
SNDRV_CHMAP_FC } },
|
||||
{ .channels = 4, /* CA_ID 0x03 */
|
||||
.map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_LFE,
|
||||
SNDRV_CHMAP_FC } },
|
||||
{ .channels = 6, /* CA_ID 0x04 */
|
||||
.map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_NA,
|
||||
SNDRV_CHMAP_NA, SNDRV_CHMAP_RC, SNDRV_CHMAP_NA } },
|
||||
{ .channels = 6, /* CA_ID 0x05 */
|
||||
.map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_LFE,
|
||||
SNDRV_CHMAP_NA, SNDRV_CHMAP_RC, SNDRV_CHMAP_NA } },
|
||||
{ .channels = 6, /* CA_ID 0x06 */
|
||||
.map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_NA,
|
||||
SNDRV_CHMAP_FC, SNDRV_CHMAP_RC, SNDRV_CHMAP_NA } },
|
||||
{ .channels = 6, /* CA_ID 0x07 */
|
||||
.map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_LFE,
|
||||
SNDRV_CHMAP_FC, SNDRV_CHMAP_RC, SNDRV_CHMAP_NA } },
|
||||
{ .channels = 6, /* CA_ID 0x08 */
|
||||
.map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_NA,
|
||||
SNDRV_CHMAP_NA, SNDRV_CHMAP_RL, SNDRV_CHMAP_RR } },
|
||||
{ .channels = 6, /* CA_ID 0x09 */
|
||||
.map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_LFE,
|
||||
SNDRV_CHMAP_NA, SNDRV_CHMAP_RL, SNDRV_CHMAP_RR } },
|
||||
{ .channels = 6, /* CA_ID 0x0A */
|
||||
.map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_NA,
|
||||
SNDRV_CHMAP_FC, SNDRV_CHMAP_RL, SNDRV_CHMAP_RR } },
|
||||
{ .channels = 6, /* CA_ID 0x0B */
|
||||
.map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_LFE,
|
||||
SNDRV_CHMAP_FC, SNDRV_CHMAP_RL, SNDRV_CHMAP_RR } },
|
||||
{ .channels = 8, /* CA_ID 0x0C */
|
||||
.map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_NA,
|
||||
SNDRV_CHMAP_NA, SNDRV_CHMAP_RL, SNDRV_CHMAP_RR,
|
||||
SNDRV_CHMAP_RC, SNDRV_CHMAP_NA } },
|
||||
{ .channels = 8, /* CA_ID 0x0D */
|
||||
.map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_LFE,
|
||||
SNDRV_CHMAP_NA, SNDRV_CHMAP_RL, SNDRV_CHMAP_RR,
|
||||
SNDRV_CHMAP_RC, SNDRV_CHMAP_NA } },
|
||||
{ .channels = 8, /* CA_ID 0x0E */
|
||||
.map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_NA,
|
||||
SNDRV_CHMAP_FC, SNDRV_CHMAP_RL, SNDRV_CHMAP_RR,
|
||||
SNDRV_CHMAP_RC, SNDRV_CHMAP_NA } },
|
||||
{ .channels = 8, /* CA_ID 0x0F */
|
||||
.map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_LFE,
|
||||
SNDRV_CHMAP_FC, SNDRV_CHMAP_RL, SNDRV_CHMAP_RR,
|
||||
SNDRV_CHMAP_RC, SNDRV_CHMAP_NA } },
|
||||
{ .channels = 8, /* CA_ID 0x10 */
|
||||
.map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_NA,
|
||||
SNDRV_CHMAP_NA, SNDRV_CHMAP_RL, SNDRV_CHMAP_RR,
|
||||
SNDRV_CHMAP_RLC, SNDRV_CHMAP_RRC } },
|
||||
{ .channels = 8, /* CA_ID 0x11 */
|
||||
.map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_LFE,
|
||||
SNDRV_CHMAP_NA, SNDRV_CHMAP_RL, SNDRV_CHMAP_RR,
|
||||
SNDRV_CHMAP_RLC, SNDRV_CHMAP_RRC } },
|
||||
{ .channels = 8, /* CA_ID 0x12 */
|
||||
.map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_NA,
|
||||
SNDRV_CHMAP_FC, SNDRV_CHMAP_RL, SNDRV_CHMAP_RR,
|
||||
SNDRV_CHMAP_RLC, SNDRV_CHMAP_RRC } },
|
||||
{ .channels = 8, /* CA_ID 0x13 */
|
||||
.map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_LFE,
|
||||
SNDRV_CHMAP_FC, SNDRV_CHMAP_RL, SNDRV_CHMAP_RR,
|
||||
SNDRV_CHMAP_RLC, SNDRV_CHMAP_RRC } },
|
||||
{ .channels = 8, /* CA_ID 0x14 */
|
||||
.map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_NA,
|
||||
SNDRV_CHMAP_NA, SNDRV_CHMAP_NA, SNDRV_CHMAP_NA,
|
||||
SNDRV_CHMAP_FLC, SNDRV_CHMAP_FRC } },
|
||||
{ .channels = 8, /* CA_ID 0x15 */
|
||||
.map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_LFE,
|
||||
SNDRV_CHMAP_NA, SNDRV_CHMAP_NA, SNDRV_CHMAP_NA,
|
||||
SNDRV_CHMAP_FLC, SNDRV_CHMAP_FRC } },
|
||||
{ .channels = 8, /* CA_ID 0x16 */
|
||||
.map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_NA,
|
||||
SNDRV_CHMAP_FC, SNDRV_CHMAP_NA, SNDRV_CHMAP_NA,
|
||||
SNDRV_CHMAP_FLC, SNDRV_CHMAP_FRC } },
|
||||
{ .channels = 8, /* CA_ID 0x17 */
|
||||
.map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_LFE,
|
||||
SNDRV_CHMAP_FC, SNDRV_CHMAP_NA, SNDRV_CHMAP_NA,
|
||||
SNDRV_CHMAP_FLC, SNDRV_CHMAP_FRC } },
|
||||
{ .channels = 8, /* CA_ID 0x18 */
|
||||
.map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_NA,
|
||||
SNDRV_CHMAP_NA, SNDRV_CHMAP_NA, SNDRV_CHMAP_NA,
|
||||
SNDRV_CHMAP_FLC, SNDRV_CHMAP_FRC } },
|
||||
{ .channels = 8, /* CA_ID 0x19 */
|
||||
.map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_LFE,
|
||||
SNDRV_CHMAP_NA, SNDRV_CHMAP_NA, SNDRV_CHMAP_NA,
|
||||
SNDRV_CHMAP_FLC, SNDRV_CHMAP_FRC } },
|
||||
{ .channels = 8, /* CA_ID 0x1A */
|
||||
.map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_NA,
|
||||
SNDRV_CHMAP_FC, SNDRV_CHMAP_NA, SNDRV_CHMAP_NA,
|
||||
SNDRV_CHMAP_FLC, SNDRV_CHMAP_FRC } },
|
||||
{ .channels = 8, /* CA_ID 0x1B */
|
||||
.map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_LFE,
|
||||
SNDRV_CHMAP_FC, SNDRV_CHMAP_NA, SNDRV_CHMAP_NA,
|
||||
SNDRV_CHMAP_FLC, SNDRV_CHMAP_FRC } },
|
||||
{ .channels = 8, /* CA_ID 0x1C */
|
||||
.map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_NA,
|
||||
SNDRV_CHMAP_NA, SNDRV_CHMAP_NA, SNDRV_CHMAP_NA,
|
||||
SNDRV_CHMAP_FLC, SNDRV_CHMAP_FRC } },
|
||||
{ .channels = 8, /* CA_ID 0x1D */
|
||||
.map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_LFE,
|
||||
SNDRV_CHMAP_NA, SNDRV_CHMAP_NA, SNDRV_CHMAP_NA,
|
||||
SNDRV_CHMAP_FLC, SNDRV_CHMAP_FRC } },
|
||||
{ .channels = 8, /* CA_ID 0x1E */
|
||||
.map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_NA,
|
||||
SNDRV_CHMAP_FC, SNDRV_CHMAP_NA, SNDRV_CHMAP_NA,
|
||||
SNDRV_CHMAP_FLC, SNDRV_CHMAP_FRC } },
|
||||
{ .channels = 8, /* CA_ID 0x1F */
|
||||
.map = { SNDRV_CHMAP_FL, SNDRV_CHMAP_FR, SNDRV_CHMAP_LFE,
|
||||
SNDRV_CHMAP_FC, SNDRV_CHMAP_NA, SNDRV_CHMAP_NA,
|
||||
SNDRV_CHMAP_FLC, SNDRV_CHMAP_FRC } },
|
||||
{ }
|
||||
};
|
||||
|
||||
/*
|
||||
* hdmi_codec_channel_alloc: speaker configuration available for CEA
|
||||
*
|
||||
* This is an ordered list that must match with hdmi_codec_8ch_chmaps struct
|
||||
* The preceding ones have better chances to be selected by
|
||||
* hdmi_codec_get_ch_alloc_table_idx().
|
||||
*/
|
||||
static const struct hdmi_codec_cea_spk_alloc hdmi_codec_channel_alloc[] = {
|
||||
{ .ca_id = 0x00, .n_ch = 2,
|
||||
.mask = FL | FR},
|
||||
/* 2.1 */
|
||||
{ .ca_id = 0x01, .n_ch = 4,
|
||||
.mask = FL | FR | LFE},
|
||||
/* Dolby Surround */
|
||||
{ .ca_id = 0x02, .n_ch = 4,
|
||||
.mask = FL | FR | FC },
|
||||
/* surround51 */
|
||||
{ .ca_id = 0x0b, .n_ch = 6,
|
||||
.mask = FL | FR | LFE | FC | RL | RR},
|
||||
/* surround40 */
|
||||
{ .ca_id = 0x08, .n_ch = 6,
|
||||
.mask = FL | FR | RL | RR },
|
||||
/* surround41 */
|
||||
{ .ca_id = 0x09, .n_ch = 6,
|
||||
.mask = FL | FR | LFE | RL | RR },
|
||||
/* surround50 */
|
||||
{ .ca_id = 0x0a, .n_ch = 6,
|
||||
.mask = FL | FR | FC | RL | RR },
|
||||
/* 6.1 */
|
||||
{ .ca_id = 0x0f, .n_ch = 8,
|
||||
.mask = FL | FR | LFE | FC | RL | RR | RC },
|
||||
/* surround71 */
|
||||
{ .ca_id = 0x13, .n_ch = 8,
|
||||
.mask = FL | FR | LFE | FC | RL | RR | RLC | RRC },
|
||||
/* others */
|
||||
{ .ca_id = 0x03, .n_ch = 8,
|
||||
.mask = FL | FR | LFE | FC },
|
||||
{ .ca_id = 0x04, .n_ch = 8,
|
||||
.mask = FL | FR | RC},
|
||||
{ .ca_id = 0x05, .n_ch = 8,
|
||||
.mask = FL | FR | LFE | RC },
|
||||
{ .ca_id = 0x06, .n_ch = 8,
|
||||
.mask = FL | FR | FC | RC },
|
||||
{ .ca_id = 0x07, .n_ch = 8,
|
||||
.mask = FL | FR | LFE | FC | RC },
|
||||
{ .ca_id = 0x0c, .n_ch = 8,
|
||||
.mask = FL | FR | RC | RL | RR },
|
||||
{ .ca_id = 0x0d, .n_ch = 8,
|
||||
.mask = FL | FR | LFE | RL | RR | RC },
|
||||
{ .ca_id = 0x0e, .n_ch = 8,
|
||||
.mask = FL | FR | FC | RL | RR | RC },
|
||||
{ .ca_id = 0x10, .n_ch = 8,
|
||||
.mask = FL | FR | RL | RR | RLC | RRC },
|
||||
{ .ca_id = 0x11, .n_ch = 8,
|
||||
.mask = FL | FR | LFE | RL | RR | RLC | RRC },
|
||||
{ .ca_id = 0x12, .n_ch = 8,
|
||||
.mask = FL | FR | FC | RL | RR | RLC | RRC },
|
||||
{ .ca_id = 0x14, .n_ch = 8,
|
||||
.mask = FL | FR | FLC | FRC },
|
||||
{ .ca_id = 0x15, .n_ch = 8,
|
||||
.mask = FL | FR | LFE | FLC | FRC },
|
||||
{ .ca_id = 0x16, .n_ch = 8,
|
||||
.mask = FL | FR | FC | FLC | FRC },
|
||||
{ .ca_id = 0x17, .n_ch = 8,
|
||||
.mask = FL | FR | LFE | FC | FLC | FRC },
|
||||
{ .ca_id = 0x18, .n_ch = 8,
|
||||
.mask = FL | FR | RC | FLC | FRC },
|
||||
{ .ca_id = 0x19, .n_ch = 8,
|
||||
.mask = FL | FR | LFE | RC | FLC | FRC },
|
||||
{ .ca_id = 0x1a, .n_ch = 8,
|
||||
.mask = FL | FR | RC | FC | FLC | FRC },
|
||||
{ .ca_id = 0x1b, .n_ch = 8,
|
||||
.mask = FL | FR | LFE | RC | FC | FLC | FRC },
|
||||
{ .ca_id = 0x1c, .n_ch = 8,
|
||||
.mask = FL | FR | RL | RR | FLC | FRC },
|
||||
{ .ca_id = 0x1d, .n_ch = 8,
|
||||
.mask = FL | FR | LFE | RL | RR | FLC | FRC },
|
||||
{ .ca_id = 0x1e, .n_ch = 8,
|
||||
.mask = FL | FR | FC | RL | RR | FLC | FRC },
|
||||
{ .ca_id = 0x1f, .n_ch = 8,
|
||||
.mask = FL | FR | LFE | FC | RL | RR | FLC | FRC },
|
||||
};
|
||||
|
||||
static unsigned long hdmi_codec_spk_mask_from_alloc(int spk_alloc)
|
||||
{
|
||||
int i;
|
||||
static const unsigned long hdmi_codec_eld_spk_alloc_bits[] = {
|
||||
[0] = FL | FR, [1] = LFE, [2] = FC, [3] = RL | RR,
|
||||
[4] = RC, [5] = FLC | FRC, [6] = RLC | RRC,
|
||||
};
|
||||
unsigned long spk_mask = 0;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(hdmi_codec_eld_spk_alloc_bits); i++) {
|
||||
if (spk_alloc & (1 << i))
|
||||
spk_mask |= hdmi_codec_eld_spk_alloc_bits[i];
|
||||
}
|
||||
|
||||
return spk_mask;
|
||||
}
|
||||
|
||||
static int hdmi_codec_get_ch_alloc_table_idx(struct vc4_hdmi *vc4_hdmi,
|
||||
unsigned char channels)
|
||||
{
|
||||
struct drm_connector *connector = &vc4_hdmi->connector;
|
||||
int i;
|
||||
u8 spk_alloc;
|
||||
unsigned long spk_mask;
|
||||
const struct hdmi_codec_cea_spk_alloc *cap = hdmi_codec_channel_alloc;
|
||||
|
||||
spk_alloc = drm_eld_get_spk_alloc(connector->eld);
|
||||
spk_mask = hdmi_codec_spk_mask_from_alloc(spk_alloc);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(hdmi_codec_channel_alloc); i++, cap++) {
|
||||
/* If spk_alloc == 0, HDMI is unplugged return stereo config*/
|
||||
if (!spk_alloc && cap->ca_id == 0)
|
||||
return i;
|
||||
if (cap->n_ch != channels)
|
||||
continue;
|
||||
if (!(cap->mask == (spk_mask & cap->mask)))
|
||||
continue;
|
||||
return i;
|
||||
}
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
static void hdmi_codec_eld_chmap(struct vc4_hdmi *vc4_hdmi)
|
||||
{
|
||||
struct drm_connector *connector = &vc4_hdmi->connector;
|
||||
u8 spk_alloc;
|
||||
unsigned long spk_mask;
|
||||
|
||||
spk_alloc = drm_eld_get_spk_alloc(connector->eld);
|
||||
spk_mask = hdmi_codec_spk_mask_from_alloc(spk_alloc);
|
||||
|
||||
/* Detect if only stereo supported, else return 8 channels mappings */
|
||||
if ((spk_mask & ~(FL | FR)))
|
||||
vc4_hdmi->audio.chmap = hdmi_codec_8ch_chmaps;
|
||||
else
|
||||
vc4_hdmi->audio.chmap = hdmi_codec_stereo_chmaps;
|
||||
}
|
||||
|
||||
static int vc4_hdmi_debugfs_regs(struct seq_file *m, void *unused)
|
||||
{
|
||||
struct drm_info_node *node = (struct drm_info_node *)m->private;
|
||||
@@ -350,6 +656,9 @@ static void vc4_hdmi_set_audio_infoframe(struct drm_encoder *encoder)
|
||||
frame.audio.sample_size = HDMI_AUDIO_SAMPLE_SIZE_STREAM;
|
||||
frame.audio.channels = vc4_hdmi->audio.channels;
|
||||
|
||||
/* Select a channel allocation that matches with ELD and pcm channels */
|
||||
frame.audio.channel_allocation = vc4_hdmi->audio.chmap_idx;
|
||||
|
||||
vc4_hdmi_write_infoframe(encoder, &frame);
|
||||
}
|
||||
|
||||
@@ -881,6 +1190,10 @@ static int vc4_hdmi_audio_startup(struct snd_pcm_substream *substream,
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
/* Select chmap supported */
|
||||
vc4_hdmi->audio.max_channels = 8;
|
||||
hdmi_codec_eld_chmap(vc4_hdmi);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -967,6 +1280,7 @@ static int vc4_hdmi_audio_prepare(struct snd_pcm_substream *substream,
|
||||
u32 channel_map;
|
||||
u32 mai_audio_format;
|
||||
u32 mai_sample_rate;
|
||||
int idx;
|
||||
|
||||
if (substream != vc4_hdmi->audio.substream)
|
||||
return -EINVAL;
|
||||
@@ -1027,6 +1341,14 @@ static int vc4_hdmi_audio_prepare(struct snd_pcm_substream *substream,
|
||||
HDMI_WRITE(HDMI_AUDIO_PACKET_CONFIG, audio_packet_config);
|
||||
vc4_hdmi_set_n_cts(vc4_hdmi);
|
||||
|
||||
idx = hdmi_codec_get_ch_alloc_table_idx(vc4_hdmi, vc4_hdmi->audio.channels);
|
||||
if (idx < 0) {
|
||||
DRM_ERROR("Not able to map channels to speakers (%d)\n", idx);
|
||||
vc4_hdmi->audio.chmap_idx = HDMI_CODEC_CHMAP_IDX_UNKNOWN;
|
||||
} else {
|
||||
vc4_hdmi->audio.chmap_idx = hdmi_codec_channel_alloc[idx].ca_id;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1145,6 +1467,89 @@ static int vc4_spdif_mask_get(struct snd_kcontrol *kcontrol,
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* ALSA API channel-map control callbacks
|
||||
*/
|
||||
static int vc4_chmap_ctl_info(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_info *uinfo)
|
||||
{
|
||||
struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
|
||||
struct vc4_hdmi *vc4_hdmi = snd_component_to_hdmi(component);
|
||||
|
||||
uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
|
||||
uinfo->count = vc4_hdmi->audio.max_channels;
|
||||
uinfo->value.integer.min = 0;
|
||||
uinfo->value.integer.max = SNDRV_CHMAP_LAST;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int vc4_chmap_ctl_get(struct snd_kcontrol *kcontrol,
|
||||
struct snd_ctl_elem_value *ucontrol)
|
||||
{
|
||||
struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
|
||||
struct vc4_hdmi *vc4_hdmi = snd_component_to_hdmi(component);
|
||||
unsigned const char *map;
|
||||
unsigned int i;
|
||||
|
||||
if (!vc4_hdmi->audio.chmap)
|
||||
return -EINVAL;
|
||||
|
||||
map = vc4_hdmi->audio.chmap[vc4_hdmi->audio.chmap_idx].map;
|
||||
|
||||
for (i = 0; i < vc4_hdmi->audio.max_channels; i++) {
|
||||
if (vc4_hdmi->audio.chmap_idx == HDMI_CODEC_CHMAP_IDX_UNKNOWN)
|
||||
ucontrol->value.integer.value[i] = 0;
|
||||
else
|
||||
ucontrol->value.integer.value[i] = map[i];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int vc4_chmap_ctl_tlv(struct snd_kcontrol *kcontrol, int op_flag,
|
||||
unsigned int size, unsigned int __user *tlv)
|
||||
{
|
||||
struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
|
||||
struct vc4_hdmi *vc4_hdmi = snd_component_to_hdmi(component);
|
||||
const struct snd_pcm_chmap_elem *map;
|
||||
unsigned int __user *dst;
|
||||
int c, count = 0;
|
||||
|
||||
if (!vc4_hdmi->audio.chmap)
|
||||
return -EINVAL;
|
||||
if (size < 8)
|
||||
return -ENOMEM;
|
||||
if (put_user(SNDRV_CTL_TLVT_CONTAINER, tlv))
|
||||
return -EFAULT;
|
||||
size -= 8;
|
||||
dst = tlv + 2;
|
||||
for (map = vc4_hdmi->audio.chmap; map->channels; map++) {
|
||||
int chs_bytes = map->channels * 4;
|
||||
//if (!valid_chmap_channels(info, map->channels))
|
||||
// continue;
|
||||
if (size < 8)
|
||||
return -ENOMEM;
|
||||
if (put_user(SNDRV_CTL_TLVT_CHMAP_FIXED, dst) ||
|
||||
put_user(chs_bytes, dst + 1))
|
||||
return -EFAULT;
|
||||
dst += 2;
|
||||
size -= 8;
|
||||
count += 8;
|
||||
if (size < chs_bytes)
|
||||
return -ENOMEM;
|
||||
size -= chs_bytes;
|
||||
count += chs_bytes;
|
||||
for (c = 0; c < map->channels; c++) {
|
||||
if (put_user(map->map[c], dst))
|
||||
return -EFAULT;
|
||||
dst++;
|
||||
}
|
||||
}
|
||||
if (put_user(count, tlv + 1))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct snd_kcontrol_new vc4_hdmi_audio_controls[] = {
|
||||
{
|
||||
.access = SNDRV_CTL_ELEM_ACCESS_READ |
|
||||
@@ -1167,6 +1572,16 @@ static const struct snd_kcontrol_new vc4_hdmi_audio_controls[] = {
|
||||
.info = vc4_spdif_info,
|
||||
.get = vc4_spdif_mask_get,
|
||||
},
|
||||
{
|
||||
.access = SNDRV_CTL_ELEM_ACCESS_READ |
|
||||
SNDRV_CTL_ELEM_ACCESS_TLV_READ |
|
||||
SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK,
|
||||
.iface = SNDRV_CTL_ELEM_IFACE_PCM,
|
||||
.name = "Playback Channel Map",
|
||||
.info = vc4_chmap_ctl_info,
|
||||
.get = vc4_chmap_ctl_get,
|
||||
.tlv.c = vc4_chmap_ctl_tlv,
|
||||
},
|
||||
};
|
||||
|
||||
static const struct snd_soc_dapm_widget vc4_hdmi_audio_widgets[] = {
|
||||
|
||||
@@ -117,6 +117,9 @@ struct vc4_hdmi_audio {
|
||||
bool streaming;
|
||||
|
||||
unsigned char iec_status[4];
|
||||
const struct snd_pcm_chmap_elem *chmap;
|
||||
unsigned int chmap_idx;
|
||||
unsigned int max_channels;
|
||||
};
|
||||
|
||||
/* General HDMI hardware state. */
|
||||
|
||||
@@ -94,7 +94,6 @@ static void actpwr_trig_cycle(struct timer_list *t)
|
||||
{
|
||||
struct actpwr_trig_data *trig = &actpwr_data;
|
||||
struct actpwr_vled *active;
|
||||
enum led_brightness value;
|
||||
|
||||
active = &trig->virt_leds[trig->next_active];
|
||||
trig->active = active;
|
||||
|
||||
@@ -643,9 +643,9 @@ err:
|
||||
|
||||
static void ath9k_hif_usb_rx_cb(struct urb *urb)
|
||||
{
|
||||
struct rx_buf *rx_buf = (struct rx_buf *)urb->context;
|
||||
struct hif_device_usb *hif_dev = rx_buf->hif_dev;
|
||||
struct sk_buff *skb = rx_buf->skb;
|
||||
struct sk_buff *skb = (struct sk_buff *) urb->context;
|
||||
struct hif_device_usb *hif_dev =
|
||||
usb_get_intfdata(usb_ifnum_to_if(urb->dev, 0));
|
||||
int ret;
|
||||
|
||||
if (!skb)
|
||||
@@ -685,15 +685,14 @@ resubmit:
|
||||
return;
|
||||
free:
|
||||
kfree_skb(skb);
|
||||
kfree(rx_buf);
|
||||
}
|
||||
|
||||
static void ath9k_hif_usb_reg_in_cb(struct urb *urb)
|
||||
{
|
||||
struct rx_buf *rx_buf = (struct rx_buf *)urb->context;
|
||||
struct hif_device_usb *hif_dev = rx_buf->hif_dev;
|
||||
struct sk_buff *skb = rx_buf->skb;
|
||||
struct sk_buff *skb = (struct sk_buff *) urb->context;
|
||||
struct sk_buff *nskb;
|
||||
struct hif_device_usb *hif_dev =
|
||||
usb_get_intfdata(usb_ifnum_to_if(urb->dev, 0));
|
||||
int ret;
|
||||
|
||||
if (!skb)
|
||||
@@ -751,7 +750,6 @@ resubmit:
|
||||
return;
|
||||
free:
|
||||
kfree_skb(skb);
|
||||
kfree(rx_buf);
|
||||
urb->context = NULL;
|
||||
}
|
||||
|
||||
@@ -797,7 +795,7 @@ static int ath9k_hif_usb_alloc_tx_urbs(struct hif_device_usb *hif_dev)
|
||||
init_usb_anchor(&hif_dev->mgmt_submitted);
|
||||
|
||||
for (i = 0; i < MAX_TX_URB_NUM; i++) {
|
||||
tx_buf = kzalloc(sizeof(*tx_buf), GFP_KERNEL);
|
||||
tx_buf = kzalloc(sizeof(struct tx_buf), GFP_KERNEL);
|
||||
if (!tx_buf)
|
||||
goto err;
|
||||
|
||||
@@ -834,9 +832,8 @@ static void ath9k_hif_usb_dealloc_rx_urbs(struct hif_device_usb *hif_dev)
|
||||
|
||||
static int ath9k_hif_usb_alloc_rx_urbs(struct hif_device_usb *hif_dev)
|
||||
{
|
||||
struct rx_buf *rx_buf = NULL;
|
||||
struct sk_buff *skb = NULL;
|
||||
struct urb *urb = NULL;
|
||||
struct sk_buff *skb = NULL;
|
||||
int i, ret;
|
||||
|
||||
init_usb_anchor(&hif_dev->rx_submitted);
|
||||
@@ -844,12 +841,6 @@ static int ath9k_hif_usb_alloc_rx_urbs(struct hif_device_usb *hif_dev)
|
||||
|
||||
for (i = 0; i < MAX_RX_URB_NUM; i++) {
|
||||
|
||||
rx_buf = kzalloc(sizeof(*rx_buf), GFP_KERNEL);
|
||||
if (!rx_buf) {
|
||||
ret = -ENOMEM;
|
||||
goto err_rxb;
|
||||
}
|
||||
|
||||
/* Allocate URB */
|
||||
urb = usb_alloc_urb(0, GFP_KERNEL);
|
||||
if (urb == NULL) {
|
||||
@@ -864,14 +855,11 @@ static int ath9k_hif_usb_alloc_rx_urbs(struct hif_device_usb *hif_dev)
|
||||
goto err_skb;
|
||||
}
|
||||
|
||||
rx_buf->hif_dev = hif_dev;
|
||||
rx_buf->skb = skb;
|
||||
|
||||
usb_fill_bulk_urb(urb, hif_dev->udev,
|
||||
usb_rcvbulkpipe(hif_dev->udev,
|
||||
USB_WLAN_RX_PIPE),
|
||||
skb->data, MAX_RX_BUF_SIZE,
|
||||
ath9k_hif_usb_rx_cb, rx_buf);
|
||||
ath9k_hif_usb_rx_cb, skb);
|
||||
|
||||
/* Anchor URB */
|
||||
usb_anchor_urb(urb, &hif_dev->rx_submitted);
|
||||
@@ -897,8 +885,6 @@ err_submit:
|
||||
err_skb:
|
||||
usb_free_urb(urb);
|
||||
err_urb:
|
||||
kfree(rx_buf);
|
||||
err_rxb:
|
||||
ath9k_hif_usb_dealloc_rx_urbs(hif_dev);
|
||||
return ret;
|
||||
}
|
||||
@@ -910,21 +896,14 @@ static void ath9k_hif_usb_dealloc_reg_in_urbs(struct hif_device_usb *hif_dev)
|
||||
|
||||
static int ath9k_hif_usb_alloc_reg_in_urbs(struct hif_device_usb *hif_dev)
|
||||
{
|
||||
struct rx_buf *rx_buf = NULL;
|
||||
struct sk_buff *skb = NULL;
|
||||
struct urb *urb = NULL;
|
||||
struct sk_buff *skb = NULL;
|
||||
int i, ret;
|
||||
|
||||
init_usb_anchor(&hif_dev->reg_in_submitted);
|
||||
|
||||
for (i = 0; i < MAX_REG_IN_URB_NUM; i++) {
|
||||
|
||||
rx_buf = kzalloc(sizeof(*rx_buf), GFP_KERNEL);
|
||||
if (!rx_buf) {
|
||||
ret = -ENOMEM;
|
||||
goto err_rxb;
|
||||
}
|
||||
|
||||
/* Allocate URB */
|
||||
urb = usb_alloc_urb(0, GFP_KERNEL);
|
||||
if (urb == NULL) {
|
||||
@@ -939,14 +918,11 @@ static int ath9k_hif_usb_alloc_reg_in_urbs(struct hif_device_usb *hif_dev)
|
||||
goto err_skb;
|
||||
}
|
||||
|
||||
rx_buf->hif_dev = hif_dev;
|
||||
rx_buf->skb = skb;
|
||||
|
||||
usb_fill_int_urb(urb, hif_dev->udev,
|
||||
usb_rcvintpipe(hif_dev->udev,
|
||||
USB_REG_IN_PIPE),
|
||||
skb->data, MAX_REG_IN_BUF_SIZE,
|
||||
ath9k_hif_usb_reg_in_cb, rx_buf, 1);
|
||||
ath9k_hif_usb_reg_in_cb, skb, 1);
|
||||
|
||||
/* Anchor URB */
|
||||
usb_anchor_urb(urb, &hif_dev->reg_in_submitted);
|
||||
@@ -972,8 +948,6 @@ err_submit:
|
||||
err_skb:
|
||||
usb_free_urb(urb);
|
||||
err_urb:
|
||||
kfree(rx_buf);
|
||||
err_rxb:
|
||||
ath9k_hif_usb_dealloc_reg_in_urbs(hif_dev);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -86,11 +86,6 @@ struct tx_buf {
|
||||
struct list_head list;
|
||||
};
|
||||
|
||||
struct rx_buf {
|
||||
struct sk_buff *skb;
|
||||
struct hif_device_usb *hif_dev;
|
||||
};
|
||||
|
||||
#define HIF_USB_TX_STOP BIT(0)
|
||||
#define HIF_USB_TX_FLUSH BIT(1)
|
||||
|
||||
|
||||
@@ -3205,8 +3205,18 @@ vchiq_register_child(struct platform_device *pdev, const char *name)
|
||||
|
||||
child->dev.of_node = np;
|
||||
|
||||
/*
|
||||
* We want the dma-ranges etc to be copied from the parent VCHIQ device
|
||||
* to be passed on to the children without a node of their own.
|
||||
*/
|
||||
if (!np)
|
||||
np = pdev->dev.of_node;
|
||||
|
||||
of_dma_configure(&child->dev, np, true);
|
||||
|
||||
if (np != pdev->dev.of_node)
|
||||
of_node_put(np);
|
||||
|
||||
return child;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,9 +26,8 @@ struct gpio_backlight {
|
||||
int def_value;
|
||||
};
|
||||
|
||||
static int gpio_backlight_update_status(struct backlight_device *bl)
|
||||
static int gpio_backlight_get_next_brightness(struct backlight_device *bl)
|
||||
{
|
||||
struct gpio_backlight *gbl = bl_get_data(bl);
|
||||
int brightness = bl->props.brightness;
|
||||
|
||||
if (bl->props.power != FB_BLANK_UNBLANK ||
|
||||
@@ -36,6 +35,14 @@ static int gpio_backlight_update_status(struct backlight_device *bl)
|
||||
bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
|
||||
brightness = 0;
|
||||
|
||||
return brightness;
|
||||
}
|
||||
|
||||
static int gpio_backlight_update_status(struct backlight_device *bl)
|
||||
{
|
||||
struct gpio_backlight *gbl = bl_get_data(bl);
|
||||
int brightness = gpio_backlight_get_next_brightness(bl);
|
||||
|
||||
gpiod_set_value_cansleep(gbl->gpiod, brightness);
|
||||
|
||||
return 0;
|
||||
@@ -86,7 +93,8 @@ static int gpio_backlight_initial_power_state(struct gpio_backlight *gbl)
|
||||
return gbl->def_value ? FB_BLANK_UNBLANK : FB_BLANK_POWERDOWN;
|
||||
|
||||
/* if the enable GPIO is disabled, do not enable the backlight */
|
||||
if (gpiod_get_value_cansleep(gbl->gpiod) == 0)
|
||||
if (gpiod_get_direction(gbl->gpiod) == 0 &&
|
||||
gpiod_get_value_cansleep(gbl->gpiod) == 0)
|
||||
return FB_BLANK_POWERDOWN;
|
||||
|
||||
return FB_BLANK_UNBLANK;
|
||||
@@ -100,7 +108,7 @@ static int gpio_backlight_probe(struct platform_device *pdev)
|
||||
struct backlight_properties props;
|
||||
struct backlight_device *bl;
|
||||
struct gpio_backlight *gbl;
|
||||
int ret;
|
||||
int ret, init_brightness;
|
||||
|
||||
gbl = devm_kzalloc(&pdev->dev, sizeof(*gbl), GFP_KERNEL);
|
||||
if (gbl == NULL)
|
||||
@@ -153,7 +161,12 @@ static int gpio_backlight_probe(struct platform_device *pdev)
|
||||
bl->props.power = gpio_backlight_initial_power_state(gbl);
|
||||
bl->props.brightness = 1;
|
||||
|
||||
backlight_update_status(bl);
|
||||
init_brightness = gpio_backlight_get_next_brightness(bl);
|
||||
ret = gpiod_direction_output(gbl->gpiod, init_brightness);
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "failed to set initial brightness\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
platform_set_drvdata(pdev, bl);
|
||||
return 0;
|
||||
|
||||
@@ -1791,7 +1791,6 @@ cifs_rename2(struct inode *source_dir, struct dentry *source_dentry,
|
||||
FILE_UNIX_BASIC_INFO *info_buf_target;
|
||||
unsigned int xid;
|
||||
int rc, tmprc;
|
||||
bool new_target = d_really_is_negative(target_dentry);
|
||||
|
||||
if (flags & ~RENAME_NOREPLACE)
|
||||
return -EINVAL;
|
||||
@@ -1868,13 +1867,8 @@ cifs_rename2(struct inode *source_dir, struct dentry *source_dentry,
|
||||
*/
|
||||
|
||||
unlink_target:
|
||||
/*
|
||||
* If the target dentry was created during the rename, try
|
||||
* unlinking it if it's not negative
|
||||
*/
|
||||
if (new_target &&
|
||||
d_really_is_positive(target_dentry) &&
|
||||
(rc == -EACCES || rc == -EEXIST)) {
|
||||
/* Try unlinking the target dentry if it's not negative */
|
||||
if (d_really_is_positive(target_dentry) && (rc == -EACCES || rc == -EEXIST)) {
|
||||
if (d_is_dir(target_dentry))
|
||||
tmprc = cifs_rmdir(target_dir, target_dentry);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user