2015-11-02 13:22:15

by Peter Ujfalusi

[permalink] [raw]
Subject: [PATCH] dmaengine: edma: Add dummy driver skeleton for edma3-tptc

The eDMA3 TPTC does not need any software configuration, but it is a
separate IP block in the SoC. In order the omap hwmod core to be able to
handle the TPTC resources correctly in regards of PM we need to have a
driver loaded for it.
This patch will add a dummy driver skeleton without probe or remove
callbacks provided.

Signed-off-by: Peter Ujfalusi <[email protected]>
Reported-by: Olof Johansson <[email protected]>
---
Hi,

while it would have been possible to add the edma3-tptc compatible to be handled
by the edma-tpcc driver (and when the device is tptc, do nothing) it would
make the driver code a bit harder to follow.
I think having separate structure for the tptc looks better and if we ever need
to have separate driver for the tptc it will be cleaner for us the separate it.

This patch alone w/o any hwmod flag changes will make sure that the edma-tptc is
not powered down after the kernel is finished it's booting.

Regards,
Peter

drivers/dma/edma.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)

diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
index 31722d436a42..6b03e4e84e6b 100644
--- a/drivers/dma/edma.c
+++ b/drivers/dma/edma.c
@@ -269,6 +269,11 @@ static const struct of_device_id edma_of_ids[] = {
{}
};

+static const struct of_device_id edma_tptc_of_ids[] = {
+ { .compatible = "ti,edma3-tptc", },
+ {}
+};
+
static inline unsigned int edma_read(struct edma_cc *ecc, int offset)
{
return (unsigned int)__raw_readl(ecc->base + offset);
@@ -2399,6 +2404,13 @@ static struct platform_driver edma_driver = {
},
};

