public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] x86, pci: sta2x11-fixup clock related patches
@ 2012-09-20 16:44 ciminaghi
  2012-09-20 16:44 ` [PATCH 1/2] x86, pci sta2x11-fixup: add clk related field to struct sta2x11_instance ciminaghi
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: ciminaghi @ 2012-09-20 16:44 UTC (permalink / raw)
  To: tglx, mingo, hpa, x86, rubini, sameo
  Cc: giancarlo.asnaghi, linux-kernel, Davide Ciminaghi

From: Davide Ciminaghi <ciminaghi@gnudd.com>

Hi,

the following two patches are needed for the sta2x11 common clock
framework (to be submitted shortly) to deal with the possibility
of multiple instances of the connext chip on the same machine.

Davide Ciminaghi (2):
  x86, pci sta2x11-fixup: add clk related field to struct
    sta2x11_instance
  x86, pci sta2x11-fixup: add function to access sta2x11 instance id.

 arch/x86/include/asm/sta2x11.h |   16 ++++++++++++++++
 arch/x86/pci/sta2x11-fixup.c   |   20 ++++++++++++++++++++
 2 files changed, 36 insertions(+), 0 deletions(-)

-- 
1.7.9.1


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

* [PATCH 1/2] x86, pci sta2x11-fixup: add clk related field to struct sta2x11_instance
  2012-09-20 16:44 [PATCH 0/2] x86, pci: sta2x11-fixup clock related patches ciminaghi
@ 2012-09-20 16:44 ` ciminaghi
  2012-09-20 16:44 ` [PATCH 2/2] x86, pci sta2x11-fixup: add function to access sta2x11 instance id ciminaghi
  2012-09-20 19:10 ` [PATCH 0/2] x86, pci: sta2x11-fixup clock related patches Alessandro Rubini
  2 siblings, 0 replies; 5+ messages in thread
From: ciminaghi @ 2012-09-20 16:44 UTC (permalink / raw)
  To: tglx, mingo, hpa, x86, rubini, sameo
  Cc: giancarlo.asnaghi, linux-kernel, Davide Ciminaghi

From: Davide Ciminaghi <ciminaghi@gnudd.com>

Use struct sta2x11_instance for storing a pointer to an array
of struct clk pointers representing the set of clocks belonging
to a single connext chip.
Since sta2x11_instance is an opaque type, we also add functions to
access the new field.

Signed-off-by: Davide Ciminaghi <ciminaghi@gnudd.com>
---
 arch/x86/include/asm/sta2x11.h |   16 ++++++++++++++++
 arch/x86/pci/sta2x11-fixup.c   |   14 ++++++++++++++
 2 files changed, 30 insertions(+), 0 deletions(-)

diff --git a/arch/x86/include/asm/sta2x11.h b/arch/x86/include/asm/sta2x11.h
index e9d32df..2b5d8bc 100644
--- a/arch/x86/include/asm/sta2x11.h
+++ b/arch/x86/include/asm/sta2x11.h
@@ -5,8 +5,24 @@
 #define __ASM_STA2X11_H
 
 #include <linux/pci.h>
+#include <linux/clk.h>
 
 /* This needs to be called from the MFD to configure its sub-devices */
 struct sta2x11_instance *sta2x11_get_instance(struct pci_dev *pdev);
 
+/*
+ * Return instance id
+ */
+int sta2x11_get_instance_id(struct sta2x11_instance *instance);
+
+/*
+ * Add clks array to instance. This is called by clock common API
+ */
+void sta2x11_instance_add_clks(struct sta2x11_instance *, struct clk **);
+
+/*
+ * Returns clks array of instance. This is called by clock common API
+ */
+struct clk **sta2x11_instance_get_clks(struct sta2x11_instance *);
+
 #endif /* __ASM_STA2X11_H */
diff --git a/arch/x86/pci/sta2x11-fixup.c b/arch/x86/pci/sta2x11-fixup.c
index 9d8a509..478c228 100644
--- a/arch/x86/pci/sta2x11-fixup.c
+++ b/arch/x86/pci/sta2x11-fixup.c
@@ -27,6 +27,8 @@
 #include <linux/export.h>
 #include <linux/list.h>
 
+#include <asm/sta2x11.h>
+
 #define STA2X11_SWIOTLB_SIZE (4*1024*1024)
 extern int swiotlb_late_init_with_default_size(size_t default_size);
 
@@ -52,6 +54,7 @@ struct sta2x11_instance {
 	struct list_head list;
 	int bus0;
 	struct sta2x11_mapping map[STA2X11_NR_EP];
+	struct clk **clks;
 };
 
 static LIST_HEAD(sta2x11_instance_list);
@@ -78,6 +81,17 @@ static void sta2x11_new_instance(struct pci_dev *pdev)
 }
 DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_STMICRO, 0xcc17, sta2x11_new_instance);
 
+void sta2x11_instance_add_clks(struct sta2x11_instance *instance,
+			       struct clk **clks)
+{
+	instance->clks = clks;
+}
+
+struct clk **sta2x11_instance_get_clks(struct sta2x11_instance *instance)
+{
+	return instance->clks;
+}
+
 /*
  * Utility functions used in this file from below
  */
