linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] mips: loongson64: move EC header to include/asm/mach-loongson64
@ 2019-02-10 13:06 Yifeng Li
  2019-02-10 13:06 ` [PATCH 1/1] " Yifeng Li
  2019-02-10 13:25 ` [PATCH 0/1] " Aaro Koskinen
  0 siblings, 2 replies; 4+ messages in thread
From: Yifeng Li @ 2019-02-10 13:06 UTC (permalink / raw)
  To: linux-mips
  Cc: Jiaxun Yang, Huacai Chen, Ralf Baechle, Paul Burton, James Hogan,
	Yifeng Li, linux-kernel

In order to operate the Embedded Controller from multiple platform
drivers, it should be possible to include lemote-2f/ec_kb3310b.h
from everywhere. This commits move it from lemote-2f/ec_kb3310b.h
to include/asm/mach-loongson64/.

This simple patch immediately enables the implementation of two
platform drivers. if there's no objection from the maintainers,
please consider to prioritize it for mips-next, thanks.

Yifeng Li (1):
  mips: loongson64: move EC header to include/asm/mach-loongson64

 .../lemote-2f => include/asm/mach-loongson64}/ec_kb3310b.h      | 0
 arch/mips/loongson64/lemote-2f/ec_kb3310b.c                     | 2 +-
 arch/mips/loongson64/lemote-2f/reset.c                          | 2 +-
 3 files changed, 2 insertions(+), 2 deletions(-)
 rename arch/mips/{loongson64/lemote-2f => include/asm/mach-loongson64}/ec_kb3310b.h (100%)

-- 
2.20.1


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

* [PATCH 1/1] mips: loongson64: move EC header to include/asm/mach-loongson64
  2019-02-10 13:06 [PATCH 0/1] mips: loongson64: move EC header to include/asm/mach-loongson64 Yifeng Li
@ 2019-02-10 13:06 ` Yifeng Li
  2019-02-10 13:25 ` [PATCH 0/1] " Aaro Koskinen
  1 sibling, 0 replies; 4+ messages in thread
From: Yifeng Li @ 2019-02-10 13:06 UTC (permalink / raw)
  To: linux-mips
  Cc: Jiaxun Yang, Huacai Chen, Ralf Baechle, Paul Burton, James Hogan,
	Yifeng Li, linux-kernel

In order to operate the Embedded Controller from multiple platform
drivers, it should be possible to include lemote-2f/ec_kb3310b.h
from everywhere. This commits move it from lemote-2f/ec_kb3310b.h
to include/asm/mach-loongson64/.

Signed-off-by: Yifeng Li <tomli@tomli.me>
---
 .../lemote-2f => include/asm/mach-loongson64}/ec_kb3310b.h      | 0
 arch/mips/loongson64/lemote-2f/ec_kb3310b.c                     | 2 +-
 arch/mips/loongson64/lemote-2f/reset.c                          | 2 +-
 3 files changed, 2 insertions(+), 2 deletions(-)
 rename arch/mips/{loongson64/lemote-2f => include/asm/mach-loongson64}/ec_kb3310b.h (100%)

diff --git a/arch/mips/loongson64/lemote-2f/ec_kb3310b.h b/arch/mips/include/asm/mach-loongson64/ec_kb3310b.h
similarity index 100%
rename from arch/mips/loongson64/lemote-2f/ec_kb3310b.h
rename to arch/mips/include/asm/mach-loongson64/ec_kb3310b.h
diff --git a/arch/mips/loongson64/lemote-2f/ec_kb3310b.c b/arch/mips/loongson64/lemote-2f/ec_kb3310b.c
index 321822997e76..6e416d55b42a 100644
--- a/arch/mips/loongson64/lemote-2f/ec_kb3310b.c
+++ b/arch/mips/loongson64/lemote-2f/ec_kb3310b.c
@@ -15,7 +15,7 @@
 #include <linux/spinlock.h>
 #include <linux/delay.h>
 
-#include "ec_kb3310b.h"
+#include <ec_kb3310b.h>
 
 static DEFINE_SPINLOCK(index_access_lock);
 static DEFINE_SPINLOCK(port_access_lock);
