linux-postmarketos-omap: upgrade to 6.9.3 (MR 5216)

* Use upstreamed power controller for espresso
  Related issue: https://gitlab.com/postmarketOS/pmaports/-/issues/2825

* Include patch for iio-rescale logic
  Related: https://lore.kernel.org/all/20220524075448.140238-1-linus.walleij@linaro.org/

* Enable CONFIG_NLS_ASCII
  Related: https://gitlab.com/postmarketOS/pmaports/-/issues/2874

* espresso-common: Remove twl6030 import and use upstreamed clk32kg for wlan

[ci:skip-build]: already built successfully in CI
Tweaked-By: Oliver Smith <ollieparanoid@postmarketos.org>
This commit is contained in:
Mighty 2024-06-08 17:36:35 +05:30 committed by Oliver Smith
parent 074eb3b0a5
commit 65679fec40
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
9 changed files with 48 additions and 223 deletions

View file

@ -3,7 +3,7 @@ new file mode 100644
index 000000000..f7b371179
--- /dev/null
+++ b/arch/arm/boot/dts/ti/omap/twl6032.dtsi
@@ -0,0 +1,88 @@
@@ -0,0 +1,93 @@
+/*
+ * Integrated Power Management Chip
+ * http://www.ti.com/lit/ds/symlink/twl6032.pdf
@ -79,7 +79,7 @@ index 000000000..f7b371179
+ regulator-always-on;
+ };
+
+ vusb: regulator-vusb {
+ ldousb: regulator-ldousb {
+ compatible = "ti,twl6032-ldousb";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
@ -91,4 +91,9 @@ index 000000000..f7b371179
+ interrupts = <3>;
+ #io-channel-cells = <1>;
+ };
+
+ twl_usb_comparator: usb-comparator {
+ compatible = "ti,twl6030-usb";
+ interrupts = <4>, <10>;
+ };
+};

View file

@ -13,7 +13,7 @@ new file mode 100644
index 000000000..b44af61d4
--- /dev/null
+++ b/arch/arm/boot/dts/ti/omap/omap4-samsung-espresso-common.dtsi
@@ -0,0 +1,676 @@
@@ -0,0 +1,678 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/dts-v1/;
+#include "dt-bindings/gpio/gpio.h"
@ -274,6 +274,12 @@ index 000000000..b44af61d4
+ compatible = "gpio-ir-tx";
+ gpios = <&gpio2 27 GPIO_ACTIVE_HIGH>; /* GPIO_59 */
+ };
+
+ wlan_pwrseq: wlan-pwrseq {
+ compatible = "mmc-pwrseq-simple";
+ clocks = <&twl 0>; // 0 is ckl32kg, 1 is clk32kaudio
+ clock-names = "ext_clock";
+ };
+};
+
+&omap4_pmx_wkup {
@ -512,6 +518,7 @@ index 000000000..b44af61d4
+
+ twl: twl@48 {
+ reg = <0x48>;
+ #clock-cells = <1>;
+
+ pinctrl-names = "default";
+ pinctrl-0 = <
@ -522,11 +529,7 @@ index 000000000..b44af61d4
+ /* SPI = 0, IRQ# = 7, 4 = active high level-sensitive */
+ interrupts = <GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>; /* IRQ_SYS_1N cascaded to gic */
+ interrupt-parent = <&gic>;
+
+ twl_power: power {
+ compatible = "ti,twl6030-power";
+ ti,system-power-controller;
+ };
+ system-power-controller;
+ };
+};
+
@ -610,10 +613,8 @@ index 000000000..b44af61d4
+ };
+};
+
+#include "twl6030.dtsi"
+
+&twl_usb_comparator {
+ usb-supply = <&vusb>;
+ usb-supply = <&ldousb>;
+};
+
+&usb_otg_hs {
@ -658,6 +659,7 @@ index 000000000..b44af61d4
+ non-removable;
+ bus-width = <4>;
+ vmmc-supply = <&reg_espresso_wlan>;
+ mmc-pwrseq = <&wlan_pwrseq>;
+
+ pinctrl-names = "default";
+ pinctrl-0 = <&mmc5_pins>;

View file

@ -35,7 +35,7 @@ index 000000000..9d715bd7e
+/ {
+ model = "Samsung Galaxy Tab 2 (7 inch)";
+ compatible = "samsung,espresso7", "ti,omap4430", "ti,omap4";
+
+
+ backlight: backlight {
+ compatible = "pwm-backlight";
+ pinctrl-names = "default";
@ -80,7 +80,7 @@ index 000000000..9d715bd7e
+ remote-endpoint = <&bridge_out>;
+ };
+ };
+ };
+ };
+};
+
+&i2c3 {

View file

@ -72,17 +72,17 @@ index 000000000..3fa4b18bd
+
+ panel-timing {
+ clock-frequency = <69818000>;
+
+
+ hback-porch = <64>;
+ hactive = <1280>;
+ hfront-porch = <16>;
+ hsync-len = <48>;
+
+
+ vback-porch = <11>;
+ vactive = <800>;
+ vfront-porch = <16>;
+ vsync-len = <3>;
+
+
+ hsync-active = <0>;
+ vsync-active = <0>;
+ de-active = <1>;

View file

@ -1,194 +0,0 @@
diff --git a/Documentation/devicetree/bindings/mfd/twl6030-power.txt b/Documentation/devicetree/bindings/mfd/twl6030-power.txt
new file mode 100644
index 000000000..a78f0f842
--- /dev/null
+++ b/Documentation/devicetree/bindings/mfd/twl6030-power.txt
@@ -0,0 +1,32 @@
+
+Texas Instruments TWL family (twl6030) reset and power management module
+
+For now, the binding only supports the complete shutdown of the system after
+poweroff.
+
+Required properties:
+- compatible : must be
+ "ti,twl6030-power"
+
+Optional properties:
+
+- ti,system-power-controller: This indicates that TWL6030 is the
+ power supply master of the system. With this flag, the chip will
+ initiate an ACTIVE-to-OFF or SLEEP-to-OFF transition when the
+ system poweroffs.
+
+Example:
+&i2c1 {
+ clock-frequency = <2600000>;
+
+ twl: twl@48 {
+ reg = <0x48>;
+ interrupts = <7>; /* SYS_NIRQ cascaded to intc */
+ interrupt-parent = <&intc>;
+
+ twl_power: power {
+ compatible = "ti,twl6030-power";
+ ti,system-power-controller;
+ };
+ };
+};
diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
index 02c253de9..b27ae703f 100644
--- a/arch/arm/mach-omap2/Kconfig
+++ b/arch/arm/mach-omap2/Kconfig
@@ -140,7 +140,8 @@ config ARCH_OMAP2PLUS_TYPICAL
select REGULATOR
select REGULATOR_FIXED_VOLTAGE
select TWL4030_CORE if ARCH_OMAP3 || ARCH_OMAP4
- select TWL4030_POWER if ARCH_OMAP3 || ARCH_OMAP4
+ select TWL4030_POWER if ARCH_OMAP3
+ select TWL6030_POWER if ARCH_OMAP4
select VFP
help
Compile a kernel suitable for booting most boards
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index ca0edab91..525fdf347 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -1671,6 +1671,16 @@ config MFD_TWL4030_AUDIO
select MFD_CORE
default n
+config TWL6030_POWER
+ bool "TI TWL6030 power resources"
+ depends on TWL4030_CORE && ARM
+ help
+ Say yes here if you want to use the power resources on the
+ TWL6030 family chips.
+
+ When used as system power controller, this driver allows turning off
+ the main power supply.
+
config TWL6040_CORE
bool "TI TWL6040 audio codec"
depends on I2C=y
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index 2ba6646e8..ccdd8efa3 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -111,6 +111,7 @@ obj-$(CONFIG_MENELAUS) += menelaus.o
obj-$(CONFIG_TWL4030_CORE) += twl-core.o twl4030-irq.o twl6030-irq.o
obj-$(CONFIG_TWL4030_POWER) += twl4030-power.o
obj-$(CONFIG_MFD_TWL4030_AUDIO) += twl4030-audio.o
+obj-$(CONFIG_TWL6030_POWER) += twl6030-power.o
obj-$(CONFIG_TWL6040_CORE) += twl6040.o
obj-$(CONFIG_MFD_MX25_TSADC) += fsl-imx25-tsadc.o
diff --git a/drivers/mfd/twl6030-power.c b/drivers/mfd/twl6030-power.c
new file mode 100644
index 000000000..f6bacdfc3
--- /dev/null
+++ b/drivers/mfd/twl6030-power.c
@@ -0,0 +1,103 @@
+
+/*
+ * TWL6030 power
+ *
+ * Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
+ *
+ * This file is subject to the terms and conditions of the GNU General
+ * Public License. See the file "COPYING" in the main directory of this
+ * archive for more details.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <linux/module.h>
+#include <linux/pm.h>
+#include <linux/mfd/twl.h>
+#include <linux/platform_device.h>
+#include <linux/of.h>
+#include <linux/of_device.h>
+
+#define TWL6030_PHOENIX_DEV_ON 0x25
+
+#define TWL6030_PHOENIX_APP_DEVOFF (1 << 0)
+#define TWL6030_PHOENIX_CON_DEVOFF (1 << 1)
+#define TWL6030_PHOENIX_MOD_DEVOFF (1 << 2)
+
+void twl6030_power_off(void)
+{
+ int err;
+
+ err = twl_i2c_write_u8(TWL6030_MODULE_ID0, TWL6030_PHOENIX_APP_DEVOFF |
+ TWL6030_PHOENIX_CON_DEVOFF | TWL6030_PHOENIX_MOD_DEVOFF,
+ TWL6030_PHOENIX_DEV_ON);
+ if (err)
+ pr_err("TWL6030 Unable to power off\n");
+}
+
+static bool twl6030_power_use_poweroff(const struct twl4030_power_data *pdata,
+ struct device_node *node)
+{
+ if (pdata && pdata->use_poweroff)
+ return true;
+
+ if (of_property_read_bool(node, "ti,system-power-controller"))
+ return true;
+
+ return false;
+}
+
+#ifdef CONFIG_OF
+static const struct of_device_id twl6030_power_of_match[] = {
+ {
+ .compatible = "ti,twl6030-power",
+ },
+ { },
+};
+
+MODULE_DEVICE_TABLE(of, twl6030_power_of_match);
+#endif /* CONFIG_OF */
+
+static int twl6030_power_probe(struct platform_device *pdev)
+{
+ const struct twl4030_power_data *pdata = dev_get_platdata(&pdev->dev);
+ struct device_node *node = pdev->dev.of_node;
+
+ if (!pdata && !node) {
+ dev_err(&pdev->dev, "Platform data is missing\n");
+ return -EINVAL;
+ }
+
+ /* Board has to be wired properly to use this feature */
+ if (twl6030_power_use_poweroff(pdata, node) && !pm_power_off)
+ pm_power_off = twl6030_power_off;
+
+ return 0;
+}
+
+static int twl6030_power_remove(struct platform_device *pdev)
+{
+ return 0;
+}
+
+static struct platform_driver twl6030_power_driver = {
+ .driver = {
+ .name = "twl6030_power",
+ .of_match_table = of_match_ptr(twl6030_power_of_match),
+ },
+ .probe = twl6030_power_probe,
+ .remove = twl6030_power_remove,
+};
+
+module_platform_driver(twl6030_power_driver);
+
+MODULE_AUTHOR("Paul Kocialkowski <contact@paulk.fr>");
+MODULE_DESCRIPTION("Power management for TWL6030");
+MODULE_LICENSE("GPL");

View file

@ -0,0 +1,13 @@
diff --git a/drivers/iio/afe/iio-rescale.c b/drivers/iio/afe/iio-rescale.c
index 56e5913ab..e0d5e437f 100644
--- a/drivers/iio/afe/iio-rescale.c
+++ b/drivers/iio/afe/iio-rescale.c
@@ -289,7 +289,7 @@ static int rescale_configure_channel(struct device *dev,
chan->ext_info = rescale->ext_info;
chan->type = rescale->cfg->type;
- if (iio_channel_has_info(schan, IIO_CHAN_INFO_RAW) &&
+ if (iio_channel_has_info(schan, IIO_CHAN_INFO_RAW) ||
(iio_channel_has_info(schan, IIO_CHAN_INFO_SCALE) ||
iio_channel_has_info(schan, IIO_CHAN_INFO_OFFSET))) {
dev_info(dev, "using raw+scale/offset source channel\n");

View file

@ -3,7 +3,7 @@
# Kernel config based on: arch/arm/configs/omap2plus_defconfig
pkgname=linux-postmarketos-omap
pkgver=6.9.0
pkgver=6.9.3
pkgrel=0
pkgdesc="Mainline kernel fork for OMAP devices"
arch="armv7"
@ -37,8 +37,8 @@ source="
0002-arm-dts-Add-common-dtsi-for-espresso.patch
0003-arm-dts-Add-espresso7-support.patch
0004-arm-dts-Add-espresso10-support.patch
0005-Add-TWL6030-power-driver-with-minimal-support-for-power-off.patch
0006-Add-TWL6030-power-button-support-to-twl-pwrbutton.patch
0005-Add-TWL6030-power-button-support-to-twl-pwrbutton.patch
0006-iio-rescale-revert-logic.patch
0007-hsi-ssi_port-force-pio-path.patch
0008-n900-dts-volume-keys.patch
0009-ARM-dts-disable-twl-off-idle-configuration-for-N900.patch
@ -74,14 +74,14 @@ package() {
}
sha512sums="
fed3b4cd1fbfb4d94618587c1934273d2ecc8b6e42a3d586ff8a5f24980be930f2ef803aa2923ca3bfa5e4e619f967f3af315368f24fa76f610b10443624a579 linux-6.9.tar.xz
c0ab8a8126b78a5c5ba9106adc01b92d4bb9f198ef307362db585a988aee509f6bec43fbd4314b3438b470f8b3c6357e9f16b4952981ed185100b5b7e34f317c config-postmarketos-omap.armv7
fe4307a6af41913a7e5d59288b563865116797d3272e0570faff4532e198831e764e0067f53afdd39e57665196ae44f05d554bbd7d55d556d4b2d3c9d2efd41f 0001-Add-TWL6032-dtsi.patch
2c13c46b4db0d4a75c3aae3a46041fe43f841dc4ab3c7b08cd9db22a73c8355701d85c8c1e979aba93002b96d63ad3f1f8e46c15ecdde4391ea677b71dd17b45 0002-arm-dts-Add-common-dtsi-for-espresso.patch
4efda42604f5a6d5f9d4ceb9f87aaa5ad81d9299b3cd8ae930aafa895df5041ff5ee2cf441bbf7fdd002a52df378ee08c0bde85657e5d2086404b9f08b3a742d 0003-arm-dts-Add-espresso7-support.patch
f0bb41630d8e08adcffa433f3c82047e8787c96b7cc7301eb80bf5e5298010c136cd10c756278fb2331d66dde33d6a13128420f5af022b117f9e3ddb23070934 0004-arm-dts-Add-espresso10-support.patch
9dc84421cbc2ea7c2c37847d8704ff46dd4a485485bfa4a671167fdef4ac6f53a4e8f787aa774f3748299c374e7c7dc5d36fd4ba9b1a1a9697e0526f2bf3ece4 0005-Add-TWL6030-power-driver-with-minimal-support-for-power-off.patch
fe9ce7ed5757a1e72663c15e80cef47531b80150e8c45fa94c03a291edc39a401c0678894c3f7afbe9b78b5cbe88529982bd6c90ab3f515c31199e6939aa3b96 0006-Add-TWL6030-power-button-support-to-twl-pwrbutton.patch
119320627a73c260725a51ee4234942cc137aeb8b7c67428204ae14e3b518cf7b770e75a8dd0df7fa910333a64241146eb8f93463163f386dae8ddbd6943a631 linux-6.9.3.tar.xz
4bd7828c0f2afd5ef3829df8bff1c503b4e426fe2621f9c754dcdef1d1118fdd06729729a6516140783e382ccddd38f0f8f0dbeab6624bdd6d7013ce2c9afc97 config-postmarketos-omap.armv7
9a187d93885f07467ec67094621b2d762607d58622e67172bdfcd8ba5f3d6aab900ca5d233efd3d447540f9b906ba950083a35997c84b315801604e1cd5cddc3 0001-Add-TWL6032-dtsi.patch
f7d1a87088c65278a114125e732d5bebebb560a6245afb34e003083d808ef3f8c5f49ff23131953508a6daae111ab6adfffdbcf56b79260a6d4115f859c7bb3a 0002-arm-dts-Add-common-dtsi-for-espresso.patch
089ca0547997c7cd5d1b65924c134eb6b7703a7439729923d3639d125763412fa7e826d1cb839ac0b6cd22e614f69a3b52605a75b571e271c33f9a27ff6ac9c2 0003-arm-dts-Add-espresso7-support.patch
97f6671bd6fa02d095b726793a3ae68a5b94b0a89719006121a6eaf1607c477f74446489a0f62250edc3c193945f571c92196c85ec8043ae18a141ea9adffd51 0004-arm-dts-Add-espresso10-support.patch
fe9ce7ed5757a1e72663c15e80cef47531b80150e8c45fa94c03a291edc39a401c0678894c3f7afbe9b78b5cbe88529982bd6c90ab3f515c31199e6939aa3b96 0005-Add-TWL6030-power-button-support-to-twl-pwrbutton.patch
1a68e3a32ae1e56d325c0f759ee66d64d14f46a5d52e75ae008dfddac335beb3aa7acaf62abb95b6d5ce1557f0cf9b4c31ab78e110af178db1ac963bb377dbf0 0006-iio-rescale-revert-logic.patch
c3af9715b3559c2d593f4fcfa078730722c7deeec132c5b83e085ff4d9815d85ef349384097c580efe1bbc37c60f42e18ef559f0abccfe236080670e4403fa77 0007-hsi-ssi_port-force-pio-path.patch
b98ce806b3d5a0122086e4c9670639174470ff6d29851c60258cc5d699ce9a479dbf4996b24299fc075d25e9fe8f6b1250fafdff742deea0ddeaf53d342a9d72 0008-n900-dts-volume-keys.patch
66abb5548910ad369608b08200f5835d5a8526c04cc3617221ef546f3e3d22cd944db91dc6727a5c26a102b24d8ef1306ea01254c9c382759afced91b31747ef 0009-ARM-dts-disable-twl-off-idle-configuration-for-N900.patch

View file

@ -3703,7 +3703,6 @@ CONFIG_MFD_TPS65910=y
CONFIG_TWL4030_CORE=y
CONFIG_TWL4030_POWER=y
CONFIG_MFD_TWL4030_AUDIO=y
CONFIG_TWL6030_POWER=y
CONFIG_TWL6040_CORE=y
# CONFIG_MFD_WL1273_CORE is not set
# CONFIG_MFD_LM3533 is not set
@ -7245,7 +7244,7 @@ CONFIG_NLS_CODEPAGE_437=y
# CONFIG_NLS_ISO8859_8 is not set
# CONFIG_NLS_CODEPAGE_1250 is not set
# CONFIG_NLS_CODEPAGE_1251 is not set
# CONFIG_NLS_ASCII is not set
CONFIG_NLS_ASCII=y
CONFIG_NLS_ISO8859_1=y
# CONFIG_NLS_ISO8859_2 is not set
# CONFIG_NLS_ISO8859_3 is not set