* [PATCH V8 1/5] ASoC: qcom: Document Storm bindings
2015-03-13 8:01 [PATCH V8 0/5] ASoC: QCOM: Add support for ipq806x SOC Kenneth Westfield
@ 2015-03-13 8:01 ` Kenneth Westfield
2015-03-13 8:01 ` [PATCH V8 2/5] ASoC: qcom: Add Storm machine driver Kenneth Westfield
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Kenneth Westfield @ 2015-03-13 8:01 UTC (permalink / raw)
To: Mark Brown, Liam Girdwood, Kumar Gala
Cc: Banajit Goswami, Patrick Lai, Takashi Iwai, Jaroslav Kysela,
David Brown, Bryan Huntsman, Rob Herring, ALSA Mailing List,
MSM Mailing List, Device Tree Mailing List, Kernel Mailing List,
Kenneth Westfield
From: Kenneth Westfield <kwestfie@codeaurora.org>
Add documentation to the sound directory of the
device-tree bindings for the soundcard of the
Storm board.
Signed-off-by: Kenneth Westfield <kwestfie@codeaurora.org>
Acked-by: Banajit Goswami <bgoswami@codeaurora.org>
---
Documentation/devicetree/bindings/sound/storm.txt | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
create mode 100644 Documentation/devicetree/bindings/sound/storm.txt
diff --git a/Documentation/devicetree/bindings/sound/storm.txt b/Documentation/devicetree/bindings/sound/storm.txt
new file mode 100644
index 0000000000000000000000000000000000000000..062a4c185fa9d06d726eccbbcf69a6e566ec0441
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/storm.txt
@@ -0,0 +1,23 @@
+* Sound complex for Storm boards
+
+Models a soundcard for Storm boards with the Qualcomm Technologies IPQ806x SOC
+connected to a MAX98357A DAC via I2S.
+
+Required properties:
+
+- compatible : "google,storm-audio"
+- cpu : Phandle of the CPU DAI
+- codec : Phandle of the codec DAI
+
+Optional properties:
+
+- qcom,model : The user-visible name of this sound card.
+
+Example:
+
+sound {
+ compatible = "google,storm-audio";
+ qcom,model = "ipq806x-storm";
+ cpu = <&lpass_cpu>;
+ codec = <&max98357a>;
+};
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH V8 2/5] ASoC: qcom: Add Storm machine driver
2015-03-13 8:01 [PATCH V8 0/5] ASoC: QCOM: Add support for ipq806x SOC Kenneth Westfield
2015-03-13 8:01 ` [PATCH V8 1/5] ASoC: qcom: Document Storm bindings Kenneth Westfield
@ 2015-03-13 8:01 ` Kenneth Westfield
2015-03-13 8:01 ` [PATCH V8 3/5] ASoC: qcom: Add ability to build QCOM drivers Kenneth Westfield
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Kenneth Westfield @ 2015-03-13 8:01 UTC (permalink / raw)
To: Mark Brown, Liam Girdwood, Kumar Gala
Cc: Banajit Goswami, Patrick Lai, Takashi Iwai, Jaroslav Kysela,
David Brown, Bryan Huntsman, Rob Herring, ALSA Mailing List,
MSM Mailing List, Device Tree Mailing List, Kernel Mailing List,
Kenneth Westfield
From: Kenneth Westfield <kwestfie@codeaurora.org>
Add machine driver for the Storm board with the
IPQ806X SOC connected to the MAX98357A DAC.
Signed-off-by: Kenneth Westfield <kwestfie@codeaurora.org>
Acked-by: Banajit Goswami <bgoswami@codeaurora.org>
---
sound/soc/qcom/storm.c | 162 +++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 162 insertions(+)
create mode 100644 sound/soc/qcom/storm.c
diff --git a/sound/soc/qcom/storm.c b/sound/soc/qcom/storm.c
new file mode 100644
index 0000000000000000000000000000000000000000..b8bd296190add83ba332d42256096c1376d2632d
--- /dev/null
+++ b/sound/soc/qcom/storm.c
@@ -0,0 +1,162 @@
+/*
+ * Copyright (c) 2010-2011,2013-2015 The Linux Foundation. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * 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.
+ *
+ * storm.c -- ALSA SoC machine driver for QTi ipq806x-based Storm board
+ */
+
+#include <linux/device.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/mod_devicetable.h>
+#include <linux/platform_device.h>
+#include <sound/pcm.h>
+#include <sound/pcm_params.h>
+#include <sound/soc.h>
+
+#define STORM_SYSCLK_MULT 4
+
+static int storm_ops_hw_params(struct snd_pcm_substream *substream,
+ struct snd_pcm_hw_params *params)
+{
+ struct snd_soc_pcm_runtime *soc_runtime = substream->private_data;
+ struct snd_soc_card *card = soc_runtime->card;
+ snd_pcm_format_t format = params_format(params);
+ unsigned int rate = params_rate(params);
+ unsigned int sysclk_freq;
+ int bitwidth, ret;
+
+ bitwidth = snd_pcm_format_width(format);
+ if (bitwidth < 0) {
+ dev_err(card->dev, "%s() invalid bit width given: %d\n",
+ __func__, bitwidth);
+ return bitwidth;
+ }
+
+ /*
+ * as the CPU DAI is the I2S bus master and no system clock is needed by
+ * the MAX98357a DAC, simply set the system clock to be a constant
+ * multiple of the bit clock for the clock divider
+ */
+ sysclk_freq = rate * bitwidth * 2 * STORM_SYSCLK_MULT;
+
+ ret = snd_soc_dai_set_sysclk(soc_runtime->cpu_dai, 0, sysclk_freq, 0);
+ if (ret) {
+ dev_err(card->dev, "%s() error setting sysclk to %u: %d\n",
+ __func__, sysclk_freq, ret);
+ return ret;
+ }
+
+ return 0;
+}
+
+static struct snd_soc_ops storm_soc_ops = {
+ .hw_params = storm_ops_hw_params,
+};
+
+static struct snd_soc_dai_link storm_dai_link = {
+ .name = "Primary",
+ .stream_name = "Primary",
+ .codec_dai_name = "HiFi",
+ .ops = &storm_soc_ops,
+};
+
+static struct snd_soc_card storm_soc_card = {
+ .name = "ipq806x-storm",
+ .dev = NULL,
+};
+
+static int storm_parse_of(struct snd_soc_card *card)
+{
+ struct snd_soc_dai_link *dai_link = card->dai_link;
+ struct device_node *np = card->dev->of_node;
+
+ dai_link->cpu_of_node = of_parse_phandle(np, "cpu", 0);
+ if (!dai_link->cpu_of_node) {
+ dev_err(card->dev, "%s() error getting cpu phandle\n",
+ __func__);
+ return -EINVAL;
+ }
+ dai_link->platform_of_node = dai_link->cpu_of_node;
+
+ dai_link->codec_of_node = of_parse_phandle(np, "codec", 0);
+ if (!dai_link->codec_of_node) {
+ dev_err(card->dev, "%s() error getting codec phandle\n",
+ __func__);
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
+static int storm_platform_probe(struct platform_device *pdev)
+{
+ struct snd_soc_card *card = &storm_soc_card;
+ int ret;
+
+ if (card->dev) {
+ dev_err(&pdev->dev, "%s() error, existing soundcard\n",
+ __func__);
+ return -ENODEV;
+ }
+ card->dev = &pdev->dev;
+ platform_set_drvdata(pdev, card);
+
+ ret = snd_soc_of_parse_card_name(card, "qcom,model");
+ if (ret) {
+ dev_err(&pdev->dev, "%s() error parsing card name: %d\n",
+ __func__, ret);
+ return ret;
+ }
+
+ card->dai_link = &storm_dai_link;
+ card->num_links = 1;
+
+ ret = storm_parse_of(card);
+ if (ret) {
+ dev_err(&pdev->dev, "%s() error resolving dai links: %d\n",
+ __func__, ret);
+ return ret;
+ }
+
+ ret = devm_snd_soc_register_card(&pdev->dev, card);
+ if (ret == -EPROBE_DEFER) {
+ card->dev = NULL;
+ return ret;
+ } else if (ret) {
+ dev_err(&pdev->dev, "%s() error registering soundcard: %d\n",
+ __func__, ret);
+ return ret;
+ }
+
+ return 0;
+}
+
+#ifdef CONFIG_OF
+static const struct of_device_id storm_device_id[] = {
+ { .compatible = "google,storm-audio" },
+ {},
+};
+MODULE_DEVICE_TABLE(of, storm_device_id);
+#endif
+
+static struct platform_driver storm_platform_driver = {
+ .driver = {
+ .name = "storm-audio",
+ .of_match_table =
+ of_match_ptr(storm_device_id),
+ },
+ .probe = storm_platform_probe,
+};
+module_platform_driver(storm_platform_driver);
+
+MODULE_DESCRIPTION("QTi IPQ806x-based Storm Machine Driver");
+MODULE_LICENSE("GPL v2");
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH V8 3/5] ASoC: qcom: Add ability to build QCOM drivers
2015-03-13 8:01 [PATCH V8 0/5] ASoC: QCOM: Add support for ipq806x SOC Kenneth Westfield
2015-03-13 8:01 ` [PATCH V8 1/5] ASoC: qcom: Document Storm bindings Kenneth Westfield
2015-03-13 8:01 ` [PATCH V8 2/5] ASoC: qcom: Add Storm machine driver Kenneth Westfield
@ 2015-03-13 8:01 ` Kenneth Westfield
2015-03-13 8:01 ` [PATCH V8 4/5] ASoC: Allow for building " Kenneth Westfield
2015-03-13 8:01 ` [PATCH V8 5/5] ARM: dts: Model IPQ LPASS audio hardware Kenneth Westfield
4 siblings, 0 replies; 7+ messages in thread
From: Kenneth Westfield @ 2015-03-13 8:01 UTC (permalink / raw)
To: Mark Brown, Liam Girdwood, Kumar Gala
Cc: Banajit Goswami, Patrick Lai, Takashi Iwai, Jaroslav Kysela,
David Brown, Bryan Huntsman, Rob Herring, ALSA Mailing List,
MSM Mailing List, Device Tree Mailing List, Kernel Mailing List,
Kenneth Westfield
From: Kenneth Westfield <kwestfie@codeaurora.org>
Define the LPASS platform driver, the LPASS
CPU DAI driver and the Storm machine driver
configurations, and how to build them.
Signed-off-by: Kenneth Westfield <kwestfie@codeaurora.org>
Acked-by: Banajit Goswami <bgoswami@codeaurora.org>
---
sound/soc/qcom/Kconfig | 25 +++++++++++++++++++++++++
sound/soc/qcom/Makefile | 11 +++++++++++
2 files changed, 36 insertions(+)
create mode 100644 sound/soc/qcom/Kconfig
create mode 100644 sound/soc/qcom/Makefile
diff --git a/sound/soc/qcom/Kconfig b/sound/soc/qcom/Kconfig
new file mode 100644
index 0000000000000000000000000000000000000000..5f58e4f1bca98b5c4c4c951dce24036aafa2d694
--- /dev/null
+++ b/sound/soc/qcom/Kconfig
@@ -0,0 +1,25 @@
+config SND_SOC_QCOM
+ tristate "ASoC support for QCOM platforms"
+ help
+ Say Y or M if you want to add support to use audio devices
+ in Qualcomm Technologies SOC-based platforms.
+
+config SND_SOC_LPASS_CPU
+ tristate
+ depends on SND_SOC_QCOM
+ select REGMAP_MMIO
+
+config SND_SOC_LPASS_PLATFORM
+ tristate
+ depends on SND_SOC_QCOM
+ select REGMAP_MMIO
+
+config SND_SOC_STORM
+ tristate "ASoC I2S support for Storm boards"
+ depends on (ARCH_QCOM && SND_SOC_QCOM) || COMPILE_TEST
+ select SND_SOC_LPASS_CPU
+ select SND_SOC_LPASS_PLATFORM
+ select SND_SOC_MAX98357A
+ help
+ Say Y or M if you want add support for SoC audio on the
+ Qualcomm Technologies IPQ806X-based Storm board.
diff --git a/sound/soc/qcom/Makefile b/sound/soc/qcom/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..c5ce96c761c47b3a1b98e27d863fe0b5b9bc019e
--- /dev/null
+++ b/sound/soc/qcom/Makefile
@@ -0,0 +1,11 @@
+# Platform
+snd-soc-lpass-cpu-objs := lpass-cpu.o
+snd-soc-lpass-platform-objs := lpass-platform.o
+
+obj-$(CONFIG_SND_SOC_LPASS_CPU) += snd-soc-lpass-cpu.o
+obj-$(CONFIG_SND_SOC_LPASS_PLATFORM) += snd-soc-lpass-platform.o
+
+# Machine
+snd-soc-storm-objs := storm.o
+
+obj-$(CONFIG_SND_SOC_STORM) += snd-soc-storm.o
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH V8 4/5] ASoC: Allow for building QCOM drivers
2015-03-13 8:01 [PATCH V8 0/5] ASoC: QCOM: Add support for ipq806x SOC Kenneth Westfield
` (2 preceding siblings ...)
2015-03-13 8:01 ` [PATCH V8 3/5] ASoC: qcom: Add ability to build QCOM drivers Kenneth Westfield
@ 2015-03-13 8:01 ` Kenneth Westfield
[not found] ` <1426233668-30593-5-git-send-email-kwestfie-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2015-03-13 8:01 ` [PATCH V8 5/5] ARM: dts: Model IPQ LPASS audio hardware Kenneth Westfield
4 siblings, 1 reply; 7+ messages in thread
From: Kenneth Westfield @ 2015-03-13 8:01 UTC (permalink / raw)
To: Mark Brown, Liam Girdwood, Kumar Gala
Cc: Banajit Goswami, Patrick Lai, Takashi Iwai, Jaroslav Kysela,
David Brown, Bryan Huntsman, Rob Herring, ALSA Mailing List,
MSM Mailing List, Device Tree Mailing List, Kernel Mailing List,
Kenneth Westfield
From: Kenneth Westfield <kwestfie@codeaurora.org>
Allow for the Qualcomm Technologies ASoC drivers
to build.
Signed-off-by: Kenneth Westfield <kwestfie@codeaurora.org>
Acked-by: Banajit Goswami <bgoswami@codeaurora.org>
---
sound/soc/Kconfig | 1 +
sound/soc/Makefile | 1 +
2 files changed, 2 insertions(+)
diff --git a/sound/soc/Kconfig b/sound/soc/Kconfig
index dcc79aa0236b548bfe5408fe56689241fc597e97..3ba52da18bc69a9bb41c84627cfc7d08f47e3bf0 100644
--- a/sound/soc/Kconfig
+++ b/sound/soc/Kconfig
@@ -47,6 +47,7 @@ source "sound/soc/kirkwood/Kconfig"
source "sound/soc/intel/Kconfig"
source "sound/soc/mxs/Kconfig"
source "sound/soc/pxa/Kconfig"
+source "sound/soc/qcom/Kconfig"
source "sound/soc/rockchip/Kconfig"
source "sound/soc/samsung/Kconfig"
source "sound/soc/sh/Kconfig"
diff --git a/sound/soc/Makefile b/sound/soc/Makefile
index 5b3c8f67c8db7a29ff7199a6103d445428978125..974ba708b4826a03077a58251434a311542d5e3c 100644
--- a/sound/soc/Makefile
+++ b/sound/soc/Makefile
@@ -28,6 +28,7 @@ obj-$(CONFIG_SND_SOC) += nuc900/
obj-$(CONFIG_SND_SOC) += omap/
obj-$(CONFIG_SND_SOC) += kirkwood/
obj-$(CONFIG_SND_SOC) += pxa/
+obj-$(CONFIG_SND_SOC) += qcom/
obj-$(CONFIG_SND_SOC) += rockchip/
obj-$(CONFIG_SND_SOC) += samsung/
obj-$(CONFIG_SND_SOC) += sh/
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH V8 5/5] ARM: dts: Model IPQ LPASS audio hardware
2015-03-13 8:01 [PATCH V8 0/5] ASoC: QCOM: Add support for ipq806x SOC Kenneth Westfield
` (3 preceding siblings ...)
2015-03-13 8:01 ` [PATCH V8 4/5] ASoC: Allow for building " Kenneth Westfield
@ 2015-03-13 8:01 ` Kenneth Westfield
4 siblings, 0 replies; 7+ messages in thread
From: Kenneth Westfield @ 2015-03-13 8:01 UTC (permalink / raw)
To: Mark Brown, Liam Girdwood, Kumar Gala
Cc: Banajit Goswami, Patrick Lai, Takashi Iwai, Jaroslav Kysela,
David Brown, Bryan Huntsman, Rob Herring, ALSA Mailing List,
MSM Mailing List, Device Tree Mailing List, Kernel Mailing List,
Kenneth Westfield
From: Kenneth Westfield <kwestfie@codeaurora.org>
Model the Qualcomm Technologies LPASS hardware for
the ipq806x SOC.
Signed-off-by: Kenneth Westfield <kwestfie@codeaurora.org>
Acked-by: Banajit Goswami <bgoswami@codeaurora.org>
---
arch/arm/boot/dts/qcom-ipq8064.dtsi | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/arch/arm/boot/dts/qcom-ipq8064.dtsi b/arch/arm/boot/dts/qcom-ipq8064.dtsi
index cb225dafe97cd83c9ae4cc19482ed55d4a71b8b3..d5fad10722a5cf2c62ac4026c31a98bbf8068447 100644
--- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
+++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
@@ -2,6 +2,7 @@
#include "skeleton.dtsi"
#include <dt-bindings/clock/qcom,gcc-ipq806x.h>
+#include <dt-bindings/clock/qcom,lcc-ipq806x.h>
#include <dt-bindings/soc/qcom,gsbi.h>
/ {
@@ -66,6 +67,21 @@
ranges;
compatible = "simple-bus";
+ lpass@28100000 {
+ compatible = "qcom,lpass-cpu";
+ status = "disabled";
+ clocks = <&lcc AHBIX_CLK>,
+ <&lcc MI2S_OSR_CLK>,
+ <&lcc MI2S_BIT_CLK>;
+ clock-names = "ahbix-clk",
+ "mi2s-osr-clk",
+ "mi2s-bit-clk";
+ interrupts = <0 85 1>;
+ interrupt-names = "lpass-irq-lpaif";
+ reg = <0x28100000 0x10000>;
+ reg-names = "lpass-lpaif";
+ };
+
qcom_pinmux: pinmux@800000 {
compatible = "qcom,ipq8064-pinctrl";
reg = <0x800000 0x4000>;
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
^ permalink raw reply related [flat|nested] 7+ messages in thread