* [PATCH 1/2] ASoC: rt298: fix null deref on acpi driver data
@ 2016-05-12 4:08 Vinod Koul
2016-05-12 4:08 ` [PATCH 2/2] ASoC: rt298: Add DMI match for Broxton-P reference platform Vinod Koul
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Vinod Koul @ 2016-05-12 4:08 UTC (permalink / raw
To: alsa-devel
Cc: patches.audio, liam.r.girdwood, Vinod Koul, broonie, Bard Liao,
Senthilnathan Veppur
ACPI driver data can be NULL so we need to check that before
dereference the driver data.
Signed-off-by: Senthilnathan Veppur <senthilnathanx.veppur@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
sound/soc/codecs/rt298.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/rt298.c b/sound/soc/codecs/rt298.c
index 68cf8d5a174f..45dc5fa24961 100644
--- a/sound/soc/codecs/rt298.c
+++ b/sound/soc/codecs/rt298.c
@@ -1179,7 +1179,7 @@ static int rt298_i2c_probe(struct i2c_client *i2c,
/* enable jack combo mode on supported devices */
acpiid = acpi_match_device(dev->driver->acpi_match_table, dev);
- if (acpiid) {
+ if (acpiid && acpiid->driver_data) {
rt298->pdata = *(struct rt298_platform_data *)
acpiid->driver_data;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] ASoC: rt298: Add DMI match for Broxton-P reference platform
2016-05-12 4:08 [PATCH 1/2] ASoC: rt298: fix null deref on acpi driver data Vinod Koul
@ 2016-05-12 4:08 ` Vinod Koul
2016-05-12 5:59 ` Bard Liao
2016-05-13 7:59 ` Applied "ASoC: rt298: Add DMI match for Broxton-P reference platform" to the asoc tree Mark Brown
2016-05-12 5:59 ` [PATCH 1/2] ASoC: rt298: fix null deref on acpi driver data Bard Liao
2016-05-13 7:59 ` Applied "ASoC: rt298: fix null deref on acpi driver data" to the asoc tree Mark Brown
2 siblings, 2 replies; 6+ messages in thread
From: Vinod Koul @ 2016-05-12 4:08 UTC (permalink / raw
To: alsa-devel
Cc: patches.audio, Ramesh Babu, liam.r.girdwood, Vinod Koul, broonie,
Senthilnathan Veppur, Bard Liao
Broxton-P reference platform also uses combo jack for audio
connector so we need to set codec pdata to use this based on DMI
match for this board.
Signed-off-by: Ramesh Babu <ramesh.babu@intel.com>
Signed-off-by: Senthilnathan Veppur <senthilnathanx.veppur@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
---
sound/soc/codecs/rt298.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/sound/soc/codecs/rt298.c b/sound/soc/codecs/rt298.c
index 45dc5fa24961..f80cfe4d2ef2 100644
--- a/sound/soc/codecs/rt298.c
+++ b/sound/soc/codecs/rt298.c
@@ -17,6 +17,7 @@
#include <linux/i2c.h>
#include <linux/platform_device.h>
#include <linux/spi/spi.h>
+#include <linux/dmi.h>
#include <linux/acpi.h>
#include <sound/core.h>
#include <sound/pcm.h>
@@ -1127,6 +1128,17 @@ static const struct acpi_device_id rt298_acpi_match[] = {
};
MODULE_DEVICE_TABLE(acpi, rt298_acpi_match);
+static const struct dmi_system_id force_combo_jack_table[] = {
+ {
+ .ident = "Intel Broxton P",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Intel Corp"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "Broxton P")
+ }
+ },
+ { }
+};
+
static int rt298_i2c_probe(struct i2c_client *i2c,
const struct i2c_device_id *id)
{
@@ -1184,6 +1196,11 @@ static int rt298_i2c_probe(struct i2c_client *i2c,
acpiid->driver_data;
}
+ if (dmi_check_system(force_combo_jack_table)) {
+ rt298->pdata.cbj_en = true;
+ rt298->pdata.gpio2_en = false;
+ }
+
/* VREF Charging */
regmap_update_bits(rt298->regmap, 0x04, 0x80, 0x80);
regmap_update_bits(rt298->regmap, 0x1b, 0x860, 0x860);
--
1.9.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] ASoC: rt298: fix null deref on acpi driver data
2016-05-12 4:08 [PATCH 1/2] ASoC: rt298: fix null deref on acpi driver data Vinod Koul
2016-05-12 4:08 ` [PATCH 2/2] ASoC: rt298: Add DMI match for Broxton-P reference platform Vinod Koul
@ 2016-05-12 5:59 ` Bard Liao
2016-05-13 7:59 ` Applied "ASoC: rt298: fix null deref on acpi driver data" to the asoc tree Mark Brown
2 siblings, 0 replies; 6+ messages in thread
From: Bard Liao @ 2016-05-12 5:59 UTC (permalink / raw
To: Vinod Koul, alsa-devel@alsa-project.org
Cc: liam.r.girdwood@linux.intel.com, patches.audio@intel.com,
broonie@kernel.org, Senthilnathan Veppur
> -----Original Message-----
> From: Vinod Koul [mailto:vinod.koul@intel.com]
> Sent: Thursday, May 12, 2016 12:09 PM
> To: alsa-devel@alsa-project.org
> Cc: broonie@kernel.org; liam.r.girdwood@linux.intel.com;
> patches.audio@intel.com; Bard Liao; Vinod Koul; Senthilnathan Veppur
> Subject: [PATCH 1/2] ASoC: rt298: fix null deref on acpi driver data
>
> ACPI driver data can be NULL so we need to check that before
> dereference the driver data.
>
> Signed-off-by: Senthilnathan Veppur <senthilnathanx.veppur@intel.com>
> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Bard Liao <bardliao@realtek.com>
> ---
> sound/soc/codecs/rt298.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sound/soc/codecs/rt298.c b/sound/soc/codecs/rt298.c index
> 68cf8d5a174f..45dc5fa24961 100644
> --- a/sound/soc/codecs/rt298.c
> +++ b/sound/soc/codecs/rt298.c
> @@ -1179,7 +1179,7 @@ static int rt298_i2c_probe(struct i2c_client
> *i2c,
>
> /* enable jack combo mode on supported devices */
> acpiid = acpi_match_device(dev->driver->acpi_match_table, dev);
> - if (acpiid) {
> + if (acpiid && acpiid->driver_data) {
> rt298->pdata = *(struct rt298_platform_data *)
> acpiid->driver_data;
> }
> --
> 1.9.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] ASoC: rt298: Add DMI match for Broxton-P reference platform
2016-05-12 4:08 ` [PATCH 2/2] ASoC: rt298: Add DMI match for Broxton-P reference platform Vinod Koul
@ 2016-05-12 5:59 ` Bard Liao
2016-05-13 7:59 ` Applied "ASoC: rt298: Add DMI match for Broxton-P reference platform" to the asoc tree Mark Brown
1 sibling, 0 replies; 6+ messages in thread
From: Bard Liao @ 2016-05-12 5:59 UTC (permalink / raw
To: Vinod Koul, alsa-devel@alsa-project.org
Cc: liam.r.girdwood@linux.intel.com, patches.audio@intel.com,
broonie@kernel.org, Ramesh Babu, Senthilnathan Veppur
> -----Original Message-----
> From: Vinod Koul [mailto:vinod.koul@intel.com]
> Sent: Thursday, May 12, 2016 12:09 PM
> To: alsa-devel@alsa-project.org
> Cc: broonie@kernel.org; liam.r.girdwood@linux.intel.com;
> patches.audio@intel.com; Bard Liao; Vinod Koul; Ramesh Babu;
> Senthilnathan Veppur
> Subject: [PATCH 2/2] ASoC: rt298: Add DMI match for Broxton-P
> reference platform
>
> Broxton-P reference platform also uses combo jack for audio connector
> so we need to set codec pdata to use this based on DMI match for this
> board.
>
> Signed-off-by: Ramesh Babu <ramesh.babu@intel.com>
> Signed-off-by: Senthilnathan Veppur <senthilnathanx.veppur@intel.com>
> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Bard Liao <bardliao@realtek.com>
> ---
> sound/soc/codecs/rt298.c | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
> diff --git a/sound/soc/codecs/rt298.c b/sound/soc/codecs/rt298.c index
> 45dc5fa24961..f80cfe4d2ef2 100644
> --- a/sound/soc/codecs/rt298.c
> +++ b/sound/soc/codecs/rt298.c
> @@ -17,6 +17,7 @@
> #include <linux/i2c.h>
> #include <linux/platform_device.h>
> #include <linux/spi/spi.h>
> +#include <linux/dmi.h>
> #include <linux/acpi.h>
> #include <sound/core.h>
> #include <sound/pcm.h>
> @@ -1127,6 +1128,17 @@ static const struct acpi_device_id
> rt298_acpi_match[] = { }; MODULE_DEVICE_TABLE(acpi,
> rt298_acpi_match);
>
> +static const struct dmi_system_id force_combo_jack_table[] = {
> + {
> + .ident = "Intel Broxton P",
> + .matches = {
> + DMI_MATCH(DMI_SYS_VENDOR, "Intel Corp"),
> + DMI_MATCH(DMI_PRODUCT_NAME, "Broxton P")
> + }
> + },
> + { }
> +};
> +
> static int rt298_i2c_probe(struct i2c_client *i2c,
> const struct i2c_device_id *id)
> {
> @@ -1184,6 +1196,11 @@ static int rt298_i2c_probe(struct i2c_client
> *i2c,
> acpiid->driver_data;
> }
>
> + if (dmi_check_system(force_combo_jack_table)) {
> + rt298->pdata.cbj_en = true;
> + rt298->pdata.gpio2_en = false;
> + }
> +
> /* VREF Charging */
> regmap_update_bits(rt298->regmap, 0x04, 0x80, 0x80);
> regmap_update_bits(rt298->regmap, 0x1b, 0x860, 0x860);
> --
> 1.9.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Applied "ASoC: rt298: Add DMI match for Broxton-P reference platform" to the asoc tree
2016-05-12 4:08 ` [PATCH 2/2] ASoC: rt298: Add DMI match for Broxton-P reference platform Vinod Koul
2016-05-12 5:59 ` Bard Liao
@ 2016-05-13 7:59 ` Mark Brown
1 sibling, 0 replies; 6+ messages in thread
From: Mark Brown @ 2016-05-13 7:59 UTC (permalink / raw
To: Vinod Koul
Cc: alsa-devel, patches.audio, Ramesh Babu, liam.r.girdwood, broonie,
Bard Liao, Senthilnathan Veppur
The patch
ASoC: rt298: Add DMI match for Broxton-P reference platform
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
>From b9c17f13ba484d8492278c67cd95b7207def776f Mon Sep 17 00:00:00 2001
From: Vinod Koul <vinod.koul@intel.com>
Date: Thu, 12 May 2016 09:38:50 +0530
Subject: [PATCH] ASoC: rt298: Add DMI match for Broxton-P reference platform
Broxton-P reference platform also uses combo jack for audio
connector so we need to set codec pdata to use this based on DMI
match for this board.
Signed-off-by: Ramesh Babu <ramesh.babu@intel.com>
Signed-off-by: Senthilnathan Veppur <senthilnathanx.veppur@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
sound/soc/codecs/rt298.c | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/sound/soc/codecs/rt298.c b/sound/soc/codecs/rt298.c
index 52aacb1d5e4c..a1aaffc20862 100644
--- a/sound/soc/codecs/rt298.c
+++ b/sound/soc/codecs/rt298.c
@@ -17,6 +17,7 @@
#include <linux/i2c.h>
#include <linux/platform_device.h>
#include <linux/spi/spi.h>
+#include <linux/dmi.h>
#include <linux/acpi.h>
#include <sound/core.h>
#include <sound/pcm.h>
@@ -1132,6 +1133,17 @@ static const struct acpi_device_id rt298_acpi_match[] = {
};
MODULE_DEVICE_TABLE(acpi, rt298_acpi_match);
+static const struct dmi_system_id force_combo_jack_table[] = {
+ {
+ .ident = "Intel Broxton P",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Intel Corp"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "Broxton P")
+ }
+ },
+ { }
+};
+
static int rt298_i2c_probe(struct i2c_client *i2c,
const struct i2c_device_id *id)
{
@@ -1189,6 +1201,11 @@ static int rt298_i2c_probe(struct i2c_client *i2c,
acpiid->driver_data;
}
+ if (dmi_check_system(force_combo_jack_table)) {
+ rt298->pdata.cbj_en = true;
+ rt298->pdata.gpio2_en = false;
+ }
+
/* VREF Charging */
regmap_update_bits(rt298->regmap, 0x04, 0x80, 0x80);
regmap_update_bits(rt298->regmap, 0x1b, 0x860, 0x860);
--
2.8.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Applied "ASoC: rt298: fix null deref on acpi driver data" to the asoc tree
2016-05-12 4:08 [PATCH 1/2] ASoC: rt298: fix null deref on acpi driver data Vinod Koul
2016-05-12 4:08 ` [PATCH 2/2] ASoC: rt298: Add DMI match for Broxton-P reference platform Vinod Koul
2016-05-12 5:59 ` [PATCH 1/2] ASoC: rt298: fix null deref on acpi driver data Bard Liao
@ 2016-05-13 7:59 ` Mark Brown
2 siblings, 0 replies; 6+ messages in thread
From: Mark Brown @ 2016-05-13 7:59 UTC (permalink / raw
To: Vinod Koul
Cc: alsa-devel, patches.audio, liam.r.girdwood, broonie, Bard Liao,
Senthilnathan Veppur
The patch
ASoC: rt298: fix null deref on acpi driver data
has been applied to the asoc tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
>From bb7cb54b388d8d0fbb3af27f14b121ee9c92e867 Mon Sep 17 00:00:00 2001
From: Vinod Koul <vinod.koul@intel.com>
Date: Thu, 12 May 2016 09:38:49 +0530
Subject: [PATCH] ASoC: rt298: fix null deref on acpi driver data
ACPI driver data can be NULL so we need to check that before
dereference the driver data.
Signed-off-by: Senthilnathan Veppur <senthilnathanx.veppur@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Acked-by: Bard Liao <bardliao@realtek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
sound/soc/codecs/rt298.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/codecs/rt298.c b/sound/soc/codecs/rt298.c
index f0e6c06e89ac..52aacb1d5e4c 100644
--- a/sound/soc/codecs/rt298.c
+++ b/sound/soc/codecs/rt298.c
@@ -1184,7 +1184,7 @@ static int rt298_i2c_probe(struct i2c_client *i2c,
/* enable jack combo mode on supported devices */
acpiid = acpi_match_device(dev->driver->acpi_match_table, dev);
- if (acpiid) {
+ if (acpiid && acpiid->driver_data) {
rt298->pdata = *(struct rt298_platform_data *)
acpiid->driver_data;
}
--
2.8.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-05-13 7:59 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-12 4:08 [PATCH 1/2] ASoC: rt298: fix null deref on acpi driver data Vinod Koul
2016-05-12 4:08 ` [PATCH 2/2] ASoC: rt298: Add DMI match for Broxton-P reference platform Vinod Koul
2016-05-12 5:59 ` Bard Liao
2016-05-13 7:59 ` Applied "ASoC: rt298: Add DMI match for Broxton-P reference platform" to the asoc tree Mark Brown
2016-05-12 5:59 ` [PATCH 1/2] ASoC: rt298: fix null deref on acpi driver data Bard Liao
2016-05-13 7:59 ` Applied "ASoC: rt298: fix null deref on acpi driver data" to the asoc tree Mark Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.