-- 
1.7.9.1


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

* [PATCH 2/2] x86, pci sta2x11-fixup: add function to access sta2x11 instance id.
  2012-09-20 16:44 [PATCH 0/2] x86, pci: sta2x11-fixup clock related patches ciminaghi
  2012-09-20 16:44 ` [PATCH 1/2] x86, pci sta2x11-fixup: add clk related field to struct sta2x11_instance ciminaghi
@ 2012-09-20 16:44 ` ciminaghi
  2012-09-20 19:10 ` [PATCH 0/2] x86, pci: sta2x11-fixup clock related patches Alessandro Rubini
  2 siblings, 0 replies; 5+ messages in thread
From: ciminaghi @ 2012-09-20 16:44 UTC (permalink / raw)
  To: tglx, mingo, hpa, x86, rubini, sameo
  Cc: giancarlo.asnaghi, linux-kernel, Davide Ciminaghi

From: Davide Ciminaghi <ciminaghi@gnudd.com>

The sta2x11 instance id will be included in clock names to make them
unique in case of multiple sta2x11's living on the same machine.

Signed-off-by: Davide Ciminaghi <ciminaghi@gnudd.com>
---
 arch/x86/pci/sta2x11-fixup.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/x86/pci/sta2x11-fixup.c b/arch/x86/pci/sta2x11-fixup.c
index 478c228..6450853 100644
--- a/arch/x86/pci/sta2x11-fixup.c
+++ b/arch/x86/pci/sta2x11-fixup.c
@@ -138,6 +138,12 @@ struct sta2x11_instance *sta2x11_get_instance(struct pci_dev *pdev)
 }
 EXPORT_SYMBOL(sta2x11_get_instance);
 
+int sta2x11_get_instance_id(struct sta2x11_instance *instance)
+{
+	return instance->bus0;
+}
+EXPORT_SYMBOL(sta2x11_get_instance_id);
+
 
 /**
  * p2a - Translate physical address to STA2x11 AMBA address,
-- 
1.7.9.1


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

* Re: [PATCH 0/2] x86, pci: sta2x11-fixup clock related patches
  2012-09-20 16:44 [PATCH 0/2] x86, pci: sta2x11-fixup clock related patches ciminaghi
  2012-09-20 16:44 ` [PATCH 1/2] x86, pci sta2x11-fixup: add clk related field to struct sta2x11_instance ciminaghi
  2012-09-20 16:44 ` [PATCH 2/2] x86, pci sta2x11-fixup: add function to access sta2x11 instance id ciminaghi
@ 2012-09-20 19:10 ` Alessandro Rubini
  2012-09-21 20:21   ` Davide Ciminaghi
  2 siblings, 1 reply; 5+ messages in thread
From: Alessandro Rubini @ 2012-09-20 19:10 UTC (permalink / raw)
  To: ciminaghi
  Cc: tglx, mingo, hpa, x86, sameo, giancarlo.asnaghi, linux-kernel,
	ciminaghi

> the following two patches are needed for the sta2x11 common clock
> framework (to be submitted shortly) to deal with the possibility
> of multiple instances of the connext chip on the same machine.

Thanks you very much for your clock work, Davide.

For both: Acked-by: Alessandro Rubini <rubini@gnudd.com>

/alessandro

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

* Re: [PATCH 0/2] x86, pci: sta2x11-fixup clock related patches
  2012-09-20 19:10 ` [PATCH 0/2] x86, pci: sta2x11-fixup clock related patches Alessandro Rubini
@ 2012-09-21 20:21   ` Davide Ciminaghi
  0 siblings, 0 replies; 5+ messages in thread
From: Davide Ciminaghi @ 2012-09-21 20:21 UTC (permalink / raw)
  To: Alessandro Rubini
  Cc: tglx, mingo, hpa, x86, sameo, giancarlo.asnaghi, linux-kernel

On Thu, Sep 20, 2012 at 09:10:02PM +0200, Alessandro Rubini wrote:
> > the following two patches are needed for the sta2x11 common clock
> > framework (to be submitted shortly) to deal with the possibility
> > of multiple instances of the connext chip on the same machine.
> 
> Thanks you very much for your clock work, Davide.
>
oh actually I'm having a lot of fun with clocks (devicetree is also quite
interesting), so it's a pleasure to contribute my work.
Thanks for your acks :-)

Davide

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

end of thread, other threads:[~2012-09-21 20:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-20 16:44 [PATCH 0/2] x86, pci: sta2x11-fixup clock related patches ciminaghi
2012-09-20 16:44 ` [PATCH 1/2] x86, pci sta2x11-fixup: add clk related field to struct sta2x11_instance ciminaghi
2012-09-20 16:44 ` [PATCH 2/2] x86, pci sta2x11-fixup: add function to access sta2x11 instance id ciminaghi
2012-09-20 19:10 ` [PATCH 0/2] x86, pci: sta2x11-fixup clock related patches Alessandro Rubini
2012-09-21 20:21   ` Davide Ciminaghi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox