Skip to content

Commit

Permalink
Add patches
Browse files Browse the repository at this point in the history
  • Loading branch information
WeirdTreeThing committed Apr 13, 2024
1 parent 8d0223c commit 8198d89
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 0 deletions.
24 changes: 24 additions & 0 deletions patches/bsw-byt-cb-sof.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
diff --git a/sound/soc/sof/core.c b/sound/soc/sof/core.c
index 425b023b0..2f14ff711 100644
--- a/sound/soc/sof/core.c
+++ b/sound/soc/sof/core.c
@@ -12,6 +12,7 @@
#include <linux/module.h>
#include <sound/soc.h>
#include <sound/sof.h>
+#include "../intel/common/soc-intel-quirks.h"
#include "sof-priv.h"
#include "sof-of-dev.h"
#include "ops.h"
@@ -578,6 +579,11 @@ int snd_sof_device_probe(struct device *dev, struct snd_sof_pdata *plat_data)
/* initialize sof device */
sdev->dev = dev;

+ /* Baytrail and Cherrytrail need debug mode enabled in order to work properly */
+ if (soc_intel_is_byt() || soc_intel_is_cht()) {
+ sof_core_debug = 1;
+ }
+
/* initialize default DSP power state */
sdev->dsp_power_state.state = SOF_DSP_PM_D0;

73 changes: 73 additions & 0 deletions patches/i2c-Add-device-property-for-probing.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
diff --git a/Documentation/devicetree/bindings/i2c/i2c.txt b/Documentation/devicetree/bindings/i2c/i2c.txt
index fc3dd7e..dc08a6c 100644
--- a/Documentation/devicetree/bindings/i2c/i2c.txt
+++ b/Documentation/devicetree/bindings/i2c/i2c.txt

@@ -137,6 +137,11 @@
- wakeup-source
device can be used as a wakeup source.

+- linux,probed
+ If this property is present, then the I2C device will be
+ probed before being added using i2c_new_scanned_device, else
+ linux will instantiate the I2C device normally.
+
Binding may contain optional "interrupts" property, describing interrupts
used by the device. I2C core will assign "irq" interrupt (or the very first
interrupt if not using interrupt names) as primary interrupt for the slave.

diff --git a/drivers/i2c/i2c-core-acpi.c b/drivers/i2c/i2c-core-acpi.c
index 4dd777c..f657f76 100644
--- a/drivers/i2c/i2c-core-acpi.c
+++ b/drivers/i2c/i2c-core-acpi.c

@@ -278,6 +278,8 @@
struct acpi_device *adev,
struct i2c_board_info *info)
{
+ struct i2c_client *client;
+
/*
* Skip registration on boards where the ACPI tables are
* known to contain bogus I2C devices.
@@ -288,7 +290,15 @@
adev->power.flags.ignore_parent = true;
acpi_device_set_enumerated(adev);

- if (IS_ERR(i2c_new_client_device(adapter, info)))
+ if (!acpi_dev_get_property(adev, "linux,probed", ACPI_TYPE_ANY, NULL)) {
+ unsigned short addrs[] = { info->addr, I2C_CLIENT_END };
+
+ client = i2c_new_scanned_device(adapter, info, addrs, NULL);
+ } else {
+ client = i2c_new_client_device(adapter, info);
+ }
+
+ if (IS_ERR(client))
adev->power.flags.ignore_parent = false;
}


diff --git a/drivers/i2c/i2c-core-of.c b/drivers/i2c/i2c-core-of.c
index 3ed74aa..fd375ce 100644
--- a/drivers/i2c/i2c-core-of.c
+++ b/drivers/i2c/i2c-core-of.c

@@ -75,7 +75,15 @@
if (ret)
return ERR_PTR(ret);

- client = i2c_new_client_device(adap, &info);
+ /* Allow device property to enable probing before init */
+ if (of_get_property(node, "linux,probed", NULL)) {
+ unsigned short addrs[] = { info.addr, I2C_CLIENT_END };
+
+ client = i2c_new_scanned_device(adap, &info, addrs, NULL);
+ } else {
+ client = i2c_new_client_device(adap, &info);
+ }
+
if (IS_ERR(client))
dev_err(&adap->dev, "of_i2c: Failure registering %pOF\n", node);


0 comments on commit 8198d89

Please sign in to comment.