Quantcast
Channel: Serverphorums.com
Viewing all 23908 articles
Browse latest View live

linux-next: manual merge of the rtc tree with the mfd tree

$
0
0
Hi Alexandre,

Today's linux-next merge of the rtc tree got a conflict in:

drivers/rtc/Makefile

between commit:

b5b2bdfc2893 ("rtc: st: Add new driver for ST's LPC RTC")

from the mfd tree and commit:

766218609678 ("rtc: Properly sort Makefile")

from the rtc tree.

I fixed it up (see below) and can carry the fix as necessary (no action
is required).

--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au

diff --cc drivers/rtc/Makefile
index ebe2c085d01c,5ea5370f56f2..000000000000
--- a/drivers/rtc/Makefile
+++ b/drivers/rtc/Makefile
@@@ -135,6 -139,6 +139,7 @@@ obj-$(CONFIG_RTC_DRV_SPEAR) += rtc-spea
obj-$(CONFIG_RTC_DRV_STARFIRE) += rtc-starfire.o
obj-$(CONFIG_RTC_DRV_STK17TA8) += rtc-stk17ta8.o
obj-$(CONFIG_RTC_DRV_STMP) += rtc-stmp3xxx.o
++obj-$(CONFIG_RTC_DRV_ST_LPC) += rtc-st-lpc.o
obj-$(CONFIG_RTC_DRV_SUN4V) += rtc-sun4v.o
obj-$(CONFIG_RTC_DRV_SUN6I) += rtc-sun6i.o
obj-$(CONFIG_RTC_DRV_SUNXI) += rtc-sunxi.o

linux-next: manual merge of the nvdimm tree with Linus' tree

$
0
0
Hi Dan,

Today's linux-next merge of the nvdimm tree got a conflict in:

drivers/block/Kconfig

between commit:

b6f2098fb708 ("block: pmem: Add dependency on HAS_IOMEM")

from Linus' tree and commit:

1ffe3c5dc311 ("libnvdimm, pmem: move pmem to drivers/nvdimm/")

from the nvdimm tree.

I fixed it up (the latter incorporated the change from the former)
and can carry the fix as necessary (no action is required).

--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au

Re: [PATCH v7 00/16] libnvdimm: non-volatile memory devices

$
0
0
Hi Dan,

On Wed, 17 Jun 2015 19:13:19 -0400 Dan Williams <dan.j.williams@intel.com> wrote:
>
> A new sub-system in support of non-volatile memory storage devices.
>
> Stephen, please add libnvdimm-for-next to -next:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/djbw/nvdimm libnvdimm-for-next

Thanks for adding your subsystem tree as a participant of linux-next. As
you may know, this is not a judgment of your code. The purpose of
linux-next is for integration testing and to lower the impact of
conflicts between subsystems in the next merge window.

You will need to ensure that the patches/commits in your tree/series have
been:
* submitted under GPL v2 (or later) and include the Contributor's
Signed-off-by,
* posted to the relevant mailing list,
* reviewed by you (or another maintainer of your subsystem tree),
* successfully unit tested, and
* destined for the current or next Linux merge window.

Basically, this should be just what you would send to Linus (or ask him
to fetch). It is allowed to be rebased if you deem it necessary.

--
Cheers,
Stephen Rothwell
sfr@canb.auug.org.au

Re: [PATCH 0/6] Staging: comedi: Simplify a trivial if-return sequence

$
0
0
On 19/06/15 06:59, Abdul, Hussain (H.) wrote:
>
>
> This patch simplify a trivial if-return sequence. Possibly combine with
> a preceding function call.
>
> Abdul Hussain (6):
> staging: comedi: dmm32at: Simplify a trivial if-return sequence
> staging: comedi: fl512: Simplify a trivial if-return sequence
> staging: comedi: daqboard2000: Simplify a trivial if-return sequence
> staging: comedi: dac02: Simplify a trivial if-return sequence
> staging: comedi: daq_dio24: Simplify a trivial if-return sequence
> staging: comedi: s626: Simplify a trivial if-return sequence
>
>
> drivers/staging/comedi/drivers/dac02.c | 6 +-----
> drivers/staging/comedi/drivers/daqboard2000.c | 7 +------
> drivers/staging/comedi/drivers/dmm32at.c | 6 +-----
> drivers/staging/comedi/drivers/fl512.c | 6 +-----
> drivers/staging/comedi/drivers/ni_daq_dio24.c | 6 +-----
> drivers/staging/comedi/drivers/s626.c | 6 +-----


