diff mbox

[v2,1/4] DRM: add help to get ELD speaker allocation

Message ID 1481728605-22781-2-git-send-email-arnaud.pouliquen@st.com (mailing list archive)
State New, archived
Headers show

Commit Message

Arnaud POULIQUEN Dec. 14, 2016, 3:16 p.m. UTC
Add helper to allow users to retrieve the speaker allocations without
knowledge of the ELD structure.

Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
---
 include/drm/drm_edid.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

Comments

Jani Nikula Dec. 19, 2016, 9:09 a.m. UTC | #1
On Wed, 14 Dec 2016, Arnaud Pouliquen <arnaud.pouliquen@st.com> wrote:
> Add helper to allow users to retrieve the speaker allocations without
> knowledge of the ELD structure.
>
> Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>

For this one patch,

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  include/drm/drm_edid.h | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
> index 919933d..0706cc6 100644
> --- a/include/drm/drm_edid.h
> +++ b/include/drm/drm_edid.h
> @@ -245,6 +245,7 @@ struct detailed_timing {
>  # define DRM_ELD_AUD_SYNCH_DELAY_MAX	0xfa	/* 500 ms */
>  
>  #define DRM_ELD_SPEAKER			7
> +# define DRM_ELD_SPEAKER_MASK		0x7f
>  # define DRM_ELD_SPEAKER_RLRC		(1 << 6)
>  # define DRM_ELD_SPEAKER_FLRC		(1 << 5)
>  # define DRM_ELD_SPEAKER_RC		(1 << 4)
> @@ -412,6 +413,18 @@ static inline int drm_eld_size(const uint8_t *eld)
>  }
>  
>  /**
> + * drm_eld_get_spk_alloc - Get speaker allocation
> + * @eld: pointer to an ELD memory structure
> + *
> + * The returned value is the speakers mask. User has to use %DRM_ELD_SPEAKER
> + * field definitions to identify speakers.
> + */
> +static inline u8 drm_eld_get_spk_alloc(const uint8_t *eld)
> +{
> +	return eld[DRM_ELD_SPEAKER] & DRM_ELD_SPEAKER_MASK;
> +}
> +
> +/**
>   * drm_eld_get_conn_type - Get device type hdmi/dp connected
>   * @eld: pointer to an ELD memory structure
>   *
Daniel Vetter Dec. 19, 2016, 9:42 a.m. UTC | #2
On Mon, Dec 19, 2016 at 11:09:55AM +0200, Jani Nikula wrote:
> On Wed, 14 Dec 2016, Arnaud Pouliquen <arnaud.pouliquen@st.com> wrote:
> > Add helper to allow users to retrieve the speaker allocations without
> > knowledge of the ELD structure.
> >
> > Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
> 
> For this one patch,
> 
> Reviewed-by: Jani Nikula <jani.nikula@intel.com>

Takashi, do you want a topic branch pull request for this one here for
merging through the sound tree?
-Daniel

> 
> > ---
> >  include/drm/drm_edid.h | 13 +++++++++++++
> >  1 file changed, 13 insertions(+)
> >
> > diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
> > index 919933d..0706cc6 100644
> > --- a/include/drm/drm_edid.h
> > +++ b/include/drm/drm_edid.h
> > @@ -245,6 +245,7 @@ struct detailed_timing {
> >  # define DRM_ELD_AUD_SYNCH_DELAY_MAX	0xfa	/* 500 ms */
> >  
> >  #define DRM_ELD_SPEAKER			7
> > +# define DRM_ELD_SPEAKER_MASK		0x7f
> >  # define DRM_ELD_SPEAKER_RLRC		(1 << 6)
> >  # define DRM_ELD_SPEAKER_FLRC		(1 << 5)
> >  # define DRM_ELD_SPEAKER_RC		(1 << 4)
> > @@ -412,6 +413,18 @@ static inline int drm_eld_size(const uint8_t *eld)
> >  }
> >  
> >  /**
> > + * drm_eld_get_spk_alloc - Get speaker allocation
> > + * @eld: pointer to an ELD memory structure
> > + *
> > + * The returned value is the speakers mask. User has to use %DRM_ELD_SPEAKER
> > + * field definitions to identify speakers.
> > + */
> > +static inline u8 drm_eld_get_spk_alloc(const uint8_t *eld)
> > +{
> > +	return eld[DRM_ELD_SPEAKER] & DRM_ELD_SPEAKER_MASK;
> > +}
> > +
> > +/**
> >   * drm_eld_get_conn_type - Get device type hdmi/dp connected
> >   * @eld: pointer to an ELD memory structure
> >   *
> 
> -- 
> Jani Nikula, Intel Open Source Technology Center
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Takashi Iwai Dec. 28, 2016, 3:58 p.m. UTC | #3
On Mon, 19 Dec 2016 10:42:28 +0100,
Daniel Vetter wrote:
> 
> On Mon, Dec 19, 2016 at 11:09:55AM +0200, Jani Nikula wrote:
> > On Wed, 14 Dec 2016, Arnaud Pouliquen <arnaud.pouliquen@st.com> wrote:
> > > Add helper to allow users to retrieve the speaker allocations without
> > > knowledge of the ELD structure.
> > >
> > > Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
> > 
> > For this one patch,
> > 
> > Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> 
> Takashi, do you want a topic branch pull request for this one here for
> merging through the sound tree?

Sorry for the late reply, as I've been on vacation.

In this case, I prefer merging through sound tree, either mine or
Mark's asoc tree, since most of changes are about the sound drivers.

We'll usually apply on top of some clear upstream point, so that you
can pull it to drm tree, too.

Once when the merge is done, I'll inform you.


thanks,

Takashi
diff mbox

Patch

diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
index 919933d..0706cc6 100644
--- a/include/drm/drm_edid.h
+++ b/include/drm/drm_edid.h
@@ -245,6 +245,7 @@  struct detailed_timing {
 # define DRM_ELD_AUD_SYNCH_DELAY_MAX	0xfa	/* 500 ms */
 
 #define DRM_ELD_SPEAKER			7
+# define DRM_ELD_SPEAKER_MASK		0x7f
 # define DRM_ELD_SPEAKER_RLRC		(1 << 6)
 # define DRM_ELD_SPEAKER_FLRC		(1 << 5)
 # define DRM_ELD_SPEAKER_RC		(1 << 4)
@@ -412,6 +413,18 @@  static inline int drm_eld_size(const uint8_t *eld)
 }
 
 /**
+ * drm_eld_get_spk_alloc - Get speaker allocation
+ * @eld: pointer to an ELD memory structure
+ *
+ * The returned value is the speakers mask. User has to use %DRM_ELD_SPEAKER
+ * field definitions to identify speakers.
+ */
+static inline u8 drm_eld_get_spk_alloc(const uint8_t *eld)
+{
+	return eld[DRM_ELD_SPEAKER] & DRM_ELD_SPEAKER_MASK;
+}
+
+/**
  * drm_eld_get_conn_type - Get device type hdmi/dp connected
  * @eld: pointer to an ELD memory structure
  *