* [PATCH] platform/x86: thinkpad_acpi: Cleanup quirks macros
@ 2018-11-16 13:18 Jouke Witteveen
[not found] ` <20181116131800.GA11114-7Pk1HLXsvWqf6HGZUO+WniZi+YwRKgec@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Jouke Witteveen @ 2018-11-16 13:18 UTC (permalink / raw)
To: ibm-acpi-N3TV7GIv+o9fyO9Q7EP/yw, dvhart-wEGCiKHe2LqWVfeAwA7xHQ,
andy-wEGCiKHe2LqWVfeAwA7xHQ
Cc: ibm-acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
platform-driver-x86-u79uwXL29TY76Z2rM5mHXA
Signed-off-by: Jouke Witteveen <j.witteveen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
The only difference in the generated code is that the quirk values are
now within parentheses.
drivers/platform/x86/thinkpad_acpi.c | 45 ++++++++--------------------
1 file changed, 13 insertions(+), 32 deletions(-)
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index fde08a997..e1e51bfb3 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -478,6 +478,12 @@ do { \
.ec = TPACPI_MATCH_ANY, \
.quirks = (__quirk) }
+#define TPACPI_QEC_IBM(__id1, __id2, __quirk) \
+ { .vendor = PCI_VENDOR_ID_IBM, \
+ .bios = TPACPI_MATCH_ANY, \
+ .ec = TPID(__id1, __id2), \
+ .quirks = (__quirk) }
+
#define TPACPI_QEC_LNV(__id1, __id2, __quirk) \
{ .vendor = PCI_VENDOR_ID_LENOVO, \
.bios = TPACPI_MATCH_ANY, \
@@ -5973,9 +5979,6 @@ static const struct tpacpi_quirk led_useful_qtable[] __initconst = {
},
};
-#undef TPACPI_LEDQ_IBM
-#undef TPACPI_LEDQ_LNV
-
static enum led_access_mode __init led_init_detect_mode(void)
{
acpi_status status;
@@ -8710,40 +8713,18 @@ static const struct attribute_group fan_attr_group = {
.attrs = fan_attributes,
};
-#define TPACPI_FAN_Q1 0x0001 /* Unitialized HFSP */
+#define TPACPI_FAN_Q1 0x0001 /* Unitialized HFSP */
#define TPACPI_FAN_2FAN 0x0002 /* EC 0x31 bit 0 selects fan2 */
-#define TPACPI_FAN_QI(__id1, __id2, __quirks) \
- { .vendor = PCI_VENDOR_ID_IBM, \
- .bios = TPACPI_MATCH_ANY, \
- .ec = TPID(__id1, __id2), \
- .quirks = __quirks }
-
-#define TPACPI_FAN_QL(__id1, __id2, __quirks) \
- { .vendor = PCI_VENDOR_ID_LENOVO, \
- .bios = TPACPI_MATCH_ANY, \
- .ec = TPID(__id1, __id2), \
- .quirks = __quirks }
-
-#define TPACPI_FAN_QB(__id1, __id2, __quirks) \
- { .vendor = PCI_VENDOR_ID_LENOVO, \
- .bios = TPID(__id1, __id2), \
- .ec = TPACPI_MATCH_ANY, \
- .quirks = __quirks }
-
static const struct tpacpi_quirk fan_quirk_table[] __initconst = {
- TPACPI_FAN_QI('1', 'Y', TPACPI_FAN_Q1),
- TPACPI_FAN_QI('7', '8', TPACPI_FAN_Q1),
- TPACPI_FAN_QI('7', '6', TPACPI_FAN_Q1),
- TPACPI_FAN_QI('7', '0', TPACPI_FAN_Q1),
- TPACPI_FAN_QL('7', 'M', TPACPI_FAN_2FAN),
- TPACPI_FAN_QB('N', '1', TPACPI_FAN_2FAN),
+ TPACPI_QEC_IBM('1', 'Y', TPACPI_FAN_Q1),
+ TPACPI_QEC_IBM('7', '8', TPACPI_FAN_Q1),
+ TPACPI_QEC_IBM('7', '6', TPACPI_FAN_Q1),
+ TPACPI_QEC_IBM('7', '0', TPACPI_FAN_Q1),
+ TPACPI_QEC_LNV('7', 'M', TPACPI_FAN_2FAN),
+ TPACPI_Q_LNV('N', '1', TPACPI_FAN_2FAN),
};
-#undef TPACPI_FAN_QL
-#undef TPACPI_FAN_QI
-#undef TPACPI_FAN_QB
-
static int __init fan_init(struct ibm_init_struct *iibm)
{
int rc;
--
2.19.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] platform/x86: thinkpad_acpi: Cleanup quirks macros
[not found] ` <20181116131800.GA11114-7Pk1HLXsvWqf6HGZUO+WniZi+YwRKgec@public.gmane.org>
@ 2018-12-03 17:31 ` Andy Shevchenko
[not found] ` <CAHp75VeC+4j56XbiFK=N=9_RcXz9XNdCjaBB5udkMt0np_wXsQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2018-12-03 17:31 UTC (permalink / raw)
To: Jouke Witteveen
Cc: Darren Hart, Platform Driver, Henrique de Moraes Holschuh,
Andy Shevchenko, ibm-acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
On Fri, Nov 16, 2018 at 3:18 PM Jouke Witteveen <j.witteveen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
Please, submit a new version with changelog.
Though, before doing this, I would hear if Henrique is OK with the
change (for me it looks good)
> Signed-off-by: Jouke Witteveen <j.witteveen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
> The only difference in the generated code is that the quirk values are
> now within parentheses.
>
> drivers/platform/x86/thinkpad_acpi.c | 45 ++++++++--------------------
> 1 file changed, 13 insertions(+), 32 deletions(-)
>
> diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
> index fde08a997..e1e51bfb3 100644
> --- a/drivers/platform/x86/thinkpad_acpi.c
> +++ b/drivers/platform/x86/thinkpad_acpi.c
> @@ -478,6 +478,12 @@ do { \
> .ec = TPACPI_MATCH_ANY, \
> .quirks = (__quirk) }
>
> +#define TPACPI_QEC_IBM(__id1, __id2, __quirk) \
> + { .vendor = PCI_VENDOR_ID_IBM, \
> + .bios = TPACPI_MATCH_ANY, \
> + .ec = TPID(__id1, __id2), \
> + .quirks = (__quirk) }
> +
> #define TPACPI_QEC_LNV(__id1, __id2, __quirk) \
> { .vendor = PCI_VENDOR_ID_LENOVO, \
> .bios = TPACPI_MATCH_ANY, \
> @@ -5973,9 +5979,6 @@ static const struct tpacpi_quirk led_useful_qtable[] __initconst = {
> },
> };
>
> -#undef TPACPI_LEDQ_IBM
> -#undef TPACPI_LEDQ_LNV
> -
> static enum led_access_mode __init led_init_detect_mode(void)
> {
> acpi_status status;
> @@ -8710,40 +8713,18 @@ static const struct attribute_group fan_attr_group = {
> .attrs = fan_attributes,
> };
>
> -#define TPACPI_FAN_Q1 0x0001 /* Unitialized HFSP */
> +#define TPACPI_FAN_Q1 0x0001 /* Unitialized HFSP */
> #define TPACPI_FAN_2FAN 0x0002 /* EC 0x31 bit 0 selects fan2 */
>
> -#define TPACPI_FAN_QI(__id1, __id2, __quirks) \
> - { .vendor = PCI_VENDOR_ID_IBM, \
> - .bios = TPACPI_MATCH_ANY, \
> - .ec = TPID(__id1, __id2), \
> - .quirks = __quirks }
> -
> -#define TPACPI_FAN_QL(__id1, __id2, __quirks) \
> - { .vendor = PCI_VENDOR_ID_LENOVO, \
> - .bios = TPACPI_MATCH_ANY, \
> - .ec = TPID(__id1, __id2), \
> - .quirks = __quirks }
> -
> -#define TPACPI_FAN_QB(__id1, __id2, __quirks) \
> - { .vendor = PCI_VENDOR_ID_LENOVO, \
> - .bios = TPID(__id1, __id2), \
> - .ec = TPACPI_MATCH_ANY, \
> - .quirks = __quirks }
> -
> static const struct tpacpi_quirk fan_quirk_table[] __initconst = {
> - TPACPI_FAN_QI('1', 'Y', TPACPI_FAN_Q1),
> - TPACPI_FAN_QI('7', '8', TPACPI_FAN_Q1),
> - TPACPI_FAN_QI('7', '6', TPACPI_FAN_Q1),
> - TPACPI_FAN_QI('7', '0', TPACPI_FAN_Q1),
> - TPACPI_FAN_QL('7', 'M', TPACPI_FAN_2FAN),
> - TPACPI_FAN_QB('N', '1', TPACPI_FAN_2FAN),
> + TPACPI_QEC_IBM('1', 'Y', TPACPI_FAN_Q1),
> + TPACPI_QEC_IBM('7', '8', TPACPI_FAN_Q1),
> + TPACPI_QEC_IBM('7', '6', TPACPI_FAN_Q1),
> + TPACPI_QEC_IBM('7', '0', TPACPI_FAN_Q1),
> + TPACPI_QEC_LNV('7', 'M', TPACPI_FAN_2FAN),
> + TPACPI_Q_LNV('N', '1', TPACPI_FAN_2FAN),
> };
>
> -#undef TPACPI_FAN_QL
> -#undef TPACPI_FAN_QI
> -#undef TPACPI_FAN_QB
> -
> static int __init fan_init(struct ibm_init_struct *iibm)
> {
> int rc;
> --
> 2.19.1
>
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] platform/x86: thinkpad_acpi: Cleanup quirks macros
[not found] ` <CAHp75VeC+4j56XbiFK=N=9_RcXz9XNdCjaBB5udkMt0np_wXsQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2018-12-04 11:20 ` Henrique de Moraes Holschuh
[not found] ` <20181204112009.dnyvdltr72ss5x5x-ZGHd14iZgfaRjzvQDGKj+xxZW9W5cXbT@public.gmane.org>
0 siblings, 1 reply; 4+ messages in thread
From: Henrique de Moraes Holschuh @ 2018-12-04 11:20 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Jouke Witteveen, Henrique de Moraes Holschuh, Platform Driver,
ibm-acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Darren Hart,
Andy Shevchenko
On Mon, 03 Dec 2018, Andy Shevchenko wrote:
> On Fri, Nov 16, 2018 at 3:18 PM Jouke Witteveen <j.witteveen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> Please, submit a new version with changelog.
>
> Though, before doing this, I would hear if Henrique is OK with the
> change (for me it looks good)
Acked-by: Henrique de Moraes Holschuh <hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>
there you have it :-)
--
Henrique Holschuh
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] platform/x86: thinkpad_acpi: Cleanup quirks macros
[not found] ` <20181204112009.dnyvdltr72ss5x5x-ZGHd14iZgfaRjzvQDGKj+xxZW9W5cXbT@public.gmane.org>
@ 2018-12-04 12:36 ` Andy Shevchenko
0 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2018-12-04 12:36 UTC (permalink / raw)
To: Henrique de Moraes Holschuh
Cc: Jouke Witteveen, Henrique de Moraes Holschuh, Platform Driver,
ibm-acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f, Darren Hart,
Andy Shevchenko
On Tue, Dec 4, 2018 at 1:20 PM Henrique de Moraes Holschuh
<hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org> wrote:
>
> On Mon, 03 Dec 2018, Andy Shevchenko wrote:
> > On Fri, Nov 16, 2018 at 3:18 PM Jouke Witteveen <j.witteveen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> >
> > Please, submit a new version with changelog.
> >
> > Though, before doing this, I would hear if Henrique is OK with the
> > change (for me it looks good)
>
> Acked-by: Henrique de Moraes Holschuh <hmh-N3TV7GIv+o9fyO9Q7EP/yw@public.gmane.org>
Thank you!
Jouke, so, I would wait for v2 with changelog and don't forget to
append Henrique's tag as well.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-12-04 12:36 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-16 13:18 [PATCH] platform/x86: thinkpad_acpi: Cleanup quirks macros Jouke Witteveen
[not found] ` <20181116131800.GA11114-7Pk1HLXsvWqf6HGZUO+WniZi+YwRKgec@public.gmane.org>
2018-12-03 17:31 ` Andy Shevchenko
[not found] ` <CAHp75VeC+4j56XbiFK=N=9_RcXz9XNdCjaBB5udkMt0np_wXsQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-12-04 11:20 ` Henrique de Moraes Holschuh
[not found] ` <20181204112009.dnyvdltr72ss5x5x-ZGHd14iZgfaRjzvQDGKj+xxZW9W5cXbT@public.gmane.org>
2018-12-04 12:36 ` Andy Shevchenko
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.