diff --git a/arch/mips/loongson64/lemote-2f/reset.c b/arch/mips/loongson64/lemote-2f/reset.c
index a26ca7fcd7e0..6c615c7b08d0 100644
--- a/arch/mips/loongson64/lemote-2f/reset.c
+++ b/arch/mips/loongson64/lemote-2f/reset.c
@@ -20,7 +20,7 @@
 #include <loongson.h>
 
 #include <cs5536/cs5536.h>
-#include "ec_kb3310b.h"
+#include <ec_kb3310b.h>
 
 static void reset_cpu(void)
 {
-- 
2.20.1


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

* Re: [PATCH 0/1] mips: loongson64: move EC header to include/asm/mach-loongson64
  2019-02-10 13:06 [PATCH 0/1] mips: loongson64: move EC header to include/asm/mach-loongson64 Yifeng Li
  2019-02-10 13:06 ` [PATCH 1/1] " Yifeng Li
@ 2019-02-10 13:25 ` Aaro Koskinen
  2019-02-14  8:27   ` Tom Li
  1 sibling, 1 reply; 4+ messages in thread
From: Aaro Koskinen @ 2019-02-10 13:25 UTC (permalink / raw)
  To: Yifeng Li
  Cc: linux-mips, Jiaxun Yang, Huacai Chen, Ralf Baechle, Paul Burton,
	James Hogan, linux-kernel

Hi,

On Sun, Feb 10, 2019 at 09:06:16PM +0800, Yifeng Li wrote:
> In order to operate the Embedded Controller from multiple platform
> drivers, it should be possible to include lemote-2f/ec_kb3310b.h
> from everywhere. This commits move it from lemote-2f/ec_kb3310b.h
> to include/asm/mach-loongson64/.
> 
> This simple patch immediately enables the implementation of two
> platform drivers. if there's no objection from the maintainers,
> please consider to prioritize it for mips-next, thanks.
> 
> Yifeng Li (1):
>   mips: loongson64: move EC header to include/asm/mach-loongson64

This probably should be MFD driver under drivers/mfd. It's a longer
road, though...

A.

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

* Re: [PATCH 0/1] mips: loongson64: move EC header to include/asm/mach-loongson64
  2019-02-10 13:25 ` [PATCH 0/1] " Aaro Koskinen
@ 2019-02-14  8:27   ` Tom Li
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Li @ 2019-02-14  8:27 UTC (permalink / raw)
  To: Aaro Koskinen
  Cc: linux-mips, Jiaxun Yang, Huacai Chen, Ralf Baechle, Paul Burton,
	James Hogan, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1082 bytes --]

> Hi,
> > Yifeng Li (1):
> >   mips: loongson64: move EC header to include/asm/mach-loongson64
> 
> This probably should be MFD driver under drivers/mfd. It's a longer
> road, though...
> 
> A.

The problem of converting it to a MFD driver, is that there's still
something doesn't fit together.

The core CPU idle code in loongson64/common calls the platform code
in arch/mips/loongson64/lemote-2f to set up an interrupt handler in
i8259, and inspect if the source of interrupt is an lid open event by
querying the ENE KB3310B controller. But normally an MFD driver is
only used to share the underlying hardware between multiple drivers
in each subsystem, not to provide shared utilily functions.

But after reading drivers/mfd for a while, apparently we do have drivers
that "EXPORT_SYMBOL()" to other parts of the kernel. So I think it's
a matter of fact that can be discussed with MFD maintainers.

So yes, I'm converting all the EC code to a MFD driver. I have withdrawn
this patch, do not merge it. The new MFD patch is coming soon.

Thanks,
Tom Li

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2019-02-14  8:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-10 13:06 [PATCH 0/1] mips: loongson64: move EC header to include/asm/mach-loongson64 Yifeng Li
2019-02-10 13:06 ` [PATCH 1/1] " Yifeng Li
2019-02-10 13:25 ` [PATCH 0/1] " Aaro Koskinen
2019-02-14  8:27   ` Tom Li

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).