linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/powernv: Fix mis-merge of OPAL support for LEDS driver
@ 2015-08-21 23:42 Michael Ellerman
  2015-08-22  4:06 ` Vasant Hegde
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Ellerman @ 2015-08-21 23:42 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Stephen Rothwell, khandual, stewart, hegdevasant

When I merged the OPAL support for the powernv LEDS driver I missed a
hunk.

This is slightly modified from the original patch, as the original added
code to opal-api.h which is not in the skiboot version, which is
discouraged.

Instead those values are moved into the driver, which is the only place
they are used.

Fixes: 8a8d91817aec ("powerpc/powernv: Add OPAL interfaces for accessing and modifying system LED states")
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 arch/powerpc/include/asm/opal-api.h | 12 ++++++++++++
 drivers/leds/leds-powernv.c         |  6 +++---
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/include/asm/opal-api.h b/arch/powerpc/include/asm/opal-api.h
index b516ec1d3b4c..9784c9241c70 100644
--- a/arch/powerpc/include/asm/opal-api.h
+++ b/arch/powerpc/include/asm/opal-api.h
@@ -343,6 +343,18 @@ enum OpalPciResetState {
 	OPAL_ASSERT_RESET   = 1
 };
 
+enum OpalSlotLedType {
+	OPAL_SLOT_LED_TYPE_ID = 0,	/* IDENTIFY LED */
+	OPAL_SLOT_LED_TYPE_FAULT = 1,	/* FAULT LED */
+	OPAL_SLOT_LED_TYPE_ATTN = 2,	/* System Attention LED */
+	OPAL_SLOT_LED_TYPE_MAX = 3
+};
+
+enum OpalSlotLedState {
+	OPAL_SLOT_LED_STATE_OFF = 0,	/* LED is OFF */
+	OPAL_SLOT_LED_STATE_ON = 1	/* LED is ON */
+};
+
 /*
  * Address cycle types for LPC accesses. These also correspond
  * to the content of the first cell of the "reg" property for
diff --git a/drivers/leds/leds-powernv.c b/drivers/leds/leds-powernv.c
index a2fea192573b..2c5c5b12ab64 100644
--- a/drivers/leds/leds-powernv.c
+++ b/drivers/leds/leds-powernv.c
@@ -27,9 +27,9 @@ struct led_type_map {
 	const char	*desc;
 };
 static const struct led_type_map led_type_map[] = {
-	{OPAL_SLOT_LED_TYPE_ID,		POWERNV_LED_TYPE_IDENTIFY},
-	{OPAL_SLOT_LED_TYPE_FAULT,	POWERNV_LED_TYPE_FAULT},
-	{OPAL_SLOT_LED_TYPE_ATTN,	POWERNV_LED_TYPE_ATTENTION},
+	{OPAL_SLOT_LED_TYPE_ID,		"identify"},
+	{OPAL_SLOT_LED_TYPE_FAULT,	"fault"},
+	{OPAL_SLOT_LED_TYPE_ATTN,	"attention"},
 	{-1,				NULL},
 };
 
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] powerpc/powernv: Fix mis-merge of OPAL support for LEDS driver
  2015-08-21 23:42 [PATCH] powerpc/powernv: Fix mis-merge of OPAL support for LEDS driver Michael Ellerman
@ 2015-08-22  4:06 ` Vasant Hegde
  2015-08-22 11:13   ` Michael Ellerman
  0 siblings, 1 reply; 3+ messages in thread
From: Vasant Hegde @ 2015-08-22  4:06 UTC (permalink / raw)
  To: Michael Ellerman, linuxppc-dev; +Cc: Stephen Rothwell, khandual, stewart

On 08/22/2015 05:12 AM, Michael Ellerman wrote:
> When I merged the OPAL support for the powernv LEDS driver I missed a
> hunk.
> 
> This is slightly modified from the original patch, as the original added
> code to opal-api.h which is not in the skiboot version, which is
> discouraged.

Yeah. I should have made sure opal-api.h is in sync with skiboot. On skiboot
side I added below macros to fsp-leds.h instead of opal-api.h :-(

Anyway for now these macros are used by led driver only (on both side).. Hence I
think its fine to add to driver code itself. But we should make sure these
strings won't change as we use them while creating sysfs entries and use that
information to identify the type of LED.


> 
> Instead those values are moved into the driver, which is the only place
> they are used.
> 
> Fixes: 8a8d91817aec ("powerpc/powernv: Add OPAL interfaces for accessing and modifying system LED states")
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

Patch looks good.

Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>

-Vasant

> ---
>  arch/powerpc/include/asm/opal-api.h | 12 ++++++++++++
>  drivers/leds/leds-powernv.c         |  6 +++---
>  2 files changed, 15 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/powerpc/include/asm/opal-api.h b/arch/powerpc/include/asm/opal-api.h
> index b516ec1d3b4c..9784c9241c70 100644
> --- a/arch/powerpc/include/asm/opal-api.h
> +++ b/arch/powerpc/include/asm/opal-api.h
> @@ -343,6 +343,18 @@ enum OpalPciResetState {
>  	OPAL_ASSERT_RESET   = 1
>  };
> 
> +enum OpalSlotLedType {
> +	OPAL_SLOT_LED_TYPE_ID = 0,	/* IDENTIFY LED */
> +	OPAL_SLOT_LED_TYPE_FAULT = 1,	/* FAULT LED */
> +	OPAL_SLOT_LED_TYPE_ATTN = 2,	/* System Attention LED */
> +	OPAL_SLOT_LED_TYPE_MAX = 3
> +};
> +
> +enum OpalSlotLedState {
> +	OPAL_SLOT_LED_STATE_OFF = 0,	/* LED is OFF */
> +	OPAL_SLOT_LED_STATE_ON = 1	/* LED is ON */
> +};
> +
>  /*
>   * Address cycle types for LPC accesses. These also correspond
>   * to the content of the first cell of the "reg" property for
> diff --git a/drivers/leds/leds-powernv.c b/drivers/leds/leds-powernv.c
> index a2fea192573b..2c5c5b12ab64 100644
> --- a/drivers/leds/leds-powernv.c
> +++ b/drivers/leds/leds-powernv.c
> @@ -27,9 +27,9 @@ struct led_type_map {
>  	const char	*desc;
>  };
>  static const struct led_type_map led_type_map[] = {
> -	{OPAL_SLOT_LED_TYPE_ID,		POWERNV_LED_TYPE_IDENTIFY},
> -	{OPAL_SLOT_LED_TYPE_FAULT,	POWERNV_LED_TYPE_FAULT},
> -	{OPAL_SLOT_LED_TYPE_ATTN,	POWERNV_LED_TYPE_ATTENTION},
> +	{OPAL_SLOT_LED_TYPE_ID,		"identify"},
> +	{OPAL_SLOT_LED_TYPE_FAULT,	"fault"},
> +	{OPAL_SLOT_LED_TYPE_ATTN,	"attention"},
>  	{-1,				NULL},
>  };
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] powerpc/powernv: Fix mis-merge of OPAL support for LEDS driver
  2015-08-22  4:06 ` Vasant Hegde
@ 2015-08-22 11:13   ` Michael Ellerman
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2015-08-22 11:13 UTC (permalink / raw)
  To: Vasant Hegde; +Cc: linuxppc-dev, Stephen Rothwell, khandual, stewart

On Sat, 2015-08-22 at 09:36 +0530, Vasant Hegde wrote:
> On 08/22/2015 05:12 AM, Michael Ellerman wrote:
> > When I merged the OPAL support for the powernv LEDS driver I missed a
> > hunk.
> > 
> > This is slightly modified from the original patch, as the original added
> > code to opal-api.h which is not in the skiboot version, which is
> > discouraged.
> 
> Yeah. I should have made sure opal-api.h is in sync with skiboot. On skiboot
> side I added below macros to fsp-leds.h instead of opal-api.h :-(

Yeah, I should have remembered too. We'll try to remember in future.

> Anyway for now these macros are used by led driver only (on both side).. Hence I
> think its fine to add to driver code itself. But we should make sure these
> strings won't change as we use them while creating sysfs entries and use that
> information to identify the type of LED.

Sure. If you want to add a comment or something saying they must not change
that's fine by me.

> > Instead those values are moved into the driver, which is the only place
> > they are used.
> > 
> > Fixes: 8a8d91817aec ("powerpc/powernv: Add OPAL interfaces for accessing and modifying system LED states")
> > Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> 
> Patch looks good.
> 
> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>

Thanks.

I've pushed it to next.

cheers

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-08-22 11:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-21 23:42 [PATCH] powerpc/powernv: Fix mis-merge of OPAL support for LEDS driver Michael Ellerman
2015-08-22  4:06 ` Vasant Hegde
2015-08-22 11:13   ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).