Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
12 changed files
with
9,243 additions
and
64 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
55 changes: 55 additions & 0 deletions
55
srcpkgs/pinebookpro-kernel/patches/0001-tty-serdev-support-shutdown-op.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
From 7e8fc396d34f6c9f536cb9540f212a2fd0f11685 Mon Sep 17 00:00:00 2001 | ||
From: Tobias Schramm <t.schramm@manjaro.org> | ||
Date: Thu, 28 May 2020 14:12:56 +0200 | ||
Subject: [PATCH 1/8] tty: serdev: support shutdown op | ||
|
||
Allow serdev drivers to register a shutdown handler | ||
|
||
Signed-off-by: Tobias Schramm <t.schramm@manjaro.org> | ||
--- | ||
drivers/tty/serdev/core.c | 11 +++++++++++ | ||
include/linux/serdev.h | 1 + | ||
2 files changed, 12 insertions(+) | ||
|
||
diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c | ||
index c5f0d936b003..37e45c356540 100644 | ||
--- a/drivers/tty/serdev/core.c | ||
+++ b/drivers/tty/serdev/core.c | ||
@@ -432,11 +432,22 @@ static int serdev_drv_remove(struct device *dev) | ||
return 0; | ||
} | ||
|
||
+static void serdev_drv_shutdown(struct device *dev) | ||
+{ | ||
+ const struct serdev_device_driver *sdrv; | ||
+ if (dev->driver) { | ||
+ sdrv = to_serdev_device_driver(dev->driver); | ||
+ if (sdrv->shutdown) | ||
+ sdrv->shutdown(to_serdev_device(dev)); | ||
+ } | ||
+} | ||
+ | ||
static struct bus_type serdev_bus_type = { | ||
.name = "serial", | ||
.match = serdev_device_match, | ||
.probe = serdev_drv_probe, | ||
.remove = serdev_drv_remove, | ||
+ .shutdown = serdev_drv_shutdown, | ||
}; | ||
|
||
/** | ||
diff --git a/include/linux/serdev.h b/include/linux/serdev.h | ||
index 9f14f9c12ec4..94050561325c 100644 | ||
--- a/include/linux/serdev.h | ||
+++ b/include/linux/serdev.h | ||
@@ -63,6 +63,7 @@ struct serdev_device_driver { | ||
struct device_driver driver; | ||
int (*probe)(struct serdev_device *); | ||
void (*remove)(struct serdev_device *); | ||
+ void (*shutdown)(struct serdev_device *); | ||
}; | ||
|
||
static inline struct serdev_device_driver *to_serdev_device_driver(struct device_driver *d) | ||
-- | ||
2.28.0 | ||
|
25 changes: 25 additions & 0 deletions
25
...inebookpro-kernel/patches/0002-bluetooth-hci_serdev-Clear-registered-bit-on-unregis.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
From 8e3da546a76245e9f45323cc2725cf24637bc571 Mon Sep 17 00:00:00 2001 | ||
From: Tobias Schramm <t.schramm@manjaro.org> | ||
Date: Thu, 28 May 2020 14:14:06 +0200 | ||
Subject: [PATCH 2/8] bluetooth: hci_serdev: Clear registered bit on unregister | ||
|
||
Signed-off-by: Tobias Schramm <t.schramm@manjaro.org> | ||
--- | ||
drivers/bluetooth/hci_serdev.c | 2 ++ | ||
1 file changed, 2 insertions(+) | ||
|
||
diff --git a/drivers/bluetooth/hci_serdev.c b/drivers/bluetooth/hci_serdev.c | ||
index 7b233312e723..f2fcefeb99e0 100644 | ||
--- a/drivers/bluetooth/hci_serdev.c | ||
+++ b/drivers/bluetooth/hci_serdev.c | ||
@@ -363,5 +363,7 @@ void hci_uart_unregister_device(struct hci_uart *hu) | ||
|
||
hu->proto->close(hu); | ||
serdev_device_close(hu->serdev); | ||
+ | ||
+ clear_bit(HCI_UART_REGISTERED, &hu->flags); | ||
} | ||
EXPORT_SYMBOL_GPL(hci_uart_unregister_device); | ||
-- | ||
2.28.0 | ||
|
51 changes: 51 additions & 0 deletions
51
srcpkgs/pinebookpro-kernel/patches/0003-bluetooth-hci_bcm-disable-power-on-shutdown.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
From c057897812518b6c2366d8102643bcdf66592c4b Mon Sep 17 00:00:00 2001 | ||
From: Tobias Schramm <t.schramm@manjaro.org> | ||
Date: Thu, 28 May 2020 14:15:08 +0200 | ||
Subject: [PATCH 3/8] bluetooth: hci_bcm: disable power on shutdown | ||
|
||
Firmware behaves wonky when not power cycled over reboots | ||
|
||
Signed-off-by: Tobias Schramm <t.schramm@manjaro.org> | ||
--- | ||
drivers/bluetooth/hci_bcm.c | 18 ++++++++++++++++++ | ||
1 file changed, 18 insertions(+) | ||
|
||
diff --git a/drivers/bluetooth/hci_bcm.c b/drivers/bluetooth/hci_bcm.c | ||
index 8ea5ca8d71d6..6d5871992f79 100644 | ||
--- a/drivers/bluetooth/hci_bcm.c | ||
+++ b/drivers/bluetooth/hci_bcm.c | ||
@@ -1469,6 +1469,23 @@ static void bcm_serdev_remove(struct serdev_device *serdev) | ||
hci_uart_unregister_device(&bcmdev->serdev_hu); | ||
} | ||
|
||
+static void bcm_serdev_shutdown(struct serdev_device *serdev) | ||
+{ | ||
+ struct bcm_device *bcmdev = serdev_device_get_drvdata(serdev); | ||
+ | ||
+/* | ||
+ if (test_bit(HCI_UART_REGISTERED, &bcmdev->hu->flags)) { | ||
+ hci_uart_unregister_device(&bcmdev->serdev_hu); | ||
+ } | ||
+*/ | ||
+ dev_info(bcmdev->dev, "Cutting power to bluetooth module\n"); | ||
+ if (bcm_gpio_set_power(bcmdev, false)) { | ||
+ dev_err(bcmdev->dev, "Failed to power down\n"); | ||
+ } | ||
+ usleep_range(500000, 1000000); | ||
+} | ||
+ | ||
+ | ||
#ifdef CONFIG_OF | ||
static struct bcm_device_data bcm4354_device_data = { | ||
.no_early_set_baudrate = true, | ||
@@ -1494,6 +1511,7 @@ MODULE_DEVICE_TABLE(of, bcm_bluetooth_of_match); | ||
static struct serdev_device_driver bcm_serdev_driver = { | ||
.probe = bcm_serdev_probe, | ||
.remove = bcm_serdev_remove, | ||
+ .shutdown = bcm_serdev_shutdown, | ||
.driver = { | ||
.name = "hci_uart_bcm", | ||
.of_match_table = of_match_ptr(bcm_bluetooth_of_match), | ||
-- | ||
2.28.0 | ||
|
64 changes: 64 additions & 0 deletions
64
...inebookpro-kernel/patches/0004-mmc-core-pwrseq_simple-disable-mmc-power-on-shutdown.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
From 43f1e05b9b660d3d4763ebc406ef5ea667ba64f9 Mon Sep 17 00:00:00 2001 | ||
From: Tobias Schramm <t.schramm@manjaro.org> | ||
Date: Thu, 28 May 2020 14:16:52 +0200 | ||
Subject: [PATCH 4/8] mmc: core: pwrseq_simple: disable mmc power on shutdown | ||
|
||
Fix for Broadcom SDIO WiFi modules. They misbehave if reinitialized | ||
without a power cycle. | ||
|
||
Signed-off-by: Tobias Schramm <t.schramm@manjaro.org> | ||
--- | ||
drivers/mmc/core/pwrseq_simple.c | 19 ++++++++++++++++--- | ||
1 file changed, 16 insertions(+), 3 deletions(-) | ||
|
||
diff --git a/drivers/mmc/core/pwrseq_simple.c b/drivers/mmc/core/pwrseq_simple.c | ||
index ea4d3670560e..38fe7e29aba6 100644 | ||
--- a/drivers/mmc/core/pwrseq_simple.c | ||
+++ b/drivers/mmc/core/pwrseq_simple.c | ||
@@ -80,10 +80,8 @@ static void mmc_pwrseq_simple_post_power_on(struct mmc_host *host) | ||
msleep(pwrseq->post_power_on_delay_ms); | ||
} | ||
|
||
-static void mmc_pwrseq_simple_power_off(struct mmc_host *host) | ||
+static void __mmc_pwrseq_simple_power_off(struct mmc_pwrseq_simple *pwrseq) | ||
{ | ||
- struct mmc_pwrseq_simple *pwrseq = to_pwrseq_simple(host->pwrseq); | ||
- | ||
mmc_pwrseq_simple_set_gpios_value(pwrseq, 1); | ||
|
||
if (pwrseq->power_off_delay_us) | ||
@@ -96,6 +94,12 @@ static void mmc_pwrseq_simple_power_off(struct mmc_host *host) | ||
} | ||
} | ||
|
||
+static void mmc_pwrseq_simple_power_off(struct mmc_host *host) | ||
+{ | ||
+ struct mmc_pwrseq_simple *pwrseq = to_pwrseq_simple(host->pwrseq); | ||
+ __mmc_pwrseq_simple_power_off(pwrseq); | ||
+} | ||
+ | ||
static const struct mmc_pwrseq_ops mmc_pwrseq_simple_ops = { | ||
.pre_power_on = mmc_pwrseq_simple_pre_power_on, | ||
.post_power_on = mmc_pwrseq_simple_post_power_on, | ||
@@ -151,9 +155,18 @@ static int mmc_pwrseq_simple_remove(struct platform_device *pdev) | ||
return 0; | ||
} | ||
|
||
+static void mmc_pwrseq_simple_shutdown(struct platform_device *pdev) | ||
+{ | ||
+ struct mmc_pwrseq_simple *pwrseq = platform_get_drvdata(pdev); | ||
+ | ||
+ dev_info(&pdev->dev, "Turning off mmc\n"); | ||
+ __mmc_pwrseq_simple_power_off(pwrseq); | ||
+} | ||
+ | ||
static struct platform_driver mmc_pwrseq_simple_driver = { | ||
.probe = mmc_pwrseq_simple_probe, | ||
.remove = mmc_pwrseq_simple_remove, | ||
+ .shutdown = mmc_pwrseq_simple_shutdown, | ||
.driver = { | ||
.name = "pwrseq_simple", | ||
.of_match_table = mmc_pwrseq_simple_of_match, | ||
-- | ||
2.28.0 | ||
|
30 changes: 30 additions & 0 deletions
30
...inebookpro-kernel/patches/0005-sound-soc-codecs-es8316-Run-micdetect-only-if-jack-s.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
From 719cceae6ab58d6d9e168ca7de92eb9e22a2d7ea Mon Sep 17 00:00:00 2001 | ||
From: Tobias Schramm <t.schramm@manjaro.org> | ||
Date: Thu, 28 May 2020 14:34:47 +0200 | ||
Subject: [PATCH 5/8] sound: soc: codecs: es8316: Run micdetect only if jack | ||
status asserted | ||
|
||
Think this is (was?) required to prevent flapping of detection status on | ||
the PBP. | ||
|
||
Signed-off-by: Tobias Schramm <t.schramm@manjaro.org> | ||
--- | ||
sound/soc/codecs/es8316.c | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/sound/soc/codecs/es8316.c b/sound/soc/codecs/es8316.c | ||
index bd5d230c5df2..a2d8bf620b6f 100644 | ||
--- a/sound/soc/codecs/es8316.c | ||
+++ b/sound/soc/codecs/es8316.c | ||
@@ -688,7 +688,7 @@ static void es8316_disable_jack_detect(struct snd_soc_component *component) | ||
snd_soc_component_update_bits(component, ES8316_GPIO_DEBOUNCE, | ||
ES8316_GPIO_ENABLE_INTERRUPT, 0); | ||
|
||
- if (es8316->jack->status & SND_JACK_MICROPHONE) { | ||
+ if (es8316->jack && (es8316->jack->status & SND_JACK_MICROPHONE)) { | ||
es8316_disable_micbias_for_mic_gnd_short_detect(component); | ||
snd_soc_jack_report(es8316->jack, 0, SND_JACK_BTN_0); | ||
} | ||
-- | ||
2.28.0 | ||
|
45 changes: 45 additions & 0 deletions
45
...inebookpro-kernel/patches/0006-ASoC-soc-jack.c-supported-inverted-jack-detect-GPIOs.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
From f4f362ffaf99101d69462b0579fd48fa632ef1dc Mon Sep 17 00:00:00 2001 | ||
From: Tobias Schramm <t.schramm@manjaro.org> | ||
Date: Thu, 28 May 2020 14:36:47 +0200 | ||
Subject: [PATCH 6/8] ASoC: soc-jack.c: supported inverted jack detect GPIOs | ||
|
||
Signed-off-by: Tobias Schramm <t.schramm@manjaro.org> | ||
--- | ||
sound/soc/soc-jack.c | 7 ++++--- | ||
1 file changed, 4 insertions(+), 3 deletions(-) | ||
|
||
diff --git a/sound/soc/soc-jack.c b/sound/soc/soc-jack.c | ||
index 0f1820f36b4d..8d9d77814f33 100644 | ||
--- a/sound/soc/soc-jack.c | ||
+++ b/sound/soc/soc-jack.c | ||
@@ -216,8 +216,6 @@ static void snd_soc_jack_gpio_detect(struct snd_soc_jack_gpio *gpio) | ||
int report; | ||
|
||
enable = gpiod_get_value_cansleep(gpio->desc); | ||
- if (gpio->invert) | ||
- enable = !enable; | ||
|
||
if (enable) | ||
report = gpio->report; | ||
@@ -346,6 +344,9 @@ int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count, | ||
goto undo; | ||
} | ||
} else { | ||
+ int flags = GPIOF_IN; | ||
+ if (gpios[i].invert) | ||
+ flags |= GPIOF_ACTIVE_LOW; | ||
/* legacy GPIO number */ | ||
if (!gpio_is_valid(gpios[i].gpio)) { | ||
dev_err(jack->card->dev, | ||
@@ -355,7 +356,7 @@ int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count, | ||
goto undo; | ||
} | ||
|
||
- ret = gpio_request_one(gpios[i].gpio, GPIOF_IN, | ||
+ ret = gpio_request_one(gpios[i].gpio, flags, | ||
gpios[i].name); | ||
if (ret) | ||
goto undo; | ||
-- | ||
2.28.0 | ||
|
25 changes: 25 additions & 0 deletions
25
srcpkgs/pinebookpro-kernel/patches/0007-arm64-dts-rockchip-enable-earlycon.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
From e7c2bf27666b74f47c1d64c34ac02e037afa5697 Mon Sep 17 00:00:00 2001 | ||
From: Tobias Schramm <t.schramm@manjaro.org> | ||
Date: Thu, 28 May 2020 14:39:55 +0200 | ||
Subject: [PATCH 7/8] arm64: dts: rockchip: enable earlycon | ||
|
||
Signed-off-by: Tobias Schramm <t.schramm@manjaro.org> | ||
--- | ||
arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts | 1 + | ||
1 file changed, 1 insertion(+) | ||
|
||
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts | ||
index 06d48338c836..c1aad8f88b8a 100644 | ||
--- a/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts | ||
+++ b/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts | ||
@@ -19,6 +19,7 @@ / { | ||
compatible = "pine64,pinebook-pro", "rockchip,rk3399"; | ||
|
||
chosen { | ||
+ bootargs = "earlycon=uart8250,mmio32,0xff1a0000"; | ||
stdout-path = "serial2:1500000n8"; | ||
}; | ||
|
||
-- | ||
2.28.0 | ||
|
31 changes: 31 additions & 0 deletions
31
...inebookpro-kernel/patches/0008-arm64-dts-rockchip-setup-USB-type-c-port-as-dual-dat.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
From 4a4127fde03791fc42e36241cc5781ceb5273a1f Mon Sep 17 00:00:00 2001 | ||
From: Tobias Schramm <t.schramm@manjaro.org> | ||
Date: Sat, 6 Jun 2020 23:45:10 +0200 | ||
Subject: [PATCH 8/8] arm64: dts: rockchip: setup USB type c port as dual data | ||
role | ||
|
||
Some chargers try to put the charged device into device data role. | ||
Before this commit this condition caused the tcpm state machine to | ||
issue a hard reset due to a capability missmatch. | ||
|
||
Signed-off-by: Tobias Schramm <t.schramm@manjaro.org> | ||
--- | ||
arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts b/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts | ||
index c1aad8f88b8a..45a870ce5d22 100644 | ||
--- a/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts | ||
+++ b/arch/arm64/boot/dts/rockchip/rk3399-pinebook-pro.dts | ||
@@ -706,7 +706,7 @@ fusb0: fusb30x@22 { | ||
|
||
connector { | ||
compatible = "usb-c-connector"; | ||
- data-role = "host"; | ||
+ data-role = "dual"; | ||
label = "USB-C"; | ||
op-sink-microwatt = <1000000>; | ||
power-role = "dual"; | ||
-- | ||
2.28.0 | ||
|
This file was deleted.
Oops, something went wrong.
37 changes: 0 additions & 37 deletions
37
srcpkgs/pinebookpro-kernel/patches/wireless_h-fix-include.patch
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.