diff mbox

[01/14] drm/i915: Check for platform specific GPIO config

Message ID 1483953334-26168-1-git-send-email-vidya.srinivas@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Srinivas, Vidya Jan. 9, 2017, 9:15 a.m. UTC
From: Uma Shankar <uma.shankar@intel.com>

Panel GPIO control should be done based on platform. Add a check
to restrict VLV and CHT specific GPIO confirguration, so that
they dont apply to other platforms.

Signed-off-by: Uma Shankar <uma.shankar@intel.com>
---
 drivers/gpu/drm/i915/intel_dsi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Jani Nikula Jan. 9, 2017, 10:18 a.m. UTC | #1
On Mon, 09 Jan 2017, Vidya Srinivas <vidya.srinivas@intel.com> wrote:
> From: Uma Shankar <uma.shankar@intel.com>
>
> Panel GPIO control should be done based on platform. Add a check
> to restrict VLV and CHT specific GPIO confirguration, so that
> they dont apply to other platforms.

There are no code paths that would have
dev_priv->vbt.dsi.config->pwm_blc == PPS_BLC_PMIC on platforms other
than VLV/CVH.

BR,
Jani.

>
> Signed-off-by: Uma Shankar <uma.shankar@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_dsi.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
> index 16732e7..27d8f95 100644
> --- a/drivers/gpu/drm/i915/intel_dsi.c
> +++ b/drivers/gpu/drm/i915/intel_dsi.c
> @@ -1560,7 +1560,8 @@ void intel_dsi_init(struct drm_i915_private *dev_priv)
>  	 * In case of BYT with CRC PMIC, we need to use GPIO for
>  	 * Panel control.
>  	 */
> -	if (dev_priv->vbt.dsi.config->pwm_blc == PPS_BLC_PMIC) {
> +	if ((IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) &&
> +		(dev_priv->vbt.dsi.config->pwm_blc == PPS_BLC_PMIC)) {
>  		intel_dsi->gpio_panel =
>  			gpiod_get(dev->dev, "panel", GPIOD_OUT_HIGH);
Srinivas, Vidya Feb. 8, 2017, 10:30 a.m. UTC | #2
> -----Original Message-----
> From: Jani Nikula [mailto:jani.nikula@linux.intel.com]
> Sent: Monday, January 9, 2017 3:48 PM
> To: Srinivas, Vidya <vidya.srinivas@intel.com>; intel-
> gfx@lists.freedesktop.org
> Subject: Re: [Intel-gfx] [PATCH 01/14] drm/i915: Check for platform specific
> GPIO config
> 
> On Mon, 09 Jan 2017, Vidya Srinivas <vidya.srinivas@intel.com> wrote:
> > From: Uma Shankar <uma.shankar@intel.com>
> >
> > Panel GPIO control should be done based on platform. Add a check to
> > restrict VLV and CHT specific GPIO confirguration, so that they dont
> > apply to other platforms.
> 
> There are no code paths that would have
> dev_priv->vbt.dsi.config->pwm_blc == PPS_BLC_PMIC on platforms other
> than VLV/CVH.
This particular field is by default 0 which triggers a redundant gpio get operation
for BXT. Hence limiting this to BYT/CHT platforms.

Regards
Vidya
> 
> BR,
> Jani.
> 
> >
> > Signed-off-by: Uma Shankar <uma.shankar@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_dsi.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_dsi.c
> > b/drivers/gpu/drm/i915/intel_dsi.c
> > index 16732e7..27d8f95 100644
> > --- a/drivers/gpu/drm/i915/intel_dsi.c
> > +++ b/drivers/gpu/drm/i915/intel_dsi.c
> > @@ -1560,7 +1560,8 @@ void intel_dsi_init(struct drm_i915_private
> *dev_priv)
> >  	 * In case of BYT with CRC PMIC, we need to use GPIO for
> >  	 * Panel control.
> >  	 */
> > -	if (dev_priv->vbt.dsi.config->pwm_blc == PPS_BLC_PMIC) {
> > +	if ((IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) &&
> > +		(dev_priv->vbt.dsi.config->pwm_blc == PPS_BLC_PMIC)) {
> >  		intel_dsi->gpio_panel =
> >  			gpiod_get(dev->dev, "panel", GPIOD_OUT_HIGH);
> 
> --
> Jani Nikula, Intel Open Source Technology Center
Jani Nikula Feb. 8, 2017, 10:41 a.m. UTC | #3
On Wed, 08 Feb 2017, "Srinivas, Vidya" <vidya.srinivas@intel.com> wrote:
>> -----Original Message-----
>> From: Jani Nikula [mailto:jani.nikula@linux.intel.com]
>> Sent: Monday, January 9, 2017 3:48 PM
>> To: Srinivas, Vidya <vidya.srinivas@intel.com>; intel-
>> gfx@lists.freedesktop.org
>> Subject: Re: [Intel-gfx] [PATCH 01/14] drm/i915: Check for platform specific
>> GPIO config
>> 
>> On Mon, 09 Jan 2017, Vidya Srinivas <vidya.srinivas@intel.com> wrote:
>> > From: Uma Shankar <uma.shankar@intel.com>
>> >
>> > Panel GPIO control should be done based on platform. Add a check to
>> > restrict VLV and CHT specific GPIO confirguration, so that they dont
>> > apply to other platforms.
>> 
>> There are no code paths that would have
>> dev_priv->vbt.dsi.config->pwm_blc == PPS_BLC_PMIC on platforms other
>> than VLV/CVH.
> This particular field is by default 0 which triggers a redundant gpio
> get operation for BXT. Hence limiting this to BYT/CHT platforms.

What do you mean by default 0? Are you saying that you have machines
that have a VBT which indicate they have PMIC backlight control when
they in fact don't?

BR,
Jani.



>
> Regards
> Vidya
>> 
>> BR,
>> Jani.
>> 
>> >
>> > Signed-off-by: Uma Shankar <uma.shankar@intel.com>
>> > ---
>> >  drivers/gpu/drm/i915/intel_dsi.c | 3 ++-
>> >  1 file changed, 2 insertions(+), 1 deletion(-)
>> >
>> > diff --git a/drivers/gpu/drm/i915/intel_dsi.c
>> > b/drivers/gpu/drm/i915/intel_dsi.c
>> > index 16732e7..27d8f95 100644
>> > --- a/drivers/gpu/drm/i915/intel_dsi.c
>> > +++ b/drivers/gpu/drm/i915/intel_dsi.c
>> > @@ -1560,7 +1560,8 @@ void intel_dsi_init(struct drm_i915_private
>> *dev_priv)
>> >  	 * In case of BYT with CRC PMIC, we need to use GPIO for
>> >  	 * Panel control.
>> >  	 */
>> > -	if (dev_priv->vbt.dsi.config->pwm_blc == PPS_BLC_PMIC) {
>> > +	if ((IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) &&
>> > +		(dev_priv->vbt.dsi.config->pwm_blc == PPS_BLC_PMIC)) {
>> >  		intel_dsi->gpio_panel =
>> >  			gpiod_get(dev->dev, "panel", GPIOD_OUT_HIGH);
>> 
>> --
>> Jani Nikula, Intel Open Source Technology Center
Srinivas, Vidya Feb. 8, 2017, 10:58 a.m. UTC | #4
> -----Original Message-----
> From: Jani Nikula [mailto:jani.nikula@linux.intel.com]
> Sent: Wednesday, February 8, 2017 4:11 PM
> To: Srinivas, Vidya <vidya.srinivas@intel.com>; intel-
> gfx@lists.freedesktop.org
> Subject: RE: [Intel-gfx] [PATCH 01/14] drm/i915: Check for platform specific
> GPIO config
> 
> On Wed, 08 Feb 2017, "Srinivas, Vidya" <vidya.srinivas@intel.com> wrote:
> >> -----Original Message-----
> >> From: Jani Nikula [mailto:jani.nikula@linux.intel.com]
> >> Sent: Monday, January 9, 2017 3:48 PM
> >> To: Srinivas, Vidya <vidya.srinivas@intel.com>; intel-
> >> gfx@lists.freedesktop.org
> >> Subject: Re: [Intel-gfx] [PATCH 01/14] drm/i915: Check for platform
> >> specific GPIO config
> >>
> >> On Mon, 09 Jan 2017, Vidya Srinivas <vidya.srinivas@intel.com> wrote:
> >> > From: Uma Shankar <uma.shankar@intel.com>
> >> >
> >> > Panel GPIO control should be done based on platform. Add a check to
> >> > restrict VLV and CHT specific GPIO confirguration, so that they
> >> > dont apply to other platforms.
> >>
> >> There are no code paths that would have
> >> dev_priv->vbt.dsi.config->pwm_blc == PPS_BLC_PMIC on platforms other
> >> than VLV/CVH.
> > This particular field is by default 0 which triggers a redundant gpio
> > get operation for BXT. Hence limiting this to BYT/CHT platforms.
> 
> What do you mean by default 0? Are you saying that you have machines that
> have a VBT which indicate they have PMIC backlight control when they in
> fact don't?

Sorry, what I meant is PPS_BLC_PMIC is 0. So even if the VBT field is not changed 
it will still become true causing the condition to pass.
> 
> BR,
> Jani.
> 
> 
> 
> >
> > Regards
> > Vidya
> >>
> >> BR,
> >> Jani.
> >>
> >> >
> >> > Signed-off-by: Uma Shankar <uma.shankar@intel.com>
> >> > ---
> >> >  drivers/gpu/drm/i915/intel_dsi.c | 3 ++-
> >> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >> >
> >> > diff --git a/drivers/gpu/drm/i915/intel_dsi.c
> >> > b/drivers/gpu/drm/i915/intel_dsi.c
> >> > index 16732e7..27d8f95 100644
> >> > --- a/drivers/gpu/drm/i915/intel_dsi.c
> >> > +++ b/drivers/gpu/drm/i915/intel_dsi.c
> >> > @@ -1560,7 +1560,8 @@ void intel_dsi_init(struct drm_i915_private
> >> *dev_priv)
> >> >  	 * In case of BYT with CRC PMIC, we need to use GPIO for
> >> >  	 * Panel control.
> >> >  	 */
> >> > -	if (dev_priv->vbt.dsi.config->pwm_blc == PPS_BLC_PMIC) {
> >> > +	if ((IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) &&
> >> > +		(dev_priv->vbt.dsi.config->pwm_blc == PPS_BLC_PMIC)) {
> >> >  		intel_dsi->gpio_panel =
> >> >  			gpiod_get(dev->dev, "panel", GPIOD_OUT_HIGH);
> >>
> >> --
> >> Jani Nikula, Intel Open Source Technology Center
> 
> --
> Jani Nikula, Intel Open Source Technology Center
Jani Nikula Feb. 8, 2017, 11:11 a.m. UTC | #5
On Wed, 08 Feb 2017, "Srinivas, Vidya" <vidya.srinivas@intel.com> wrote:
>> -----Original Message-----
>> From: Jani Nikula [mailto:jani.nikula@linux.intel.com]
>> Sent: Wednesday, February 8, 2017 4:11 PM
>> To: Srinivas, Vidya <vidya.srinivas@intel.com>; intel-
>> gfx@lists.freedesktop.org
>> Subject: RE: [Intel-gfx] [PATCH 01/14] drm/i915: Check for platform specific
>> GPIO config
>> 
>> On Wed, 08 Feb 2017, "Srinivas, Vidya" <vidya.srinivas@intel.com> wrote:
>> >> -----Original Message-----
>> >> From: Jani Nikula [mailto:jani.nikula@linux.intel.com]
>> >> Sent: Monday, January 9, 2017 3:48 PM
>> >> To: Srinivas, Vidya <vidya.srinivas@intel.com>; intel-
>> >> gfx@lists.freedesktop.org
>> >> Subject: Re: [Intel-gfx] [PATCH 01/14] drm/i915: Check for platform
>> >> specific GPIO config
>> >>
>> >> On Mon, 09 Jan 2017, Vidya Srinivas <vidya.srinivas@intel.com> wrote:
>> >> > From: Uma Shankar <uma.shankar@intel.com>
>> >> >
>> >> > Panel GPIO control should be done based on platform. Add a check to
>> >> > restrict VLV and CHT specific GPIO confirguration, so that they
>> >> > dont apply to other platforms.
>> >>
>> >> There are no code paths that would have
>> >> dev_priv->vbt.dsi.config->pwm_blc == PPS_BLC_PMIC on platforms other
>> >> than VLV/CVH.
>> > This particular field is by default 0 which triggers a redundant gpio
>> > get operation for BXT. Hence limiting this to BYT/CHT platforms.
>> 
>> What do you mean by default 0? Are you saying that you have machines that
>> have a VBT which indicate they have PMIC backlight control when they in
>> fact don't?
>
> Sorry, what I meant is PPS_BLC_PMIC is 0. So even if the VBT field is
> not changed it will still become true causing the condition to pass.

In other words, the VBT contains PPS_BLC_PMIC for a machine that should
not use PMIC. In yet other words, the VBT contains incorrect
information. Right?

BR,
Jani.


>> 
>> BR,
>> Jani.
>> 
>> 
>> 
>> >
>> > Regards
>> > Vidya
>> >>
>> >> BR,
>> >> Jani.
>> >>
>> >> >
>> >> > Signed-off-by: Uma Shankar <uma.shankar@intel.com>
>> >> > ---
>> >> >  drivers/gpu/drm/i915/intel_dsi.c | 3 ++-
>> >> >  1 file changed, 2 insertions(+), 1 deletion(-)
>> >> >
>> >> > diff --git a/drivers/gpu/drm/i915/intel_dsi.c
>> >> > b/drivers/gpu/drm/i915/intel_dsi.c
>> >> > index 16732e7..27d8f95 100644
>> >> > --- a/drivers/gpu/drm/i915/intel_dsi.c
>> >> > +++ b/drivers/gpu/drm/i915/intel_dsi.c
>> >> > @@ -1560,7 +1560,8 @@ void intel_dsi_init(struct drm_i915_private
>> >> *dev_priv)
>> >> >  	 * In case of BYT with CRC PMIC, we need to use GPIO for
>> >> >  	 * Panel control.
>> >> >  	 */
>> >> > -	if (dev_priv->vbt.dsi.config->pwm_blc == PPS_BLC_PMIC) {
>> >> > +	if ((IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) &&
>> >> > +		(dev_priv->vbt.dsi.config->pwm_blc == PPS_BLC_PMIC)) {
>> >> >  		intel_dsi->gpio_panel =
>> >> >  			gpiod_get(dev->dev, "panel", GPIOD_OUT_HIGH);
>> >>
>> >> --
>> >> Jani Nikula, Intel Open Source Technology Center
>> 
>> --
>> Jani Nikula, Intel Open Source Technology Center
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
index 16732e7..27d8f95 100644
--- a/drivers/gpu/drm/i915/intel_dsi.c
+++ b/drivers/gpu/drm/i915/intel_dsi.c
@@ -1560,7 +1560,8 @@  void intel_dsi_init(struct drm_i915_private *dev_priv)
 	 * In case of BYT with CRC PMIC, we need to use GPIO for
 	 * Panel control.
 	 */
-	if (dev_priv->vbt.dsi.config->pwm_blc == PPS_BLC_PMIC) {
+	if ((IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) &&
+		(dev_priv->vbt.dsi.config->pwm_blc == PPS_BLC_PMIC)) {
 		intel_dsi->gpio_panel =
 			gpiod_get(dev->dev, "panel", GPIOD_OUT_HIGH);