[RESEND,2/2] drm/i915: don't register invalid gmbus pins for skl
diff mbox

Message ID 1430915624-10423-2-git-send-email-jani.nikula@intel.com
State New
Headers show

Commit Message

Jani Nikula May 6, 2015, 12:33 p.m. UTC
Do no expose invalid gmbus pins as i2c devices to userspace.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/intel_i2c.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

David Weinehall May 11, 2015, 10:42 a.m. UTC | #1
On Wed, May 06, 2015 at 03:33:44PM +0300, Jani Nikula wrote:
> Do no expose invalid gmbus pins as i2c devices to userspace.

"Do not", perchance?


Kind regards, David
Jani Nikula May 11, 2015, 11:13 a.m. UTC | #2
On Mon, 11 May 2015, David Weinehall <david.weinehall@linux.intel.com> wrote:
> On Wed, May 06, 2015 at 03:33:44PM +0300, Jani Nikula wrote:
>> Do no expose invalid gmbus pins as i2c devices to userspace.
>
> "Do not", perchance?

Indeed, and copy-pasted to both...

Jani.


>
>
> Kind regards, David
Imre Deak May 12, 2015, 11:52 a.m. UTC | #3
On ke, 2015-05-06 at 15:33 +0300, Jani Nikula wrote:
> Do no expose invalid gmbus pins as i2c devices to userspace.
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

Looks ok, on both 1/2 and 2/2:
Reviewed-by: Imre Deak <imre.deak@intel.com>

