From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kuninori Morimoto Subject: [PATCH v2 12/39] ASoC: sh: siu: replace platform to component Date: Mon, 29 Jan 2018 02:43:45 +0000 Message-ID: <87mv0x75di.wl%kuninori.morimoto.gx@renesas.com> References: <87607l8k9i.wl%kuninori.morimoto.gx@renesas.com> <874ln58k4s.wl%kuninori.morimoto.gx@renesas.com> Mime-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from relmlie3.idc.renesas.com (relmlor4.renesas.com [210.160.252.174]) by alsa0.perex.cz (Postfix) with ESMTP id 7B52826768B for ; Mon, 29 Jan 2018 03:43:49 +0100 (CET) In-Reply-To: <874ln58k4s.wl%kuninori.morimoto.gx@renesas.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Mark Brown Cc: Linux-ALSA List-Id: alsa-devel@alsa-project.org From: Kuninori Morimoto Now platform can be replaced to component, let's do it. Signed-off-by: Kuninori Morimoto --- sound/soc/sh/siu.h | 2 +- sound/soc/sh/siu_dai.c | 10 +--------- sound/soc/sh/siu_pcm.c | 9 ++++++--- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/sound/soc/sh/siu.h b/sound/soc/sh/siu.h index 83c3430..6088d62 100644 --- a/sound/soc/sh/siu.h +++ b/sound/soc/sh/siu.h @@ -183,7 +183,7 @@ static inline u32 siu_read32(u32 __iomem *addr) #define SIU_BRGBSEL (0x108 / sizeof(u32)) #define SIU_BRRB (0x10c / sizeof(u32)) -extern struct snd_soc_platform_driver siu_platform; +extern struct snd_soc_component_driver siu_component; extern struct siu_info *siu_i2s_data; int siu_init_port(int port, struct siu_port **port_info, struct snd_card *card); diff --git a/sound/soc/sh/siu_dai.c b/sound/soc/sh/siu_dai.c index 1605029..ee22116 100644 --- a/sound/soc/sh/siu_dai.c +++ b/sound/soc/sh/siu_dai.c @@ -727,10 +727,6 @@ static int siu_dai_set_sysclk(struct snd_soc_dai *dai, int clk_id, .ops = &siu_dai_ops, }; -static const struct snd_soc_component_driver siu_i2s_component = { - .name = "siu-i2s", -}; - static int siu_probe(struct platform_device *pdev) { const struct firmware *fw_entry; @@ -786,15 +782,11 @@ static int siu_probe(struct platform_device *pdev) dev_set_drvdata(&pdev->dev, info); /* register using ARRAY version so we can keep dai name */ - ret = devm_snd_soc_register_component(&pdev->dev, &siu_i2s_component, + ret = devm_snd_soc_register_component(&pdev->dev, &siu_component, &siu_i2s_dai, 1); if (ret < 0) return ret; - ret = devm_snd_soc_register_platform(&pdev->dev, &siu_platform); - if (ret < 0) - return ret; - pm_runtime_enable(&pdev->dev); return 0; diff --git a/sound/soc/sh/siu_pcm.c b/sound/soc/sh/siu_pcm.c index 3118cb0e..1729095 100644 --- a/sound/soc/sh/siu_pcm.c +++ b/sound/soc/sh/siu_pcm.c @@ -35,6 +35,7 @@ #include "siu.h" +#define DRV_NAME "siu-i2s" #define GET_MAX_PERIODS(buf_bytes, period_bytes) \ ((buf_bytes) / (period_bytes)) #define PERIOD_OFFSET(buf_addr, period_num, period_bytes) \ @@ -340,7 +341,8 @@ static int siu_pcm_open(struct snd_pcm_substream *ss) { /* Playback / Capture */ struct snd_soc_pcm_runtime *rtd = ss->private_data; - struct siu_platform *pdata = rtd->platform->dev->platform_data; + struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd, DRV_NAME); + struct siu_platform *pdata = component->dev->platform_data; struct siu_info *info = siu_i2s_data; struct siu_port *port_info = siu_port_info(ss); struct siu_stream *siu_stream; @@ -604,9 +606,10 @@ static void siu_pcm_free(struct snd_pcm *pcm) .pointer = siu_pcm_pointer_dma, }; -struct snd_soc_platform_driver siu_platform = { +struct snd_soc_component_driver siu_component = { + .name = DRV_NAME, .ops = &siu_pcm_ops, .pcm_new = siu_pcm_new, .pcm_free = siu_pcm_free, }; -EXPORT_SYMBOL_GPL(siu_platform); +EXPORT_SYMBOL_GPL(siu_component); -- 1.9.1