All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Riesen <alexander.riesen@cetitec.com>
To: Kieran Bingham <kieran.bingham@ideasonboard.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Rob Herring <robh+dt@kernel.org>,
	"Mark Rutland" <mark.rutland@arm.com>,
	<devel@driverdev.osuosl.org>, <linux-media@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-renesas-soc@vger.kernel.org>
Subject: [PATCH 5/8] media: adv748x: add an ASoC DAI definition to the driver
Date: Mon, 13 Jan 2020 15:15:38 +0100	[thread overview]
Message-ID: <20200113141538.GF3606@pflmari> (raw)
In-Reply-To: <cover.1578924232.git.alexander.riesen@cetitec.com>

The definition is used to publish hardware constraints and can be used
to implement in-demand device configuration.

Signed-off-by: Alexander Riesen <alexander.riesen@cetitec.com>
---
 drivers/media/i2c/adv748x/adv748x-core.c | 33 ++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/drivers/media/i2c/adv748x/adv748x-core.c b/drivers/media/i2c/adv748x/adv748x-core.c
index b6067ffb1e0d..75e4bf144ad7 100644
--- a/drivers/media/i2c/adv748x/adv748x-core.c
+++ b/drivers/media/i2c/adv748x/adv748x-core.c
@@ -25,6 +25,7 @@
 #include <media/v4l2-dv-timings.h>
 #include <media/v4l2-fwnode.h>
 #include <media/v4l2-ioctl.h>
+#include <sound/soc.h>
 
 #include "adv748x.h"
 
@@ -689,6 +690,30 @@ static void adv748x_dt_cleanup(struct adv748x_state *state)
 		of_node_put(state->endpoints[i]);
 }
 
+static struct snd_soc_dai_driver adv748x_dai = {
+	.name = "adv748x-i2s",
+	.capture = {
+		.stream_name	= "Capture",
+		.channels_min	= 8,
+		.channels_max	= 8,
+		.rates = SNDRV_PCM_RATE_48000,
+		.formats = SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_U24_LE,
+	 },
+};
+
+static	int adv748x_of_xlate_dai_name(struct snd_soc_component *component,
+				      struct of_phandle_args *args,
+				      const char **dai_name)
+{
+	if (dai_name)
+		*dai_name = adv748x_dai.name;
+	return 0;
+}
+
+static const struct snd_soc_component_driver adv748x_codec = {
+	.of_xlate_dai_name = adv748x_of_xlate_dai_name,
+};
+
 static int adv748x_probe(struct i2c_client *client)
 {
 	struct adv748x_state *state;
@@ -782,8 +807,16 @@ static int adv748x_probe(struct i2c_client *client)
 		goto err_cleanup_txa;
 	}
 
+	ret = devm_snd_soc_register_component(state->dev, &adv748x_codec,
+					      &adv748x_dai, 1);
+	if (ret < 0) {
+		adv_err(state, "Failed to register the codec");
+		goto err_cleanup_txb;
+	}
 	return 0;
 
+err_cleanup_txb:
+	adv748x_csi2_cleanup(&state->txb);
 err_cleanup_txa:
 	adv748x_csi2_cleanup(&state->txa);
 err_cleanup_afe:
-- 
2.24.1.508.g91d2dafee0


WARNING: multiple messages have this Message-ID (diff)
From: Alex Riesen <alexander.riesen@cetitec.com>
To: Kieran Bingham <kieran.bingham@ideasonboard.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
	devel@driverdev.osuosl.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	Rob Herring <robh+dt@kernel.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-media@vger.kernel.org
Subject: [PATCH 5/8] media: adv748x: add an ASoC DAI definition to the driver
Date: Mon, 13 Jan 2020 15:15:38 +0100	[thread overview]
Message-ID: <20200113141538.GF3606@pflmari> (raw)
In-Reply-To: <cover.1578924232.git.alexander.riesen@cetitec.com>

The definition is used to publish hardware constraints and can be used
to implement in-demand device configuration.

Signed-off-by: Alexander Riesen <alexander.riesen@cetitec.com>
---
 drivers/media/i2c/adv748x/adv748x-core.c | 33 ++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/drivers/media/i2c/adv748x/adv748x-core.c b/drivers/media/i2c/adv748x/adv748x-core.c
index b6067ffb1e0d..75e4bf144ad7 100644
--- a/drivers/media/i2c/adv748x/adv748x-core.c
+++ b/drivers/media/i2c/adv748x/adv748x-core.c
@@ -25,6 +25,7 @@
 #include <media/v4l2-dv-timings.h>
 #include <media/v4l2-fwnode.h>
 #include <media/v4l2-ioctl.h>
+#include <sound/soc.h>
 
 #include "adv748x.h"
 
@@ -689,6 +690,30 @@ static void adv748x_dt_cleanup(struct adv748x_state *state)
 		of_node_put(state->endpoints[i]);
 }
 
+static struct snd_soc_dai_driver adv748x_dai = {
+	.name = "adv748x-i2s",
+	.capture = {
+		.stream_name	= "Capture",
+		.channels_min	= 8,
+		.channels_max	= 8,
+		.rates = SNDRV_PCM_RATE_48000,
+		.formats = SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_U24_LE,
+	 },
+};
+
+static	int adv748x_of_xlate_dai_name(struct snd_soc_component *component,
+				      struct of_phandle_args *args,
+				      const char **dai_name)
+{
+	if (dai_name)
+		*dai_name = adv748x_dai.name;
+	return 0;
+}
+
+static const struct snd_soc_component_driver adv748x_codec = {
+	.of_xlate_dai_name = adv748x_of_xlate_dai_name,
+};
+
 static int adv748x_probe(struct i2c_client *client)
 {
 	struct adv748x_state *state;
@@ -782,8 +807,16 @@ static int adv748x_probe(struct i2c_client *client)
 		goto err_cleanup_txa;
 	}
 
