Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Trying to fix HDMI problem on A20 (#2102)
Also add various Olimex hw related patches
- Loading branch information
Showing
with
2,231 additions
and 18 deletions.
- +4 −4 config/kernel/linux-sunxi-current.config
- +176 −0 patch/kernel/sunxi-current/olimex_0008-0148-hwmon-enable-thermal-for-axp803.patch.patch
- +106 −0 patch/kernel/sunxi-current/olimex_0012-board-a13-olinuxinoM.patch.patch
- +603 −0 patch/kernel/sunxi-current/olimex_0013-board-olinuxino-a64-commmon-dtsi.patch.patch
- +178 −0 patch/kernel/sunxi-current/olimex_0014-general-add-compability-olinuxino-lcd.patch.patch
- +63 −0 patch/kernel/sunxi-current/olimex_0016-input-touchscreen-sun4i-Enable-parsing.patch
- +26 −0 patch/kernel/sunxi-current/olimex_0018-net-dwmac-Apply-maximum-divider-for-clock-above-300M.patch
- +27 −0 patch/kernel/sunxi-current/olimex_0019-mmc-sunxi-Disable-DDR52-mode-on-all-A20-based-boards.patch
- +65 −0 patch/kernel/sunxi-current/olimex_0020-arm-sun7i-a20-Add-support-for-A20-OLinuXino-LIME-eMM.patch
- +13 −14 ...or_the_sun4i-hdmi.patch → olimex_0023-drm-sun4i-hdmi-Add-support-for-sun4i-HDMI-encoder-au.patch}
- +132 −0 patch/kernel/sunxi-current/olimex_0027-Added-panel-node-needed-to-fix-overlay-tests.patch
- +38 −0 patch/kernel/sunxi-current/olimex_0029-dts-sun50i-a64-olinuxino-emmc-enable-bluetooth.patch
- +41 −0 patch/kernel/sunxi-current/olimex_0030-dts-sun50i-a64-olinuxino-1Ge16GW-enable-bluetooth.patch
- +477 −0 patch/kernel/sunxi-current/olimex_0031-sun8i-s3-initial-support-needed-for-OLinuXino-S3-boa.patch
- +27 −0 patch/kernel/sunxi-current/olimex_0032-Fixed-p2m-function-name-n.patch
- +42 −0 patch/kernel/sunxi-current/olimex_0035-a64-adjust-thermal-trip-points.patch
- +27 −0 patch/kernel/sunxi-current/olimex_0036-Fix-lcd_olinuxino_10-timings.patch
- +24 −0 patch/kernel/sunxi-current/olimex_0037-Add-vqmmc-node-to-A20-Micro-emmc-dts.patch
- +25 −0 patch/kernel/sunxi-current/olimex_0038-dts-fix-lime-emmc-compatible-string.patch
- +27 −0 patch/kernel/sunxi-current/olimex_0042-Disable-clock-phase-and-hs-just-for-test.patch
- +27 −0 patch/kernel/sunxi-current/olimex_0044-lime2-enable-audio-codec.patch
- +28 −0 patch/kernel/sunxi-current/olimex_0045-lime2-enable-ldo3-always-on.patch
- +55 −0 patch/kernel/sunxi-current/olimex_0048-dts-a20-micro-a20-som-a20-som204-decrease-dcdc2-min-.patch
| @@ -0,0 +1,176 @@ | ||
| From c8d43dfa8fd0e66dd1fd25cf8a9bf0f13add1910 Mon Sep 17 00:00:00 2001 | ||
| From: Mitko Gamishev <hehopmajieh@debian.bg> | ||
| Date: Wed, 5 Feb 2020 14:57:10 +0200 | ||
| Subject: [PATCH 08/48] 0148-hwmon-enable-thermal-for-axp803.patch | ||
|
|
||
| --- | ||
| arch/arm64/boot/dts/allwinner/axp803.dtsi | 1 + | ||
| drivers/iio/adc/axp20x_adc.c | 89 ++++++++++++++++++++++- | ||
| 2 files changed, 89 insertions(+), 1 deletion(-) | ||
|
|
||
| diff --git a/arch/arm64/boot/dts/allwinner/axp803.dtsi b/arch/arm64/boot/dts/allwinner/axp803.dtsi | ||
| index 10e9186a76bf..43276d88b61b 100644 | ||
| --- a/arch/arm64/boot/dts/allwinner/axp803.dtsi | ||
| +++ b/arch/arm64/boot/dts/allwinner/axp803.dtsi | ||
| @@ -19,6 +19,7 @@ ac_power_supply: ac-power-supply { | ||
| axp_adc: adc { | ||
| compatible = "x-powers,axp803-adc", "x-powers,axp813-adc"; | ||
| #io-channel-cells = <1>; | ||
| + #thermal-sensor-cells = <0>; | ||
| }; | ||
|
|
||
| axp_gpio: gpio { | ||
| diff --git a/drivers/iio/adc/axp20x_adc.c b/drivers/iio/adc/axp20x_adc.c | ||
| index 88059480da17..d5370d144f77 100644 | ||
| --- a/drivers/iio/adc/axp20x_adc.c | ||
| +++ b/drivers/iio/adc/axp20x_adc.c | ||
| @@ -6,6 +6,7 @@ | ||
| */ | ||
|
|
||
| #include <linux/completion.h> | ||
| +#include <linux/hwmon.h> | ||
| #include <linux/interrupt.h> | ||
| #include <linux/io.h> | ||
| #include <linux/module.h> | ||
| @@ -14,7 +15,6 @@ | ||
| #include <linux/platform_device.h> | ||
| #include <linux/pm_runtime.h> | ||
| #include <linux/regmap.h> | ||
| -#include <linux/thermal.h> | ||
|
|
||
| #include <linux/iio/iio.h> | ||
| #include <linux/iio/driver.h> | ||
| @@ -594,6 +594,74 @@ static int axp813_adc_rate(struct axp20x_adc_iio *info, int rate) | ||
| AXP813_ADC_RATE_HZ(rate)); | ||
| } | ||
|
|
||
| + | ||
| +static umode_t axp813_adc_hwmon_is_visible(const void *data, | ||
| + enum hwmon_sensor_types type, | ||
| + u32 attr, int channel) | ||
| +{ | ||
| + return (type == hwmon_temp && attr == hwmon_temp_input) ? 0444 : 0; | ||
| +} | ||
| + | ||
| +static int axp813_adc_hwmon_read(struct device *dev, | ||
| + enum hwmon_sensor_types type, | ||
| + u32 attr, int channel, long *temp) | ||
| +{ | ||
| + struct axp20x_adc_iio *info = dev_get_drvdata(dev); | ||
| + int ret; | ||
| + int raw; | ||
| + | ||
| + switch (attr) { | ||
| + case hwmon_temp_input: | ||
| + raw = axp20x_read_variable_width(info->regmap, AXP22X_PMIC_TEMP_H, 12); | ||
| + *temp = (raw - 2667) * 100; | ||
| + ret = 0; | ||
| + break; | ||
| + default: | ||
| + ret = -EOPNOTSUPP; | ||
| + break; | ||
| + } | ||
| + | ||
| + return ret; | ||
| +} | ||
| + | ||
| +static u32 axp813_adc_hwmon_chip_config[] = { | ||
| + HWMON_C_REGISTER_TZ, | ||
| + 0 | ||
| +}; | ||
| + | ||
| +static const struct hwmon_channel_info axp813_adc_hwmon_chip = { | ||
| + .type = hwmon_chip, | ||
| + .config = axp813_adc_hwmon_chip_config, | ||
| +}; | ||
| + | ||
| +static u32 axp813_adc_hwmon_temp_config[] = { | ||
| + HWMON_T_INPUT, | ||
| + 0 | ||
| +}; | ||
| + | ||
| + | ||
| +static const struct hwmon_channel_info axp813_adc_hwmon_temp = { | ||
| + .type = hwmon_temp, | ||
| + .config = axp813_adc_hwmon_temp_config, | ||
| +}; | ||
| + | ||
| + | ||
| +static const struct hwmon_channel_info *axp813_adc_hwmon_info[] = { | ||
| + &axp813_adc_hwmon_chip, | ||
| + &axp813_adc_hwmon_temp, | ||
| + NULL | ||
| +}; | ||
| + | ||
| +static const struct hwmon_ops axp813_adc_hwmon_hwmon_ops = { | ||
| + .is_visible = axp813_adc_hwmon_is_visible, | ||
| + .read = axp813_adc_hwmon_read, | ||
| +}; | ||
| + | ||
| +static const struct hwmon_chip_info axp813_adc_hwmon_chip_info = { | ||
| + .ops = &axp813_adc_hwmon_hwmon_ops, | ||
| + .info = axp813_adc_hwmon_info, | ||
| +}; | ||
| + | ||
| struct axp_data { | ||
| const struct iio_info *iio_info; | ||
| int num_channels; | ||
| @@ -602,6 +670,7 @@ struct axp_data { | ||
| int (*adc_rate)(struct axp20x_adc_iio *info, | ||
| int rate); | ||
| bool adc_en2; | ||
| + bool hwmon_en; | ||
| struct iio_map *maps; | ||
| }; | ||
|
|
||
| @@ -612,6 +681,7 @@ static const struct axp_data axp20x_data = { | ||
| .adc_en1_mask = AXP20X_ADC_EN1_MASK, | ||
| .adc_rate = axp20x_adc_rate, | ||
| .adc_en2 = true, | ||
| + .hwmon_en = false, | ||
| .maps = axp20x_maps, | ||
| }; | ||
|
|
||
| @@ -622,6 +692,7 @@ static const struct axp_data axp22x_data = { | ||
| .adc_en1_mask = AXP22X_ADC_EN1_MASK, | ||
| .adc_rate = axp22x_adc_rate, | ||
| .adc_en2 = false, | ||
| + .hwmon_en = false, | ||
| .maps = axp22x_maps, | ||
| }; | ||
|
|
||
| @@ -632,6 +703,7 @@ static const struct axp_data axp813_data = { | ||
| .adc_en1_mask = AXP22X_ADC_EN1_MASK, | ||
| .adc_rate = axp813_adc_rate, | ||
| .adc_en2 = false, | ||
| + .hwmon_en = true, | ||
| .maps = axp22x_maps, | ||
| }; | ||
|
|
||
| @@ -711,8 +783,23 @@ static int axp20x_probe(struct platform_device *pdev) | ||
| goto fail_register; | ||
| } | ||
|
|
||
| + if (info->data->hwmon_en) { | ||
| + /* Register hwmon device */ | ||
| + struct device *hwmon_dev; | ||
| + | ||
| + hwmon_dev = devm_hwmon_device_register_with_info(&pdev->dev, "axp813_adc", info, &axp813_adc_hwmon_chip_info, NULL); | ||
| + if (IS_ERR(hwmon_dev)) { | ||
| + ret = PTR_ERR(hwmon_dev); | ||
| + dev_err(&pdev->dev, "unable to register hwmon device %d\n", ret); | ||
| + goto fail_hwmon; | ||
| + } | ||
| + } | ||
| + | ||
| return 0; | ||
|
|
||
| +fail_hwmon: | ||
| + iio_device_unregister(indio_dev); | ||
| + | ||
| fail_register: | ||
| iio_map_array_unregister(indio_dev); | ||
|
|
||
| -- | ||
| 2.25.1 | ||
|
|
| @@ -0,0 +1,106 @@ | ||
| From f41220f93142aa088d5b111d09a8c11b7a096f71 Mon Sep 17 00:00:00 2001 | ||
| From: Mitko Gamishev <hehopmajieh@debian.bg> | ||
| Date: Wed, 5 Feb 2020 15:00:25 +0200 | ||
| Subject: [PATCH 12/48] board-a13-olinuxinoM.patch | ||
|
|
||
| --- | ||
| .../boot/dts/sun5i-a13-olinuxino-micro.dts | 62 ++++++++++++++++++- | ||
| 1 file changed, 60 insertions(+), 2 deletions(-) | ||
|
|
||
| diff --git a/arch/arm/boot/dts/sun5i-a13-olinuxino-micro.dts b/arch/arm/boot/dts/sun5i-a13-olinuxino-micro.dts | ||
| index 5df398d77238..b12976499cb5 100644 | ||
| --- a/arch/arm/boot/dts/sun5i-a13-olinuxino-micro.dts | ||
| +++ b/arch/arm/boot/dts/sun5i-a13-olinuxino-micro.dts | ||
| @@ -44,7 +44,7 @@ | ||
| /dts-v1/; | ||
| #include "sun5i-a13.dtsi" | ||
| #include "sunxi-common-regulators.dtsi" | ||
| - | ||
| +#include <dt-bindings/pwm/pwm.h> | ||
| #include <dt-bindings/gpio/gpio.h> | ||
|
|
||
| / { | ||
| @@ -70,6 +70,40 @@ power { | ||
| default-state = "on"; | ||
| }; | ||
| }; | ||
| + | ||
| + backlight: backlight { | ||
| + compatible = "pwm-backlight"; | ||
| + pwms = <&pwm 0 50000 PWM_POLARITY_INVERTED>; | ||
| + brightness-levels = <0 10 20 30 40 50 60 70 80 90 100>; | ||
| + default-brightness-level = <8>; | ||
| + | ||
| + }; | ||
| + | ||
| + panel: panel { | ||
| + compatible = "olimex,lcd-olinuxino-4.3"; | ||
| + backlight = <&backlight>; | ||
| + enable-gpios = <&pio 1 10 GPIO_ACTIVE_HIGH>; /* PB10 */ | ||
| + pinctrl-names = "default"; | ||
| + #address-cells = <1>; | ||
| + #size-cells = <0>; | ||
| + port { | ||
| + panel_input: endpoint { | ||
| + remote-endpoint = <&tcon0_out_lcd>; | ||
| + }; | ||
| + }; | ||
| + | ||
| + }; | ||
| + | ||
| + }; | ||
| + | ||
| + | ||
| + | ||
| +&be0 { | ||
| + status = "okay"; | ||
| +}; | ||
| + | ||
| +&codec { | ||
| + status = "okay"; | ||
| }; | ||
|
|
||
| &ehci0 { | ||
| @@ -117,10 +151,28 @@ ®_usb0_vbus { | ||
| }; | ||
|
|
||
| ®_usb1_vbus { | ||
| - gpio = <&pio 6 11 GPIO_ACTIVE_HIGH>; | ||
| + gpio = <&pio 2 19 GPIO_ACTIVE_HIGH>; | ||
| status = "okay"; | ||
| }; | ||
|
|
||
| +&tcon0 { | ||
| + pinctrl-names = "default"; | ||
| + pinctrl-0 = <&lcd_rgb666_pins>; | ||
| + status = "okay"; | ||
| +}; | ||
| +&tcon0_out { | ||
| + tcon0_out_lcd: endpoint@0 { | ||
| + reg = <0>; | ||
| + remote-endpoint = <&panel_input>; | ||
| + }; | ||
| +}; | ||
| + | ||
| +&pwm { | ||
| + pinctrl-names = "default"; | ||
| + pinctrl-0 = <&pwm0_pin>; | ||
| + status = "okay"; | ||
| +}; | ||
| + | ||
| &uart1 { | ||
| pinctrl-names = "default"; | ||
| pinctrl-0 = <&uart1_pg_pins>; | ||
| @@ -139,3 +191,9 @@ &usbphy { | ||
| usb1_vbus-supply = <®_usb1_vbus>; | ||
| status = "okay"; | ||
| }; | ||
| + | ||
| +&rtp { | ||
| + allwinner,ts-attached; | ||
| + touchscreen-inverted-x; | ||
| +}; | ||
| + | ||
| -- | ||
| 2.25.1 | ||
|
|
Oops, something went wrong.