Message ID | 1400415858-11025-6-git-send-email-lars@metafoo.de (mailing list archive) |
---|---|
State | Accepted |
Commit | 24089e04cb1b4975bafd6368ab8b92082ebf6ad7 |
Delegated to: | Takashi Iwai |
Headers | show |
On 05/18/2014 02:24 PM, Lars-Peter Clausen wrote: > This is useful if we have a pointer to a DAPM context and know that it is a > CODEC or platform DAPM context and want to get a pointer to the CODEC or > platform. > > Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> > --- It would be nice if this one could make it into 3.16. It doesn't depend on any of the patches earlier in this series and I think it is pretty trivial. Having it in 3.16 makes it possible to use it after the merge window in some driver cleanup patches without having to do cross topic branch merges. Thanks, - Lars
On Mon, May 26, 2014 at 09:36:54PM +0200, Lars-Peter Clausen wrote: > It would be nice if this one could make it into 3.16. It doesn't depend on > any of the patches earlier in this series and I think it is pretty trivial. > Having it in 3.16 makes it possible to use it after the merge window in some > driver cleanup patches without having to do cross topic branch merges. I've applied it - as a general suggestion if I've said something is being punted for a while then replying to the series probably isn't a good way to get attention for it, I very nearly just punted on this until after the merge window. Resending individually or pinging me on IRC will probably work better.
On Mon, May 26, 2014 at 09:36:54PM +0200, Lars-Peter Clausen wrote: > On 05/18/2014 02:24 PM, Lars-Peter Clausen wrote: > >This is useful if we have a pointer to a DAPM context and know that it is a > >CODEC or platform DAPM context and want to get a pointer to the CODEC or > >platform. > > > >Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> > >--- > > It would be nice if this one could make it into 3.16. It doesn't > depend on any of the patches earlier in this series and I think it > is pretty trivial. Having it in 3.16 makes it possible to use it > after the merge window in some driver cleanup patches without having > to do cross topic branch merges. I think that would be a good idea. At least my driver updates are dependent on this series and this series looks good to me. But merge window opened earlier this week, so chances are bit slim :( Anyway its Mark's call...
On 06/06/2014 07:47 AM, Vinod Koul wrote: > On Mon, May 26, 2014 at 09:36:54PM +0200, Lars-Peter Clausen wrote: >> On 05/18/2014 02:24 PM, Lars-Peter Clausen wrote: >>> This is useful if we have a pointer to a DAPM context and know that it is a >>> CODEC or platform DAPM context and want to get a pointer to the CODEC or >>> platform. >>> >>> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> >>> --- >> >> It would be nice if this one could make it into 3.16. It doesn't >> depend on any of the patches earlier in this series and I think it >> is pretty trivial. Having it in 3.16 makes it possible to use it >> after the merge window in some driver cleanup patches without having >> to do cross topic branch merges. > > I think that would be a good idea. At least my driver updates are dependent on > this series and this series looks good to me. But merge window opened earlier > this week, so chances are bit slim :( > > Anyway its Mark's call... > This particular patch is queued for 3.16. The rest of the series will hopefully, if no issues turn up during review, be merged into the ASoC tree after the merged window. - Lars
diff --git a/include/sound/soc.h b/include/sound/soc.h index 9b335d8..aa9acaf 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h @@ -1142,6 +1142,33 @@ static inline struct snd_soc_platform *snd_soc_component_to_platform( return container_of(component, struct snd_soc_platform, component); } +/** + * snd_soc_dapm_to_codec() - Casts a DAPM context to the CODEC it is embedded in + * @dapm: The DAPM context to cast to the CODEC + * + * This function must only be used on DAPM contexts that are known to be part of + * a CODEC (e.g. in a CODEC driver). Otherwise the behavior is undefined. + */ +static inline struct snd_soc_codec *snd_soc_dapm_to_codec( + struct snd_soc_dapm_context *dapm) +{ + return container_of(dapm, struct snd_soc_codec, dapm); +} + +/** + * snd_soc_dapm_to_platform() - Casts a DAPM context to the platform it is + * embedded in + * @dapm: The DAPM context to cast to the platform. + * + * This function must only be used on DAPM contexts that are known to be part of + * a platform (e.g. in a platform driver). Otherwise the behavior is undefined. + */ +static inline struct snd_soc_platform *snd_soc_dapm_to_platform( + struct snd_soc_dapm_context *dapm) +{ + return container_of(dapm, struct snd_soc_platform, dapm); +} + /* codec IO */ unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg); int snd_soc_write(struct snd_soc_codec *codec, unsigned int reg,
This is useful if we have a pointer to a DAPM context and know that it is a CODEC or platform DAPM context and want to get a pointer to the CODEC or platform. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> --- include/sound/soc.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+)