+static struct platform_driver edma_tptc_driver = {
+ .driver = {
+ .name = "edma3-tptc",
+ .of_match_table = edma_tptc_of_ids,
+ },
+};
+
bool edma_filter_fn(struct dma_chan *chan, void *param)
{
bool match = false;
@@ -2418,6 +2430,12 @@ EXPORT_SYMBOL(edma_filter_fn);

static int edma_init(void)
{
+ int ret;
+
+ ret = platform_driver_register(&edma_tptc_driver);
+ if (ret)
+ return ret;
+
return platform_driver_register(&edma_driver);
}
subsys_initcall(edma_init);
@@ -2425,6 +2443,7 @@ subsys_initcall(edma_init);
static void __exit edma_exit(void)
{
platform_driver_unregister(&edma_driver);
+ platform_driver_unregister(&edma_tptc_driver);
}
module_exit(edma_exit);

--
2.6.1


2015-11-04 16:34:25

by Felipe Balbi

[permalink] [raw]
Subject: Re: [PATCH] dmaengine: edma: Add dummy driver skeleton for edma3-tptc

Peter Ujfalusi <[email protected]> writes:

> The eDMA3 TPTC does not need any software configuration, but it is a
> separate IP block in the SoC. In order the omap hwmod core to be able to
> handle the TPTC resources correctly in regards of PM we need to have a
> driver loaded for it.
> This patch will add a dummy driver skeleton without probe or remove
> callbacks provided.
>
> Signed-off-by: Peter Ujfalusi <[email protected]>
> Reported-by: Olof Johansson <[email protected]>

This fixes the problem I also reported on linux-omap [1]

Tested-by: Felipe Balbi <[email protected]>

[1] http://marc.info/?l=linux-omap&m=144665429032014&w=2

> ---
> Hi,
>
> while it would have been possible to add the edma3-tptc compatible to be handled
> by the edma-tpcc driver (and when the device is tptc, do nothing) it would
> make the driver code a bit harder to follow.
> I think having separate structure for the tptc looks better and if we ever need
> to have separate driver for the tptc it will be cleaner for us the separate it.
>
> This patch alone w/o any hwmod flag changes will make sure that the edma-tptc is
> not powered down after the kernel is finished it's booting.
>
> Regards,
> Peter
>
> drivers/dma/edma.c | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
> index 31722d436a42..6b03e4e84e6b 100644
> --- a/drivers/dma/edma.c
> +++ b/drivers/dma/edma.c
> @@ -269,6 +269,11 @@ static const struct of_device_id edma_of_ids[] = {
> {}
> };
>
> +static const struct of_device_id edma_tptc_of_ids[] = {
> + { .compatible = "ti,edma3-tptc", },
> + {}
> +};
> +
> static inline unsigned int edma_read(struct edma_cc *ecc, int offset)
> {
> return (unsigned int)__raw_readl(ecc->base + offset);
> @@ -2399,6 +2404,13 @@ static struct platform_driver edma_driver = {
> },
> };
>
> +static struct platform_driver edma_tptc_driver = {
> + .driver = {
> + .name = "edma3-tptc",
> + .of_match_table = edma_tptc_of_ids,
> + },
> +};
> +
> bool edma_filter_fn(struct dma_chan *chan, void *param)
> {
> bool match = false;
> @@ -2418,6 +2430,12 @@ EXPORT_SYMBOL(edma_filter_fn);
>
> static int edma_init(void)
> {
> + int ret;
> +
> + ret = platform_driver_register(&edma_tptc_driver);
> + if (ret)
> + return ret;
> +
> return platform_driver_register(&edma_driver);
> }
> subsys_initcall(edma_init);
> @@ -2425,6 +2443,7 @@ subsys_initcall(edma_init);
> static void __exit edma_exit(void)
> {
> platform_driver_unregister(&edma_driver);
> + platform_driver_unregister(&edma_tptc_driver);
> }
> module_exit(edma_exit);
>
> --
> 2.6.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/

--
balbi


Attachments:
signature.asc (818.00 B)

2015-11-04 16:37:56

by Vinod Koul

[permalink] [raw]
Subject: Re: [PATCH] dmaengine: edma: Add dummy driver skeleton for edma3-tptc

On Wed, Nov 04, 2015 at 10:33:27AM -0600, Felipe Balbi wrote:
> Peter Ujfalusi <[email protected]> writes:
>
> > The eDMA3 TPTC does not need any software configuration, but it is a
> > separate IP block in the SoC. In order the omap hwmod core to be able to
> > handle the TPTC resources correctly in regards of PM we need to have a
> > driver loaded for it.
> > This patch will add a dummy driver skeleton without probe or remove
> > callbacks provided.
> >
> > Signed-off-by: Peter Ujfalusi <[email protected]>
> > Reported-by: Olof Johansson <[email protected]>
>
> This fixes the problem I also reported on linux-omap [1]
>
> Tested-by: Felipe Balbi <[email protected]>
>
> [1] http://marc.info/?l=linux-omap&m=144665429032014&w=2

Great, I was about to point you to this series, I will push this in -next
now

Thanks
--
~Vinod


Attachments:
(No filename) (838.00 B)
signature.asc (819.00 B)
Digital signature
Download all attachments

2015-11-13 14:54:59

by Tony Lindgren

[permalink] [raw]
Subject: Re: [PATCH] dmaengine: edma: Add dummy driver skeleton for edma3-tptc

* Vinod Koul <[email protected]> [151104 08:38]:
> On Wed, Nov 04, 2015 at 10:33:27AM -0600, Felipe Balbi wrote:
> > Peter Ujfalusi <[email protected]> writes:
> >
> > > The eDMA3 TPTC does not need any software configuration, but it is a
> > > separate IP block in the SoC. In order the omap hwmod core to be able to
> > > handle the TPTC resources correctly in regards of PM we need to have a
> > > driver loaded for it.
> > > This patch will add a dummy driver skeleton without probe or remove
> > > callbacks provided.
> > >
> > > Signed-off-by: Peter Ujfalusi <[email protected]>
> > > Reported-by: Olof Johansson <[email protected]>
> >
> > This fixes the problem I also reported on linux-omap [1]
> >
> > Tested-by: Felipe Balbi <[email protected]>
> >
> > [1] http://marc.info/?l=linux-omap&m=144665429032014&w=2
>
> Great, I was about to point you to this series, I will push this in -next
> now

Soungd good to me, thanks for fixing it up Peter.

Tony