mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Andreas Irestål" <andreas.irestal@axis.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: "Andreas Irestål" <andire@axis.com>,
	"Lars-Peter Clausen" <lars@metafoo.de>,
	"Liam Girdwood" <lgirdwood@gmail.com>,
	"Mark Brown" <broonie@kernel.org>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Pawel Moll" <pawel.moll@arm.com>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Ian Campbell" <ijc+devicetree@hellion.org.uk>,
	"Kumar Gala" <galak@codeaurora.org>,
	devicetree@vger.kernel.org, alsa-devel@alsa-project.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 5/5] ASoC: adau17x1: Support platform data via DT
Date: Wed, 17 Feb 2016 09:58:29 +0100	[thread overview]
Message-ID: <20160217085829.GC2137@lnxandire1.se.axis.com> (raw)
In-Reply-To: <4053162.T8NAULHXMt@wuerfel>

On Tue, Feb 16, 2016 at 02:42:02PM +0100, Arnd Bergmann wrote:
> On Tuesday 16 February 2016 13:56:45 Andreas Irestål wrote:
> > Currently, it is only possible to configure HW-specific options to the
> > adau17x1 codecs by providing a platform data struct. With this patch,
> > it is possible to provide the same data via DT instead.
> > 
> > Signed-off-by: Andreas Irestål <andire@axis.com>
> > ---
> >  .../devicetree/bindings/sound/adi,adau17x1.txt     |  31 +++++
> >  include/dt-bindings/sound/adau17x1.h               |  14 +++
> >  sound/soc/codecs/adau1761.c                        | 127 +++++++++++++++++++++
> >  sound/soc/codecs/adau1781.c                        |  48 ++++++++
> >  4 files changed, 220 insertions(+)
> >  create mode 100644 include/dt-bindings/sound/adau17x1.h
> 
> > +		of_pdata = devm_kzalloc(dev, sizeof(*of_pdata), GFP_KERNEL);
> > +		if (!of_pdata)
> > +			return -ENOMEM;
> > +		adau1781_pdata_from_of(dev, of_pdata);
> > +		dev->platform_data = of_pdata;
> 
> and here I'd try to avoid the dynamic allocation and just add the fields to the
> driver private structure. You can copy the information from the platform
> data in the 'else' path.

Since the driver private structure is shared between two different
codecs, the platform_data struct can be of 2 different types, but I
guess it should be OK to have two fields or a
union in the private struct.

I was thinking about this too but chose the approach above since providing
platform_data is optional. However, I could add some default values and
submit again.

Thanks a lot for the feedback.
/Andreas

> 
> 	Arnd

  reply	other threads:[~2016-02-17  8:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-16 12:56 [PATCH v2 0/5] Minor fixes and DT support Andreas Irestål
2016-02-16 12:56 ` [PATCH v2 1/5] ASoC: adau17x1: Fix incorrect BCLK ratio definitions Andreas Irestål
2016-02-16 12:56 ` [PATCH v2 2/5] ASoC: adau17x1: Correct typos in file headers Andreas Irestål
2016-02-16 12:56 ` [PATCH v2 3/5] ASoC: adau17x1: Add adau17x1 bindings document Andreas Irestål
2016-02-18 14:37   ` Rob Herring
2016-02-16 12:56 ` [PATCH v2 4/5] ASoC: adau17x1: Add basic DT support for adau17x1 Andreas Irestål
2016-02-16 12:56 ` [PATCH v2 5/5] ASoC: adau17x1: Support platform data via DT Andreas Irestål
2016-02-16 13:42   ` Arnd Bergmann
2016-02-17  8:58     ` Andreas Irestål [this message]
2016-02-18 14:37   ` Rob Herring
2016-02-18 17:38     ` Mark Brown

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=20160217085829.GC2137@lnxandire1.se.axis.com \
    --to=andreas.irestal@axis.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=andire@axis.com \
    --cc=arnd@arndb.de \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=lars@metafoo.de \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®