> ---
>  drivers/gpu/drm/i915/intel_i2c.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c
> index 76070c4e76b3..92072f56e418 100644
> --- a/drivers/gpu/drm/i915/intel_i2c.c
> +++ b/drivers/gpu/drm/i915/intel_i2c.c
> @@ -56,6 +56,12 @@ static const struct gmbus_pin gmbus_pins_bdw[] = {
>  	[GMBUS_PIN_DPD] = { "dpd", GPIOF },
>  };
>  
> +static const struct gmbus_pin gmbus_pins_skl[] = {
> +	[GMBUS_PIN_DPC] = { "dpc", GPIOD },
> +	[GMBUS_PIN_DPB] = { "dpb", GPIOE },
> +	[GMBUS_PIN_DPD] = { "dpd", GPIOF },
> +};
> +
>  static const struct gmbus_pin gmbus_pins_bxt[] = {
>  	[GMBUS_PIN_1_BXT] = { "dpb", PCH_GPIOB },
>  	[GMBUS_PIN_2_BXT] = { "dpc", PCH_GPIOC },
> @@ -68,6 +74,8 @@ static const struct gmbus_pin *get_gmbus_pin(struct drm_i915_private *dev_priv,
>  {
>  	if (IS_BROXTON(dev_priv))
>  		return &gmbus_pins_bxt[pin];
> +	else if (IS_SKYLAKE(dev_priv))
> +		return &gmbus_pins_skl[pin];
>  	else if (IS_BROADWELL(dev_priv))
>  		return &gmbus_pins_bdw[pin];
>  	else
> @@ -81,6 +89,8 @@ bool intel_gmbus_is_valid_pin(struct drm_i915_private *dev_priv,
>  
>  	if (IS_BROXTON(dev_priv))
>  		size = ARRAY_SIZE(gmbus_pins_bxt);
> +	else if (IS_SKYLAKE(dev_priv))
> +		size = ARRAY_SIZE(gmbus_pins_skl);
>  	else if (IS_BROADWELL(dev_priv))
>  		size = ARRAY_SIZE(gmbus_pins_bdw);
>  	else
Jani Nikula May 12, 2015, 12:24 p.m. UTC | #4
On Tue, 12 May 2015, Imre Deak <imre.deak@intel.com> wrote:
> On ke, 2015-05-06 at 15:33 +0300, Jani Nikula wrote:
>> Do no expose invalid gmbus pins as i2c devices to userspace.
>> 
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>
> Looks ok, on both 1/2 and 2/2:
> Reviewed-by: Imre Deak <imre.deak@intel.com>

Daniel, please fix 's/Do no/Do not/' in commit messages while applying.

Thanks,
Jani.


>
>> ---
>>  drivers/gpu/drm/i915/intel_i2c.c | 10 ++++++++++
>>  1 file changed, 10 insertions(+)
>> 
>> diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c
>> index 76070c4e76b3..92072f56e418 100644
>> --- a/drivers/gpu/drm/i915/intel_i2c.c
>> +++ b/drivers/gpu/drm/i915/intel_i2c.c
>> @@ -56,6 +56,12 @@ static const struct gmbus_pin gmbus_pins_bdw[] = {
>>  	[GMBUS_PIN_DPD] = { "dpd", GPIOF },
>>  };
>>  
>> +static const struct gmbus_pin gmbus_pins_skl[] = {
>> +	[GMBUS_PIN_DPC] = { "dpc", GPIOD },
>> +	[GMBUS_PIN_DPB] = { "dpb", GPIOE },
>> +	[GMBUS_PIN_DPD] = { "dpd", GPIOF },
>> +};
>> +
>>  static const struct gmbus_pin gmbus_pins_bxt[] = {
>>  	[GMBUS_PIN_1_BXT] = { "dpb", PCH_GPIOB },
>>  	[GMBUS_PIN_2_BXT] = { "dpc", PCH_GPIOC },
>> @@ -68,6 +74,8 @@ static const struct gmbus_pin *get_gmbus_pin(struct drm_i915_private *dev_priv,
>>  {
>>  	if (IS_BROXTON(dev_priv))
>>  		return &gmbus_pins_bxt[pin];
>> +	else if (IS_SKYLAKE(dev_priv))
>> +		return &gmbus_pins_skl[pin];
>>  	else if (IS_BROADWELL(dev_priv))
>>  		return &gmbus_pins_bdw[pin];
>>  	else
>> @@ -81,6 +89,8 @@ bool intel_gmbus_is_valid_pin(struct drm_i915_private *dev_priv,
>>  
>>  	if (IS_BROXTON(dev_priv))
>>  		size = ARRAY_SIZE(gmbus_pins_bxt);
>> +	else if (IS_SKYLAKE(dev_priv))
>> +		size = ARRAY_SIZE(gmbus_pins_skl);
>>  	else if (IS_BROADWELL(dev_priv))
>>  		size = ARRAY_SIZE(gmbus_pins_bdw);
>>  	else
>
>
Daniel Vetter May 12, 2015, 1:09 p.m. UTC | #5
On Tue, May 12, 2015 at 03:24:49PM +0300, Jani Nikula wrote:
> On Tue, 12 May 2015, Imre Deak <imre.deak@intel.com> wrote:
> > On ke, 2015-05-06 at 15:33 +0300, Jani Nikula wrote:
> >> Do no expose invalid gmbus pins as i2c devices to userspace.
> >> 
> >> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> >
> > Looks ok, on both 1/2 and 2/2:
> > Reviewed-by: Imre Deak <imre.deak@intel.com>
> 
> Daniel, please fix 's/Do no/Do not/' in commit messages while applying.

Done, thanks for patches&review.
-Daniel

Patch
diff mbox

diff --git a/drivers/gpu/drm/i915/intel_i2c.c b/drivers/gpu/drm/i915/intel_i2c.c
index 76070c4e76b3..92072f56e418 100644
--- a/drivers/gpu/drm/i915/intel_i2c.c
+++ b/drivers/gpu/drm/i915/intel_i2c.c
@@ -56,6 +56,12 @@  static const struct gmbus_pin gmbus_pins_bdw[] = {
 	[GMBUS_PIN_DPD] = { "dpd", GPIOF },
 };
 
+static const struct gmbus_pin gmbus_pins_skl[] = {
+	[GMBUS_PIN_DPC] = { "dpc", GPIOD },
+	[GMBUS_PIN_DPB] = { "dpb", GPIOE },
+	[GMBUS_PIN_DPD] = { "dpd", GPIOF },
+};
+
 static const struct gmbus_pin gmbus_pins_bxt[] = {
 	[GMBUS_PIN_1_BXT] = { "dpb", PCH_GPIOB },
 	[GMBUS_PIN_2_BXT] = { "dpc", PCH_GPIOC },
@@ -68,6 +74,8 @@  static const struct gmbus_pin *get_gmbus_pin(struct drm_i915_private *dev_priv,
 {
 	if (IS_BROXTON(dev_priv))
 		return &gmbus_pins_bxt[pin];
+	else if (IS_SKYLAKE(dev_priv))
+		return &gmbus_pins_skl[pin];
 	else if (IS_BROADWELL(dev_priv))
 		return &gmbus_pins_bdw[pin];
 	else
@@ -81,6 +89,8 @@  bool intel_gmbus_is_valid_pin(struct drm_i915_private *dev_priv,
 
 	if (IS_BROXTON(dev_priv))
 		size = ARRAY_SIZE(gmbus_pins_bxt);
+	else if (IS_SKYLAKE(dev_priv))
+		size = ARRAY_SIZE(gmbus_pins_skl);
 	else if (IS_BROADWELL(dev_priv))
 		size = ARRAY_SIZE(gmbus_pins_bdw);
 	else