+	ret = devm_snd_soc_register_component(state->dev, &adv748x_codec,
+					      &adv748x_dai, 1);
+	if (ret < 0) {
+		adv_err(state, "Failed to register the codec");
+		goto err_cleanup_txb;
+	}
 	return 0;
 
+err_cleanup_txb:
+	adv748x_csi2_cleanup(&state->txb);
 err_cleanup_txa:
 	adv748x_csi2_cleanup(&state->txa);
 err_cleanup_afe:
-- 
2.24.1.508.g91d2dafee0

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  parent reply	other threads:[~2020-01-13 14:15 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-13 14:19 [PATCH 0/8] media: i2c: adv748x: add support for HDMI audio Alex Riesen
2020-01-13 14:19 ` Alex Riesen
2020-01-13 14:15 ` [PATCH 1/8] media: adv748x: add a device-specific wrapper for register block read Alex Riesen
2020-01-13 14:15   ` Alex Riesen
2020-01-13 14:15 ` [PATCH 2/8] media: adv748x: add audio mute control and output selection ioctls Alex Riesen
2020-01-13 14:15   ` Alex Riesen
2020-03-13  8:16   ` Hans Verkuil
2020-03-13  8:16     ` Hans Verkuil
2020-03-13 10:26     ` Alex Riesen
2020-03-13 10:26       ` Alex Riesen
2020-03-13 10:52       ` Hans Verkuil
2020-03-13 10:52         ` Hans Verkuil
2020-03-13 11:00         ` Alex Riesen
2020-03-13 11:00           ` Alex Riesen
2020-01-13 14:15 ` [PATCH 3/8] media: adv748x: add log_status ioctl Alex Riesen
2020-01-13 14:15   ` Alex Riesen
2020-01-13 14:15 ` [PATCH 4/8] media: adv748x: reserve space for the audio (I2S) port in the driver structures Alex Riesen
2020-01-13 14:15   ` Alex Riesen
2020-01-13 14:15 ` Alex Riesen [this message]
2020-01-13 14:15   ` [PATCH 5/8] media: adv748x: add an ASoC DAI definition to the driver Alex Riesen
2020-01-13 14:15 ` [PATCH 6/8] media: adv748x: reduce amount of code for bitwise modification of device registers Alex Riesen
2020-01-13 14:15   ` Alex Riesen
2020-01-13 14:15 ` [PATCH 7/8] dt-bindings: adv748x: add information about serial audio interface (I2S/TDM) Alex Riesen
2020-01-13 14:15   ` Alex Riesen
2020-01-13 22:32   ` Rob Herring
2020-01-13 22:32     ` Rob Herring
2020-01-13 14:15 ` [PATCH 8/8] arm64: dts: renesas: salvator: add a connection from adv748x codec (HDMI input) to the R-Car SoC Alex Riesen
2020-01-13 14:15   ` Alex Riesen
2020-03-02 12:28   ` Geert Uytterhoeven
2020-03-02 12:28     ` Geert Uytterhoeven
2020-03-02 13:40     ` Alex Riesen
2020-03-02 13:40       ` Alex Riesen
2020-03-02 13:47       ` Geert Uytterhoeven
2020-03-02 13:47         ` Geert Uytterhoeven
2020-03-02 15:07         ` Alex Riesen
2020-03-02 15:07           ` Alex Riesen
2020-03-02 15:32           ` Geert Uytterhoeven
2020-03-02 15:32             ` Geert Uytterhoeven
2020-03-02 16:09             ` Alex Riesen
2020-03-02 16:09               ` Alex Riesen
2020-03-02 16:13               ` Geert Uytterhoeven
2020-03-02 16:13                 ` Geert Uytterhoeven
2020-03-05 14:36                 ` Alex Riesen
2020-03-05 14:36                   ` Alex Riesen
2020-03-06 12:21                   ` Geert Uytterhoeven
2020-03-06 12:21                     ` Geert Uytterhoeven
2020-03-06 13:16                   ` Laurent Pinchart
2020-03-06 13:16                     ` Laurent Pinchart
2020-03-06 13:41                     ` Alex Riesen
2020-03-06 13:41                       ` Alex Riesen
2020-03-06 13:45                       ` Laurent Pinchart
2020-03-06 13:45                         ` Laurent Pinchart
2020-03-09  1:31                         ` Kuninori Morimoto
2020-03-09  1:31                           ` Kuninori Morimoto
2020-03-09 11:09                           ` Alex Riesen
2020-03-09 11:09                             ` Alex Riesen
2020-03-10  1:07                             ` Kuninori Morimoto
2020-03-10  1:07                               ` Kuninori Morimoto
2020-03-10  8:17                               ` Alex Riesen
2020-03-10  8:17                                 ` Alex Riesen
2020-03-10 10:39                                 ` Laurent Pinchart
2020-03-10 10:39                                   ` Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200113141538.GF3606@pflmari \
    --to=alexander.riesen@cetitec.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=devicetree@vger.kernel.org \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mchehab@kernel.org \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.