From patchwork Tue Dec 3 10:27:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 21953 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f71.google.com (mail-oa0-f71.google.com [209.85.219.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 01B68202DA for ; Tue, 3 Dec 2013 10:27:17 +0000 (UTC) Received: by mail-oa0-f71.google.com with SMTP id i4sf46936298oah.2 for ; Tue, 03 Dec 2013 02:27:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=a9sPUglvuWjCahaY4Fazo2qGdugc6EW5TCZ9VGCSxPk=; b=LvljKGpKRgZyFgBHzSDvb4O3ASZZU1a19QZtcEOKiSqDPHkneJL8W6V5gewvhatZBS vN9N4VxaUHmU/EK0n9Cs2lt+A1fcIzRH/uBxBJLJ4EoOC3ToQ8mZ3oC6/A8fHbF/WInJ oeZjCRkmRE0IM9dHtT4c4lkkVMgjyWE2N8ApVM45mEmt4s5rYQzCWkPoy7I9wruBLcDt q90/NGdlUDyYKFVY7h+zDRKwKDL28NWvdh54b/vVZtaEM74NftPvKZvtMhAhInfx3t7N VIDYbeOOvXWAFZaDn2LoACI/1btGvObtqac6n+xCxUCcEgGXE/udjnaqOn5I95ho5pKZ gKvA== X-Gm-Message-State: ALoCoQk+3MHheHy6kZ2+yfL56EaKxQ9RH1qTZBxnOqHfdVUvkaiYDsDVsJ84IGM3EVxJuWJ3cX9D X-Received: by 10.50.114.66 with SMTP id je2mr732122igb.5.1386066437509; Tue, 03 Dec 2013 02:27:17 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.17.103 with SMTP id n7ls1413118qed.52.gmail; Tue, 03 Dec 2013 02:27:17 -0800 (PST) X-Received: by 10.58.207.15 with SMTP id ls15mr55651264vec.17.1386066437402; Tue, 03 Dec 2013 02:27:17 -0800 (PST) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id x1si2576294vdo.81.2013.12.03.02.27.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Dec 2013 02:27:17 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.170; Received: by mail-vc0-f170.google.com with SMTP id ht10so9597843vcb.15 for ; Tue, 03 Dec 2013 02:27:17 -0800 (PST) X-Received: by 10.220.49.8 with SMTP id t8mr1073415vcf.49.1386066437195; Tue, 03 Dec 2013 02:27:17 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp195933vcz; Tue, 3 Dec 2013 02:27:16 -0800 (PST) X-Received: by 10.50.29.43 with SMTP id g11mr1804001igh.25.1386066436379; Tue, 03 Dec 2013 02:27:16 -0800 (PST) Received: from mail-ie0-f177.google.com (mail-ie0-f177.google.com [209.85.223.177]) by mx.google.com with ESMTPS id vn9si1990532igb.2.2013.12.03.02.27.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Dec 2013 02:27:16 -0800 (PST) Received-SPF: neutral (google.com: 209.85.223.177 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.223.177; Received: by mail-ie0-f177.google.com with SMTP id tp5so22774360ieb.22 for ; Tue, 03 Dec 2013 02:27:16 -0800 (PST) X-Received: by 10.50.43.131 with SMTP id w3mr1784685igl.17.1386066436097; Tue, 03 Dec 2013 02:27:16 -0800 (PST) Received: from localhost.localdomain (cpc15-aztw25-2-0-cust493.aztw.cable.virginm.net. [92.233.57.238]) by mx.google.com with ESMTPSA id o1sm2394256igh.9.2013.12.03.02.27.14 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Dec 2013 02:27:15 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, broonie@kernel.org Cc: linus.walleij@linaro.org, Lee Jones , alsa-devel@alsa-project.org Subject: [PATCH 2/2] ASoC: ux500: Dynamically fill DAI driver data on probe Date: Tue, 3 Dec 2013 10:27:07 +0000 Message-Id: <1386066427-6862-2-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1386066427-6862-1-git-send-email-lee.jones@linaro.org> References: <1386066427-6862-1-git-send-email-lee.jones@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , We no longer have a means to differentiate between MSP devices at probe time, mainly because we don't really have to. So rather than have an over- sized static data structure in place, where the only difference between devices is the ID and name (which are unused), we'll just create one succinct, statically assigned and shared one instead. Cc: alsa-devel@alsa-project.org Signed-off-by: Lee Jones --- sound/soc/ux500/ux500_msp_dai.c | 96 ++++++----------------------------------- 1 file changed, 14 insertions(+), 82 deletions(-) diff --git a/sound/soc/ux500/ux500_msp_dai.c b/sound/soc/ux500/ux500_msp_dai.c index 8d1b01f..8a7ae45 100644 --- a/sound/soc/ux500/ux500_msp_dai.c +++ b/sound/soc/ux500/ux500_msp_dai.c @@ -718,87 +718,19 @@ static struct snd_soc_dai_ops ux500_msp_dai_ops[] = { } }; -static struct snd_soc_dai_driver ux500_msp_dai_drv[UX500_NBR_OF_DAI] = { - { - .name = "ux500-msp-i2s.0", - .probe = ux500_msp_dai_probe, - .id = 0, - .suspend = NULL, - .resume = NULL, - .playback = { - .channels_min = UX500_MSP_MIN_CHANNELS, - .channels_max = UX500_MSP_MAX_CHANNELS, - .rates = UX500_I2S_RATES, - .formats = UX500_I2S_FORMATS, - }, - .capture = { - .channels_min = UX500_MSP_MIN_CHANNELS, - .channels_max = UX500_MSP_MAX_CHANNELS, - .rates = UX500_I2S_RATES, - .formats = UX500_I2S_FORMATS, - }, - .ops = ux500_msp_dai_ops, - }, - { - .name = "ux500-msp-i2s.1", - .probe = ux500_msp_dai_probe, - .id = 1, - .suspend = NULL, - .resume = NULL, - .playback = { - .channels_min = UX500_MSP_MIN_CHANNELS, - .channels_max = UX500_MSP_MAX_CHANNELS, - .rates = UX500_I2S_RATES, - .formats = UX500_I2S_FORMATS, - }, - .capture = { - .channels_min = UX500_MSP_MIN_CHANNELS, - .channels_max = UX500_MSP_MAX_CHANNELS, - .rates = UX500_I2S_RATES, - .formats = UX500_I2S_FORMATS, - }, - .ops = ux500_msp_dai_ops, - }, - { - .name = "ux500-msp-i2s.2", - .id = 2, - .probe = ux500_msp_dai_probe, - .suspend = NULL, - .resume = NULL, - .playback = { - .channels_min = UX500_MSP_MIN_CHANNELS, - .channels_max = UX500_MSP_MAX_CHANNELS, - .rates = UX500_I2S_RATES, - .formats = UX500_I2S_FORMATS, - }, - .capture = { - .channels_min = UX500_MSP_MIN_CHANNELS, - .channels_max = UX500_MSP_MAX_CHANNELS, - .rates = UX500_I2S_RATES, - .formats = UX500_I2S_FORMATS, - }, - .ops = ux500_msp_dai_ops, - }, - { - .name = "ux500-msp-i2s.3", - .probe = ux500_msp_dai_probe, - .id = 3, - .suspend = NULL, - .resume = NULL, - .playback = { - .channels_min = UX500_MSP_MIN_CHANNELS, - .channels_max = UX500_MSP_MAX_CHANNELS, - .rates = UX500_I2S_RATES, - .formats = UX500_I2S_FORMATS, - }, - .capture = { - .channels_min = UX500_MSP_MIN_CHANNELS, - .channels_max = UX500_MSP_MAX_CHANNELS, - .rates = UX500_I2S_RATES, - .formats = UX500_I2S_FORMATS, - }, - .ops = ux500_msp_dai_ops, - }, +static struct snd_soc_dai_driver ux500_msp_dai_drv = { + .probe = ux500_msp_dai_probe, + .suspend = NULL, + .resume = NULL, + .playback.channels_min = UX500_MSP_MIN_CHANNELS, + .playback.channels_max = UX500_MSP_MAX_CHANNELS, + .playback.rates = UX500_I2S_RATES, + .playback.formats = UX500_I2S_FORMATS, + .capture.channels_min = UX500_MSP_MIN_CHANNELS, + .capture.channels_max = UX500_MSP_MAX_CHANNELS, + .capture.rates = UX500_I2S_RATES, + .capture.formats = UX500_I2S_FORMATS, + .ops = ux500_msp_dai_ops, }; static const struct snd_soc_component_driver ux500_msp_component = { @@ -864,7 +796,7 @@ static int ux500_msp_drv_probe(struct platform_device *pdev) dev_set_drvdata(&pdev->dev, drvdata); ret = snd_soc_register_component(&pdev->dev, &ux500_msp_component, - &ux500_msp_dai_drv[drvdata->msp->id], 1); + &ux500_msp_dai_drv, 1); if (ret < 0) { dev_err(&pdev->dev, "Error: %s: Failed to register MSP%d!\n", __func__, drvdata->msp->id);