Looks good apart from the checkpatch warning in patch 3 as pointed out
by Sudip.

For patches 1-2 and 4-6:
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>

--
-=( Ian Abbott @ MEV Ltd. E-mail: <abbotti@mev.co.uk> )=-
-=( Web: http://www.mev.co.uk/ )=-
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH] staging: comedi: fix sparse warning in ni_mio_common.c

$
0
0
On 20/06/15 17:47, Geliang Tang wrote:
> This patch fixes the following sparse warning:
>
> drivers/staging/comedi/drivers/ni_mio_common.c:573:26: warning: shift
> too big (4294967295) for type int
>
> Signed-off-by: Geliang Tang <geliangtang@163.com>
> ---
> drivers/staging/comedi/drivers/ni_mio_common.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c
> index 6cc304a..420f752 100644
> --- a/drivers/staging/comedi/drivers/ni_mio_common.c
> +++ b/drivers/staging/comedi/drivers/ni_mio_common.c
> @@ -570,7 +570,7 @@ static inline void ni_set_bitfield(struct comedi_device *dev, int reg,
> static inline unsigned ni_stc_dma_channel_select_bitfield(unsigned channel)
> {
> if (channel < 4)
> - return 1 << channel;
> + return 1 << (channel & 0x03);
> if (channel == 4)
> return 0x3;
> if (channel == 5)
>

Surely that's a false positive sparse warning?

--
-=( Ian Abbott @ MEV Ltd. E-mail: <abbotti@mev.co.uk> )=-
-=( Web: http://www.mev.co.uk/ )=-
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/

[PATCH] staging:rtl8723au:odm.c:Removing trailing whitespaces

$
0
0
From: Joglekar Tejas <tjogleka@visteon.com>

This patch removes the trailing whitespace error given
by checkpatch.pl

Signed-off-by: Joglekar Tejas <tjogleka@visteon.com>
---
drivers/staging/rtl8723au/hal/odm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723au/hal/odm.c b/drivers/staging/rtl8723au/hal/odm.c
index f354f5e..6b9dbef 100644
--- a/drivers/staging/rtl8723au/hal/odm.c
+++ b/drivers/staging/rtl8723au/hal/odm.c
@@ -985,7 +985,7 @@ void ODM_RF_Saving23a(struct dm_odm_t *pDM_Odm, u8 bForceInNormal)
val32 = rtl8723au_read32(adapter, 0x874);
val32 |= pDM_PSTable->Reg874;
rtl8723au_write32(adapter, 0x874, val32);
-
+
val32 = rtl8723au_read32(adapter, 0xc70);
val32 |= pDM_PSTable->RegC70;
rtl8723au_write32(adapter, 0xc70, val32);
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/

Re: [PHP] When to instantiate a new class

$
0
0
What Larry said, basically.

You create a new instance of a class when you need a new instance of a
class. In your particular example, "databaseInterface" would presumably
wrap a database connection (which in turn has information about the current
transaction/savepoints, DB variables...), maybe some information about the
schema, maybe a cache of some kind or an identity map, etc. You would just
instantiate that once near the start of the request and hold onto it until
you don't need it anymore/until the end, to let it be garbage collected.
Even if you're not using transactions or any fancy stuff and your
databaseInterface class is effectively stateless, you should keep the door
open to implement fancy stuff later by holding onto the same instance
throughout the request. Not to mention, you don't want to incur the
overhead of connecting to the database in every method.

That leaves having a class property vs passing it into each method. It
depends on the purpose of the "screen" class. If the purpose of the class
is such that it is *always *going to need a "databaseInterface" (I guess it
is), then instantiate it in the constructor (or take one as a constructor
parameter) and set it as a property. Otherwise, pass it through the methods
that need it as a parameter.

You don't *have *to access the property through a getter. You can if you
want. It doesn't buy you much besides maybe making it a bit easier to
re-implment by delegating to a "databaseInterface" from somewhere else.

Also, Google "singleton bad" on why you generally shouldn't use global
state (singletons), and should instead pass dependencies explicitly using
properties/parameters.

Also also, I've never quite figured out why "dependency injection
containers" exist. Dependency injection just means you pass through to a
class/method the things it needs, rather than letting it instantiate them
itself, so the caller can decide how those dependencies are implemented. If
lots of things need the same set of dependencies, then just wrap them all
up in another class that has properties or getters for each. It's not hard.

Cheers


On Sat, Jun 20, 2015 at 8:15 AM, Larry Garfield <larry@garfieldtech.com>
wrote:

> On 6/17/15 3:56 PM, Ramiro Barrantes wrote:
>
>> Hello,
>>
>> This is a very basic question, i just don't know php well enough to know
>> what's best. I have a screen class and a database class. The screen class
>> handles everything related to what goes on the screen, but its many
>> functions often need to use the database class to get relevant
>> information. The question I have is:
>>
>> How often should I instantiate the database class? Should I do it once
>> with say, the constructor of the screen class? Or with the specific method,
>> or pass it as a variable?
>>
>> For example:
>>
>> INSTANTIATING WITHIN EACH FUNCTION
>> function method($variable) {
>> $db = new databaseInterface():
>> ...
>> }
>>
>> or
>>
>> PASSING IT AS A VARIABLE FOR EACH FUNCTION
>> function method($variable,$db) {
>> ...
>> }
>>
>> or
>>
>> CREATING IT AS PART OF THE SCREEN CONSTRUCTOR AND ACCESSING IT WITH A
>> "getter"
>> class screen {
>> private $db;
>> function construct() {
>> $db=new databaseInterface();
>> }
>>
>> function getDatabaseInstance() {
>> return($db);
>> }
>> }
>>
>> Thanks in advance,
>> Ramiro
>>
>
> 1) The classes you're talking about (the DB connection and the output
> channel) are called "Services". That is, they're classes that do not
> contain data per se, only logic. Services should, generally, only have a
> single instance in your entire application. You may have different
> instances of the same class with different constructor parameters if they
> are for different purposes; eg, two different DB connections for two
> different databases. But those are separate services at that point.
>
> 2) Enforcing that there's only a single instance of each service is *not
> the service's job*. That is, *do not make them singletons*. Ever. Singleton
> is an anti-pattern that makes testing harder and your code less flexible.
>
> 3) The way to wire the objects together is called Dependency Injection,
> which is really just the fancy-pants way of saying "pass in what you need".
> In your example:
>
> class Connection {
> // ...
> }
>
> class Screen {
> protected $conn;
>
> public function __construct(Connection $conn) {
> $this->conn = $conn;
> }
>
> public function doStuff() {
> $result = $this->conn->query(...);
> // ...
> }
> }
>
> $conn = new Connection(...);
>
> $screen = new Screen($conn);
>
>
> 4) Your output channel should, in fact, NOT be talking directly to the
> database in most cases. There should be an intermediary that coordinates
> that. If it's per-URL, then it's generally called a Controller and should
> be very very simple. For example:
>
> class Controller {
>
> protected $conn;
> protected $screen;
>
> public function __construct(Connection $conn, Screen $screen) {
> $this->conn = $conn;
> $this->screen = $screen;
> }
>
> // Something routes the request to this method; exactly how is
> // out of scope at the moment.
> public function showUser($userId) {
> $result = This->conn->query("SELECT name FROM users WHERE id=:id", [':id'
> => $user_id];
> $name = $result->fetchOne();
>
> $screen->showName($name);
> }
>
> Note that taking a dependency injection approach (which you should) does
> lead quickly to a lot of "wiring" code on your part to inject everything.
> The answer to that is the scarily-named "dependency injection container".
> There are many that already exist for PHP. The simplest/easiest to get
> started with is Pimple:
>
> http://pimple.sensiolabs.org/
>
>
>
> --Larry Garfield
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

linux-next: build warnings after merge of the net-next tree

$
0
0
Hi all,

After merging the net-next tree, today's linux-next build (i386 defconfig)
produced these warnings:

In file included from include/net/netfilter/nf_conntrack_tuple.h:13:0,
from include/linux/netfilter/nf_conntrack_dccp.h:28,
from include/net/netfilter/nf_conntrack.h:22,
from net/netfilter/nf_conntrack_core.c:37:
include/linux/netfilter/x_tables.h: In function 'xt_percpu_counter_alloc':
include/linux/netfilter/x_tables.h:373:10: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
return (__force u64) res;
^
include/linux/netfilter/x_tables.h: In function 'xt_percpu_counter_free':
include/linux/netfilter/x_tables.h:381:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
free_percpu((void __percpu *) pcnt);
^
In file included from include/asm-generic/percpu.h:6:0,
from arch/x86/include/asm/percpu.h:551,
from arch/x86/include/asm/preempt.h:5,
from include/linux/preempt.h:64,
from include/linux/spinlock.h:50,
from include/linux/mm_types.h:8,
from include/linux/kmemcheck.h:4,
from include/linux/skbuff.h:18,
from include/linux/netfilter.h:5,
from net/netfilter/nf_conntrack_core.c:16:
include/linux/netfilter/x_tables.h: In function 'xt_get_this_cpu_counter':
include/linux/netfilter/x_tables.h:388:23: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
return this_cpu_ptr((void __percpu *) cnt->pcnt);
^
include/linux/percpu-defs.h:206:47: note: in definition of macro '__verify_pcpu_ptr'
const void __percpu *__vpp_verify = (typeof((ptr) + 0))NULL; \
^
include/linux/percpu-defs.h:239:27: note: in expansion of macro 'raw_cpu_ptr'
#define this_cpu_ptr(ptr) raw_cpu_ptr(ptr)
^
include/linux/netfilter/x_tables.h:388:10: note: in expansion of macro 'this_cpu_ptr'
return this_cpu_ptr((void __percpu *) cnt->pcnt);
^

and many more.

Introduced by commit:

71ae0dff02d7 ("netfilter: xtables: use percpu rule counters")

--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au

Re: [PATCH 3/4] media: pxa_camera: trivial move of dma irq functions

$
0
0
On Sun, 22 Mar 2015, Robert Jarzmik wrote:

> From: Robert Jarzmik <robert.jarzmik@intel.com>
>
> This moves the dma irq handling functions up in the source file, so that
> they are available before DMA preparation functions. It prepares the
> conversion to DMA engine, where the descriptors are populated with these
> functions as callbacks.
>
> Signed-off-by: Robert Jarzmik <robert.jarzmik@intel.com>
> ---
> drivers/media/platform/soc_camera/pxa_camera.c | 40 ++++++++++++++------------
> 1 file changed, 22 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/media/platform/soc_camera/pxa_camera.c b/drivers/media/platform/soc_camera/pxa_camera.c
> index c0c0f0f..8b39f44 100644
> --- a/drivers/media/platform/soc_camera/pxa_camera.c
> +++ b/drivers/media/platform/soc_camera/pxa_camera.c
> @@ -311,6 +311,28 @@ static int calculate_dma_sglen(struct scatterlist *sglist, int sglen,
>
> BUG_ON(size != 0);
> return i + 1;
> +static void pxa_camera_dma_irq(struct pxa_camera_dev *pcdev,
> + enum pxa_camera_active_dma act_dma);
> +
> +static void pxa_camera_dma_irq_y(void *data)

Wait, how is this patch trivial? You change pxa_camera_dma_irq_?()
prototypes, which are used as PXA DMA callbacks. Does this mean, that
either before or after this patch compilation is broken?

Thanks
Guennadi

> +{
> + struct pxa_camera_dev *pcdev = data;
> +
> + pxa_camera_dma_irq(pcdev, DMA_Y);
> +}
> +
> +static void pxa_camera_dma_irq_u(void *data)
> +{
> + struct pxa_camera_dev *pcdev = data;
> +
> + pxa_camera_dma_irq(pcdev, DMA_U);
> +}
> +
> +static void pxa_camera_dma_irq_v(void *data)
> +{
> + struct pxa_camera_dev *pcdev = data;
> +
> + pxa_camera_dma_irq(pcdev, DMA_V);
> }
>
> /**
> @@ -810,24 +832,6 @@ out:
> spin_unlock_irqrestore(&pcdev->lock, flags);
> }
>
> -static void pxa_camera_dma_irq_y(int channel, void *data)
> -{
> - struct pxa_camera_dev *pcdev = data;
> - pxa_camera_dma_irq(channel, pcdev, DMA_Y);
> -}
> -
> -static void pxa_camera_dma_irq_u(int channel, void *data)
> -{
> - struct pxa_camera_dev *pcdev = data;
> - pxa_camera_dma_irq(channel, pcdev, DMA_U);
> -}
> -
> -static void pxa_camera_dma_irq_v(int channel, void *data)
> -{
> - struct pxa_camera_dev *pcdev = data;
> - pxa_camera_dma_irq(channel, pcdev, DMA_V);
> -}
> -
> static struct videobuf_queue_ops pxa_videobuf_ops = {
> .buf_setup = pxa_videobuf_setup,
> .buf_prepare = pxa_videobuf_prepare,
> --
> 2.1.4
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/

linux-next: manual merge of the akpm tree with the v4l-dvb tree

$
0
0
Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in:

drivers/media/v4l2-core/videobuf2-dma-sg.c

between commit:

511a1b8a4c81 ("[media] Revert "[media] vb2: Push mmap_sem down to memops"")

from the v4l-dvb tree and patch:

"media: vb2: convert vb2_dma_sg_get_userptr() to use frame vector"

from the akpm tree.

I fixed it up (I just used the akpm tree version) and can carry the fix
as necessary (no action is required).

--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au

Re: [PATCH v3 08/18] baycom_epp: Replace rdtscl() with native_read_tsc()

$
0
0
Acked-by: walter harms <wharms@bfs.de>

Am 17.06.2015 02:35, schrieb Andy Lutomirski:
> This is only used if BAYCOM_DEBUG is defined.
>
> Cc: walter harms <wharms@bfs.de>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: Thomas Sailer <t.sailer@alumni.ethz.ch>
> Cc: linux-hams@vger.kernel.org
> Signed-off-by: Andy Lutomirski <luto@kernel.org>
> ---
>
> I'm hoping for an ack for this to go through -tip.
>
> drivers/net/hamradio/baycom_epp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c
> index 83c7cce0d172..44e5c3b5e0af 100644
> --- a/drivers/net/hamradio/baycom_epp.c
> +++ b/drivers/net/hamradio/baycom_epp.c
> @@ -638,7 +638,7 @@ static int receive(struct net_device *dev, int cnt)
> #define GETTICK(x) \
> ({ \
> if (cpu_has_tsc) \
> - rdtscl(x); \
> + x = (unsigned int)native_read_tsc(); \
> })
> #else /* __i386__ */
> #define GETTICK(x)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/

linux-next: manual merge of the akpm tree with the v4l-dvb tree

$
0
0
Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in:

drivers/media/v4l2-core/videobuf2-vmalloc.c

between commit:

511a1b8a4c81 ("[media] Revert "[media] vb2: Push mmap_sem down to memops"")

from the v4l-dvb tree and patch:

"media: vb2: Convert vb2_vmalloc_get_userptr() to use frame vector"

from the akpm tree.

I fixed it up (I just used the akpm tree version) and can carry the fix
as necessary (no action is required).

--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au

linux-next: manual merge of the akpm tree with the v4l-dvb tree

$
0
0
Hi Andrew,

Today's linux-next merge of the akpm tree got a conflict in:

drivers/media/v4l2-core/videobuf2-dma-contig.c

between commit:

511a1b8a4c81 ("[media] Revert "[media] vb2: Push mmap_sem down to memops"")

from the v4l-dvb tree and patch:

"media: vb2: convert vb2_dc_get_userptr() to use frame vector"

from the akpm tree.

I fixed it up (I just used the akpm tree version) and can carry the fix
as necessary (no action is required).

--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au

Re: [PATCH 1/2] genirq: add chip_{suspend,resume} PM support to irq_chip

$
0
0
On Fri, 19 Jun 2015, Brian Norris wrote:
> This patch adds a second set of suspend/resume hooks to irq_chip, this
> time to represent *chip* suspend/resume, rather than IRQ suspend/resume.
> These callbacks will always be called for an irqchip and are based on
> the per-chip irq_chip_generic struct, rather than the per-IRQ irq_data
> struct.

There is no per-chip irq_chip_generic struct. It's only there if the
irq chip has been instantiated as a generic chip.

> /**
> * struct irq_chip - hardware interrupt chip descriptor
> *
> @@ -317,6 +319,12 @@ static inline irq_hw_number_t irqd_to_hwirq(struct irq_data *d)
> * @irq_suspend: function called from core code on suspend once per chip
> * @irq_resume: function called from core code on resume once per chip
> * @irq_pm_shutdown: function called from core code on shutdown once per chip
> + * @chip_suspend: function called from core code on suspend once per
> + * chip; for handling chip details even when no interrupts
> + * are in use
> + * @chip_resume: function called from core code on resume once per chip;
> + * for handling chip details even when no interrupts are
> + * in use
> * @irq_calc_mask: Optional function to set irq_data.mask for special cases
> * @irq_print_chip: optional to print special chip info in show_interrupts
> * @irq_request_resources: optional to request resources before calling
> @@ -357,6 +365,8 @@ struct irq_chip {
> void (*irq_suspend)(struct irq_data *data);
> void (*irq_resume)(struct irq_data *data);
> void (*irq_pm_shutdown)(struct irq_data *data);
> + void (*chip_suspend)(struct irq_chip_generic *gc);
> + void (*chip_resume)(struct irq_chip_generic *gc);

I really don't want to set a precedent for random (*foo)(*bar)
callbacks.

> +
> + if (ct->chip.chip_suspend)
> + ct->chip.chip_suspend(gc);

So wouldn't it be the more intuitive solution to make this a callback
in the struct gc itself?

Thanks,

tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/

Re: [PATCH v3 08/18] baycom_epp: Replace rdtscl() with native_read_tsc()

$
0
0
On Sat, 20 Jun 2015, walter harms wrote:

> Acked-by: walter harms <wharms@bfs.de>
>
> Am 17.06.2015 02:35, schrieb Andy Lutomirski:
> > This is only used if BAYCOM_DEBUG is defined.

So why don't we just replace that by ktime_get() and get rid of the
x86'ism in that driver.

Thanks,

tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/

[PATCH v2 0/6] add device tree support for mxc rtc

$
0
0
This serie add the device tree support for the mxc rtc driver.
To do this, three steps are required :
- define two rtc clocks for imx31 and imx35
- enhance mxc rtc driver to use two clocks (rtc and ipg)
- add device tree support to mxc rtc driver

Changelog:
v2: (thanks Shawn Guo and Alexandre Belloni)
- add a second clock to imx35
- split the add of clock in a separate patches
- split the dt documentation in a separate patch

Philippe Reynes (6):
imx31: add a second rtc clock
imx35: define two clocks for rtc
rtc: mxc: use a second rtc clock
rtc: mxc: add support of device tree
dt-binding: document the binding for mxc rtc
apf27: dt: add support of internal rtc

Documentation/devicetree/bindings/rtc/rtc-mxc.txt | 27 ++++++++++++
arch/arm/boot/dts/imx27-apf27.dts | 4 ++
arch/arm/boot/dts/imx27.dtsi | 10 +++++
arch/arm/mach-imx/clk-imx31.c | 3 +-
arch/arm/mach-imx/clk-imx35.c | 6 ++-
drivers/rtc/rtc-mxc.c | 45 ++++++++++++++++-----
6 files changed, 83 insertions(+), 12 deletions(-)
create mode 100644 Documentation/devicetree/bindings/rtc/rtc-mxc.txt

--
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/

[PATCH v2 2/6] imx35: define two clocks for rtc

$
0
0
The imx35 don't define clocks for rtc.
This patch add two clocks, as needed
by the mxc rtc driver.

Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
---
arch/arm/mach-imx/clk-imx35.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-imx/clk-imx35.c b/arch/arm/mach-imx/clk-imx35.c
index a0d2b57..8c2f507 100644
--- a/arch/arm/mach-imx/clk-imx35.c
+++ b/arch/arm/mach-imx/clk-imx35.c
@@ -51,7 +51,7 @@ static const char *std_sel[] = {"ppll", "arm"};
static const char *ipg_per_sel[] = {"ahb_per_div", "arm_per_div"};

enum mx35_clks {
- ckih, mpll, ppll, mpll_075, arm, hsp, hsp_div, hsp_sel, ahb, ipg,
+ ckih, ckil, mpll, ppll, mpll_075, arm, hsp, hsp_div, hsp_sel, ahb, ipg,
arm_per_div, ahb_per_div, ipg_per, uart_sel, uart_div, esdhc_sel,
esdhc1_div, esdhc2_div, esdhc3_div, spdif_sel, spdif_div_pre,
spdif_div_post, ssi_sel, ssi1_div_pre, ssi1_div_post, ssi2_div_pre,
@@ -89,6 +89,7 @@ int __init mx35_clocks_init(void)
}

clk[ckih] = imx_clk_fixed("ckih", 24000000);
+ clk[ckil] = imx_clk_fixed("ckih", 32768);
clk[mpll] = imx_clk_pllv1("mpll", "ckih", base + MX35_CCM_MPCTL);
clk[ppll] = imx_clk_pllv1("ppll", "ckih", base + MX35_CCM_PPCTL);

@@ -240,6 +241,9 @@ int __init mx35_clocks_init(void)
clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.1");
clk_register_clkdev(clk[uart3_gate], "per", "imx21-uart.2");
clk_register_clkdev(clk[ipg], "ipg", "imx21-uart.2");
+ /* i.mx35 has the i.mx21 type uart */
+ clk_register_clkdev(clk[ckil], "rtc", "imx21-rtc");
+ clk_register_clkdev(clk[rtc_gate], "ipg", "imx21-rtc");
clk_register_clkdev(clk[usb_div], "per", "mxc-ehci.0");
clk_register_clkdev(clk[ipg], "ipg", "mxc-ehci.0");
clk_register_clkdev(clk[usbotg_gate], "ahb", "mxc-ehci.0");
--
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/

[PATCH v2 1/6] imx31: add a second rtc clock

$
0
0
The mxc rtc driver needs two clock.
It was defined only one clock, so we
define the second clock.

Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
---
arch/arm/mach-imx/clk-imx31.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/arm/mach-imx/clk-imx31.c b/arch/arm/mach-imx/clk-imx31.c
index 286ef42..480c54f 100644
--- a/arch/arm/mach-imx/clk-imx31.c
+++ b/arch/arm/mach-imx/clk-imx31.c
@@ -130,7 +130,8 @@ int __init mx31_clocks_init(unsigned long fref)
clk_register_clkdev(clk[cspi3_gate], NULL, "imx31-cspi.2");
clk_register_clkdev(clk[pwm_gate], "pwm", NULL);
clk_register_clkdev(clk[wdog_gate], NULL, "imx2-wdt.0");
- clk_register_clkdev(clk[rtc_gate], NULL, "imx21-rtc");
+ clk_register_clkdev(clk[ckil], "rtc", "imx21-rtc");
+ clk_register_clkdev(clk[rtc_gate], "ipg", "imx21-rtc");
clk_register_clkdev(clk[epit1_gate], "epit", NULL);
clk_register_clkdev(clk[epit2_gate], "epit", NULL);
clk_register_clkdev(clk[nfc], NULL, "imx27-nand.0");
--
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/

[PATCH v2 4/6] rtc: mxc: add support of device tree

$
0
0
Add device tree support for the mxc rtc driver.

Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
---
drivers/rtc/rtc-mxc.c | 19 ++++++++++++++++++-
1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c
index e916a91..befe2c2 100644
--- a/drivers/rtc/rtc-mxc.c
+++ b/drivers/rtc/rtc-mxc.c
@@ -16,6 +16,8 @@
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/clk.h>
+#include <linux/of.h>
+#include <linux/of_device.h>

#define RTC_INPUT_CLK_32768HZ (0x00 << 5)
#define RTC_INPUT_CLK_32000HZ (0x01 << 5)
@@ -98,6 +100,15 @@ static struct platform_device_id imx_rtc_devtype[] = {
};
MODULE_DEVICE_TABLE(platform, imx_rtc_devtype);

+#ifdef CONFIG_OF
+static const struct of_device_id imx_rtc_dt_ids[] = {
+ { .compatible = "fsl,imx1-rtc", .data = (const void *)IMX1_RTC },
+ { .compatible = "fsl,imx21-rtc", .data = (const void *)IMX21_RTC },
+ {}
+};
+MODULE_DEVICE_TABLE(of, imx_rtc_dt_ids);
+#endif
+
static inline int is_imx1_rtc(struct rtc_plat_data *data)
{
return data->devtype == IMX1_RTC;
@@ -362,12 +373,17 @@ static int mxc_rtc_probe(struct platform_device *pdev)
u32 reg;
unsigned long rate;
int ret;
+ const struct of_device_id *of_id;

pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
if (!pdata)
return -ENOMEM;

- pdata->devtype = pdev->id_entry->driver_data;
+ of_id = of_match_device(imx_rtc_dt_ids, &pdev->dev);
+ if (of_id)
+ pdata->devtype = (enum imx_rtc_type)of_id->data;
+ else
+ pdata->devtype = pdev->id_entry->driver_data;

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
pdata->ioaddr = devm_ioremap_resource(&pdev->dev, res);
@@ -481,6 +497,7 @@ static SIMPLE_DEV_PM_OPS(mxc_rtc_pm_ops, mxc_rtc_suspend, mxc_rtc_resume);
static struct platform_driver mxc_rtc_driver = {
.driver = {
.name = "mxc_rtc",
+ .of_match_table = of_match_ptr(imx_rtc_dt_ids),
.pm = &mxc_rtc_pm_ops,
},
.id_table = imx_rtc_devtype,
--
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/

[PATCH v2 5/6] dt-binding: document the binding for mxc rtc

$
0
0
This adds documentation of device tree bindings for the
mxc rtc.

Cc: Rob Herring <robh+dt@kernel.org>
Cc: Pawel Moll <pawel.moll@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
Cc: Kumar Gala <galak@codeaurora.org>
Cc: devicetree@vger.kernel.org
Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
---
Documentation/devicetree/bindings/rtc/rtc-mxc.txt | 27 +++++++++++++++++++++
1 files changed, 27 insertions(+), 0 deletions(-)
create mode 100644 Documentation/devicetree/bindings/rtc/rtc-mxc.txt

diff --git a/Documentation/devicetree/bindings/rtc/rtc-mxc.txt b/Documentation/devicetree/bindings/rtc/rtc-mxc.txt
new file mode 100644
index 0000000..5505493
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/rtc-mxc.txt
@@ -0,0 +1,27 @@
+* Real Time Clock of the i.MX SoCs
+
+RTC controller for the i.MX SoCs
+
+Required properties:
+- compatible: Should be "fsl,imx1-rtc" or "fsl,imx21-rtc".
+- reg: physical base address of the controller and length of memory mapped
+ region.
+- interrupts: IRQ line for the RTC.
+- clocks: should contain two entries:
+ * one for the input reference
+ * one for the the SoC RTC
+- clock-names: should contain:
+ * "rtc" for the input reference clock
+ * "ipg" for the SoC RTC clock
+
+Example:
+
+rtc@10007000 {
+ compatible = "fsl,imx21-rtc";
+ reg = <0x10007000 0x1000>;
+ interrupts = <22>;
+ clocks = <&clks IMX27_CLK_CKIL>,
+ <&clks IMX27_CLK_RTC_IPG_GATE>;
+ clock-names = "rtc, "ipg";
+ status = "disabled";
+};
--
1.7.4.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at http://www.tux.org/lkml/
Viewing all 23908 articles
Browse latest View live




Latest Images