Patchwork [v4,07/15] Platform: OLPC: Use BIT() and GENMASK() for event masks

login
register
mail settings
Submitter Lubomir Rintel
Date Jan. 8, 2019, 5:58 p.m.
Message ID <20190108175818.705110-8-lkundrak@v3.sk>
Download mbox | patch
Permalink /patch/695127/
State New
Headers show

Comments

Lubomir Rintel - Jan. 8, 2019, 5:58 p.m.
Just a cosmetic tidy-up.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>

---
Changes since v1:
- This patch was added to the set.

 include/linux/olpc-ec.h | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)
Andy Shevchenko - Jan. 9, 2019, 11:14 a.m.
On Tue, Jan 8, 2019 at 7:58 PM Lubomir Rintel <lkundrak@v3.sk> wrote:
>
> Just a cosmetic tidy-up.
>

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

> Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
>
> ---
> Changes since v1:
> - This patch was added to the set.
>
>  include/linux/olpc-ec.h | 23 ++++++++++++-----------
>  1 file changed, 12 insertions(+), 11 deletions(-)
>
> diff --git a/include/linux/olpc-ec.h b/include/linux/olpc-ec.h
> index e28f72416a57..c4602364e909 100644
> --- a/include/linux/olpc-ec.h
> +++ b/include/linux/olpc-ec.h
> @@ -2,6 +2,8 @@
>  #ifndef _LINUX_OLPC_EC_H
>  #define _LINUX_OLPC_EC_H
>
> +#include <linux/bits.h>
> +
>  /* XO-1 EC commands */
>  #define EC_FIRMWARE_REV                        0x08
>  #define EC_WRITE_SCI_MASK              0x1b
> @@ -17,17 +19,16 @@
>  #define EC_EXT_SCI_QUERY               0x85
>
>  /* SCI source values */
> -#define EC_SCI_SRC_EMPTY        0x00
> -#define EC_SCI_SRC_GAME         0x01
> -#define EC_SCI_SRC_BATTERY      0x02
> -#define EC_SCI_SRC_BATSOC       0x04
> -#define EC_SCI_SRC_BATERR       0x08
> -#define EC_SCI_SRC_EBOOK        0x10    /* XO-1 only */
> -#define EC_SCI_SRC_WLAN         0x20    /* XO-1 only */
> -#define EC_SCI_SRC_ACPWR        0x40
> -#define EC_SCI_SRC_BATCRIT      0x80
> -#define EC_SCI_SRC_GPWAKE       0x100   /* XO-1.5 only */
> -#define EC_SCI_SRC_ALL          0x1FF
> +#define EC_SCI_SRC_GAME         BIT(0)
> +#define EC_SCI_SRC_BATTERY      BIT(1)
> +#define EC_SCI_SRC_BATSOC       BIT(2)
> +#define EC_SCI_SRC_BATERR       BIT(3)
> +#define EC_SCI_SRC_EBOOK        BIT(4)    /* XO-1 only */
> +#define EC_SCI_SRC_WLAN         BIT(5)    /* XO-1 only */
> +#define EC_SCI_SRC_ACPWR        BIT(6)
> +#define EC_SCI_SRC_BATCRIT      BIT(7)
> +#define EC_SCI_SRC_GPWAKE       BIT(8)   /* XO-1.5 only */
> +#define EC_SCI_SRC_ALL          GENMASK(8, 0)
>
>  struct platform_device;
>
> --
> 2.20.1
>

Patch

diff --git a/include/linux/olpc-ec.h b/include/linux/olpc-ec.h
index e28f72416a57..c4602364e909 100644
--- a/include/linux/olpc-ec.h
+++ b/include/linux/olpc-ec.h
@@ -2,6 +2,8 @@ 
 #ifndef _LINUX_OLPC_EC_H
 #define _LINUX_OLPC_EC_H
 
+#include <linux/bits.h>
+
 /* XO-1 EC commands */
 #define EC_FIRMWARE_REV			0x08
 #define EC_WRITE_SCI_MASK		0x1b
@@ -17,17 +19,16 @@ 
 #define EC_EXT_SCI_QUERY		0x85
 
 /* SCI source values */
-#define EC_SCI_SRC_EMPTY        0x00
-#define EC_SCI_SRC_GAME         0x01
-#define EC_SCI_SRC_BATTERY      0x02
-#define EC_SCI_SRC_BATSOC       0x04
-#define EC_SCI_SRC_BATERR       0x08
-#define EC_SCI_SRC_EBOOK        0x10    /* XO-1 only */
-#define EC_SCI_SRC_WLAN         0x20    /* XO-1 only */
-#define EC_SCI_SRC_ACPWR        0x40
-#define EC_SCI_SRC_BATCRIT      0x80
-#define EC_SCI_SRC_GPWAKE       0x100   /* XO-1.5 only */
-#define EC_SCI_SRC_ALL          0x1FF
+#define EC_SCI_SRC_GAME         BIT(0)
+#define EC_SCI_SRC_BATTERY      BIT(1)
+#define EC_SCI_SRC_BATSOC       BIT(2)
+#define EC_SCI_SRC_BATERR       BIT(3)
+#define EC_SCI_SRC_EBOOK        BIT(4)    /* XO-1 only */
+#define EC_SCI_SRC_WLAN         BIT(5)    /* XO-1 only */
+#define EC_SCI_SRC_ACPWR        BIT(6)
+#define EC_SCI_SRC_BATCRIT      BIT(7)
+#define EC_SCI_SRC_GPWAKE       BIT(8)   /* XO-1.5 only */
+#define EC_SCI_SRC_ALL          GENMASK(8, 0)
 
 struct platform_device;