All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drivers: clocksource: Use ttc driver as platform driver
@ 2019-11-07 10:30 ` Rajan Vaja
  0 siblings, 0 replies; 16+ messages in thread
From: Rajan Vaja @ 2019-11-07 10:30 UTC (permalink / raw)
  To: ichal.simek, daniel.lezcano, tglx
  Cc: linux-arm-kernel, linux-kernel, Rajan Vaja

Currently TTC driver is TIMER_OF_DECLARE type driver. Because of
that, TTC driver may be initialized before other clock drivers. If
TTC driver is dependent on that clock driver then initialization of
TTC driver will failed.

So use TTC driver as platform driver instead of using
TIMER_OF_DECLARE.

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
---
 drivers/clocksource/timer-cadence-ttc.c | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/drivers/clocksource/timer-cadence-ttc.c b/drivers/clocksource/timer-cadence-ttc.c
index 88fe2e9..38858e1 100644
--- a/drivers/clocksource/timer-cadence-ttc.c
+++ b/drivers/clocksource/timer-cadence-ttc.c
@@ -15,6 +15,8 @@
 #include <linux/of_irq.h>
 #include <linux/slab.h>
 #include <linux/sched_clock.h>
+#include <linux/module.h>
+#include <linux/of_platform.h>
 
 /*
  * This driver configures the 2 16/32-bit count-up timers as follows:
@@ -464,13 +466,7 @@ static int __init ttc_setup_clockevent(struct clk *clk,
 	return 0;
 }
 
-/**
- * ttc_timer_init - Initialize the timer
- *
- * Initializes the timer hardware and register the clock source and clock event
- * timers with Linux kernal timer framework
- */
-static int __init ttc_timer_init(struct device_node *timer)
+static int __init ttc_timer_probe(struct platform_device *pdev)
 {
 	unsigned int irq;
 	void __iomem *timer_baseaddr;
@@ -478,6 +474,7 @@ static int __init ttc_timer_init(struct device_node *timer)
 	static int initialized;
 	int clksel, ret;
 	u32 timer_width = 16;
+	struct device_node *timer = pdev->dev.of_node;
 
 	if (initialized)
 		return 0;
@@ -532,4 +529,17 @@ static int __init ttc_timer_init(struct device_node *timer)
 	return 0;
 }
 
-TIMER_OF_DECLARE(ttc, "cdns,ttc", ttc_timer_init);
+static const struct of_device_id ttc_timer_of_match[] = {
+	{.compatible = "cdns,ttc"},
+	{},
+};
+
+MODULE_DEVICE_TABLE(of, ttc_timer_of_match);
+
+static struct platform_driver ttc_timer_driver = {
+	.driver = {
+		.name	= "cdns_ttc_timer",
+		.of_match_table = ttc_timer_of_match,
+	},
+};
+builtin_platform_driver_probe(ttc_timer_driver, ttc_timer_probe);
-- 
2.7.4


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

* [PATCH] drivers: clocksource: Use ttc driver as platform driver
@ 2019-11-07 10:30 ` Rajan Vaja
  0 siblings, 0 replies; 16+ messages in thread
From: Rajan Vaja @ 2019-11-07 10:30 UTC (permalink / raw)
  To: ichal.simek, daniel.lezcano, tglx
  Cc: Rajan Vaja, linux-kernel, linux-arm-kernel

Currently TTC driver is TIMER_OF_DECLARE type driver. Because of
that, TTC driver may be initialized before other clock drivers. If
TTC driver is dependent on that clock driver then initialization of
TTC driver will failed.

So use TTC driver as platform driver instead of using
TIMER_OF_DECLARE.

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
---
 drivers/clocksource/timer-cadence-ttc.c | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/drivers/clocksource/timer-cadence-ttc.c b/drivers/clocksource/timer-cadence-ttc.c
index 88fe2e9..38858e1 100644
--- a/drivers/clocksource/timer-cadence-ttc.c
+++ b/drivers/clocksource/timer-cadence-ttc.c
@@ -15,6 +15,8 @@
 #include <linux/of_irq.h>
 #include <linux/slab.h>
 #include <linux/sched_clock.h>
+#include <linux/module.h>
+#include <linux/of_platform.h>
 
 /*
  * This driver configures the 2 16/32-bit count-up timers as follows:
@@ -464,13 +466,7 @@ static int __init ttc_setup_clockevent(struct clk *clk,
 	return 0;
 }
 
-/**
- * ttc_timer_init - Initialize the timer
- *
- * Initializes the timer hardware and register the clock source and clock event
- * timers with Linux kernal timer framework
- */
-static int __init ttc_timer_init(struct device_node *timer)
+static int __init ttc_timer_probe(struct platform_device *pdev)
 {
 	unsigned int irq;
 	void __iomem *timer_baseaddr;
@@ -478,6 +474,7 @@ static int __init ttc_timer_init(struct device_node *timer)
 	static int initialized;
 	int clksel, ret;
 	u32 timer_width = 16;
+	struct device_node *timer = pdev->dev.of_node;
 
 	if (initialized)
 		return 0;
@@ -532,4 +529,17 @@ static int __init ttc_timer_init(struct device_node *timer)
 	return 0;
 }
 
-TIMER_OF_DECLARE(ttc, "cdns,ttc", ttc_timer_init);
+static const struct of_device_id ttc_timer_of_match[] = {
+	{.compatible = "cdns,ttc"},
+	{},
+};
+
+MODULE_DEVICE_TABLE(of, ttc_timer_of_match);
+
+static struct platform_driver ttc_timer_driver = {
+	.driver = {
+		.name	= "cdns_ttc_timer",
+		.of_match_table = ttc_timer_of_match,
+	},
+};
+builtin_platform_driver_probe(ttc_timer_driver, ttc_timer_probe);
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* RE: [PATCH] drivers: clocksource: Use ttc driver as platform driver
  2019-11-07 10:30 ` Rajan Vaja
@ 2019-11-07 10:34   ` Rajan Vaja
  -1 siblings, 0 replies; 16+ messages in thread
From: Rajan Vaja @ 2019-11-07 10:34 UTC (permalink / raw)
  To: Rajan Vaja, daniel.lezcano, tglx; +Cc: linux-arm-kernel, linux-kernel

Please discard this email as there is a typo in email address (michal.simek@xilinx.com -> ichal.simek@xilinx.com). I am sending new email.

Thanks,
Rajan

> -----Original Message-----
> From: Rajan Vaja <rajan.vaja@xilinx.com>
> Sent: 07 November 2019 02:31
> To: ichal.simek@xilinx.com; daniel.lezcano@linaro.org; tglx@linutronix.de
> Cc: linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org; Rajan
> Vaja <RAJANV@xilinx.com>
> Subject: [PATCH] drivers: clocksource: Use ttc driver as platform driver
> 
> Currently TTC driver is TIMER_OF_DECLARE type driver. Because of
> that, TTC driver may be initialized before other clock drivers. If
> TTC driver is dependent on that clock driver then initialization of
> TTC driver will failed.
> 
> So use TTC driver as platform driver instead of using
> TIMER_OF_DECLARE.
> 
> Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
> ---
>  drivers/clocksource/timer-cadence-ttc.c | 26 ++++++++++++++++++--------
>  1 file changed, 18 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/clocksource/timer-cadence-ttc.c b/drivers/clocksource/timer-
> cadence-ttc.c
> index 88fe2e9..38858e1 100644
> --- a/drivers/clocksource/timer-cadence-ttc.c
> +++ b/drivers/clocksource/timer-cadence-ttc.c
> @@ -15,6 +15,8 @@
>  #include <linux/of_irq.h>
>  #include <linux/slab.h>
>  #include <linux/sched_clock.h>
> +#include <linux/module.h>
> +#include <linux/of_platform.h>
> 
>  /*
>   * This driver configures the 2 16/32-bit count-up timers as follows:
> @@ -464,13 +466,7 @@ static int __init ttc_setup_clockevent(struct clk *clk,
>  	return 0;
>  }
> 
> -/**
> - * ttc_timer_init - Initialize the timer
> - *
> - * Initializes the timer hardware and register the clock source and clock event
> - * timers with Linux kernal timer framework
> - */
> -static int __init ttc_timer_init(struct device_node *timer)
> +static int __init ttc_timer_probe(struct platform_device *pdev)
>  {
>  	unsigned int irq;
>  	void __iomem *timer_baseaddr;
> @@ -478,6 +474,7 @@ static int __init ttc_timer_init(struct device_node *timer)
>  	static int initialized;
>  	int clksel, ret;
>  	u32 timer_width = 16;
> +	struct device_node *timer = pdev->dev.of_node;
> 
>  	if (initialized)
>  		return 0;
> @@ -532,4 +529,17 @@ static int __init ttc_timer_init(struct device_node *timer)
>  	return 0;
>  }
> 
> -TIMER_OF_DECLARE(ttc, "cdns,ttc", ttc_timer_init);
> +static const struct of_device_id ttc_timer_of_match[] = {
> +	{.compatible = "cdns,ttc"},
> +	{},
> +};
> +
> +MODULE_DEVICE_TABLE(of, ttc_timer_of_match);
> +
> +static struct platform_driver ttc_timer_driver = {
> +	.driver = {
> +		.name	= "cdns_ttc_timer",
> +		.of_match_table = ttc_timer_of_match,
> +	},
> +};
> +builtin_platform_driver_probe(ttc_timer_driver, ttc_timer_probe);
> --
> 2.7.4


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

* RE: [PATCH] drivers: clocksource: Use ttc driver as platform driver
@ 2019-11-07 10:34   ` Rajan Vaja
  0 siblings, 0 replies; 16+ messages in thread
From: Rajan Vaja @ 2019-11-07 10:34 UTC (permalink / raw)
  To: Rajan Vaja, daniel.lezcano, tglx; +Cc: linux-kernel, linux-arm-kernel

Please discard this email as there is a typo in email address (michal.simek@xilinx.com -> ichal.simek@xilinx.com). I am sending new email.

Thanks,
Rajan

> -----Original Message-----
> From: Rajan Vaja <rajan.vaja@xilinx.com>
> Sent: 07 November 2019 02:31
> To: ichal.simek@xilinx.com; daniel.lezcano@linaro.org; tglx@linutronix.de
> Cc: linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org; Rajan
> Vaja <RAJANV@xilinx.com>
> Subject: [PATCH] drivers: clocksource: Use ttc driver as platform driver
> 
> Currently TTC driver is TIMER_OF_DECLARE type driver. Because of
> that, TTC driver may be initialized before other clock drivers. If
> TTC driver is dependent on that clock driver then initialization of
> TTC driver will failed.
> 
> So use TTC driver as platform driver instead of using
> TIMER_OF_DECLARE.
> 
> Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
> ---
>  drivers/clocksource/timer-cadence-ttc.c | 26 ++++++++++++++++++--------
>  1 file changed, 18 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/clocksource/timer-cadence-ttc.c b/drivers/clocksource/timer-
> cadence-ttc.c
> index 88fe2e9..38858e1 100644
> --- a/drivers/clocksource/timer-cadence-ttc.c
> +++ b/drivers/clocksource/timer-cadence-ttc.c
> @@ -15,6 +15,8 @@
>  #include <linux/of_irq.h>
>  #include <linux/slab.h>
>  #include <linux/sched_clock.h>
> +#include <linux/module.h>
> +#include <linux/of_platform.h>
> 
>  /*
>   * This driver configures the 2 16/32-bit count-up timers as follows:
> @@ -464,13 +466,7 @@ static int __init ttc_setup_clockevent(struct clk *clk,
>  	return 0;
>  }
> 
> -/**
> - * ttc_timer_init - Initialize the timer
> - *
> - * Initializes the timer hardware and register the clock source and clock event
> - * timers with Linux kernal timer framework
> - */
> -static int __init ttc_timer_init(struct device_node *timer)
> +static int __init ttc_timer_probe(struct platform_device *pdev)
>  {
>  	unsigned int irq;
>  	void __iomem *timer_baseaddr;
> @@ -478,6 +474,7 @@ static int __init ttc_timer_init(struct device_node *timer)
>  	static int initialized;
>  	int clksel, ret;
>  	u32 timer_width = 16;
> +	struct device_node *timer = pdev->dev.of_node;
> 
>  	if (initialized)
>  		return 0;
> @@ -532,4 +529,17 @@ static int __init ttc_timer_init(struct device_node *timer)
>  	return 0;
>  }
> 
> -TIMER_OF_DECLARE(ttc, "cdns,ttc", ttc_timer_init);
> +static const struct of_device_id ttc_timer_of_match[] = {
> +	{.compatible = "cdns,ttc"},
> +	{},
> +};
> +
> +MODULE_DEVICE_TABLE(of, ttc_timer_of_match);
> +
> +static struct platform_driver ttc_timer_driver = {
> +	.driver = {
> +		.name	= "cdns_ttc_timer",
> +		.of_match_table = ttc_timer_of_match,
> +	},
> +};
> +builtin_platform_driver_probe(ttc_timer_driver, ttc_timer_probe);
> --
> 2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* RE: [PATCH] drivers: clocksource: Use ttc driver as platform driver
  2019-11-07 10:30 ` Rajan Vaja
@ 2019-11-26 11:35   ` Rajan Vaja
  -1 siblings, 0 replies; 16+ messages in thread
From: Rajan Vaja @ 2019-11-26 11:35 UTC (permalink / raw)
  To: Rajan Vaja, ichal.simek, daniel.lezcano, tglx
  Cc: linux-arm-kernel, linux-kernel

Request for review.

Thanks,
Rajan

> -----Original Message-----
> From: Rajan Vaja <rajan.vaja@xilinx.com>
> Sent: 07 November 2019 04:01 PM
> To: ichal.simek@xilinx.com; daniel.lezcano@linaro.org; tglx@linutronix.de
> Cc: linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org; Rajan Vaja
> <RAJANV@xilinx.com>
> Subject: [PATCH] drivers: clocksource: Use ttc driver as platform driver
> 
> Currently TTC driver is TIMER_OF_DECLARE type driver. Because of
> that, TTC driver may be initialized before other clock drivers. If
> TTC driver is dependent on that clock driver then initialization of
> TTC driver will failed.
> 
> So use TTC driver as platform driver instead of using
> TIMER_OF_DECLARE.
> 
> Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
> ---
>  drivers/clocksource/timer-cadence-ttc.c | 26 ++++++++++++++++++--------
>  1 file changed, 18 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/clocksource/timer-cadence-ttc.c b/drivers/clocksource/timer-
> cadence-ttc.c
> index 88fe2e9..38858e1 100644
> --- a/drivers/clocksource/timer-cadence-ttc.c
> +++ b/drivers/clocksource/timer-cadence-ttc.c
> @@ -15,6 +15,8 @@
>  #include <linux/of_irq.h>
>  #include <linux/slab.h>
>  #include <linux/sched_clock.h>
> +#include <linux/module.h>
> +#include <linux/of_platform.h>
> 
>  /*
>   * This driver configures the 2 16/32-bit count-up timers as follows:
> @@ -464,13 +466,7 @@ static int __init ttc_setup_clockevent(struct clk *clk,
>  	return 0;
>  }
> 
> -/**
> - * ttc_timer_init - Initialize the timer
> - *
> - * Initializes the timer hardware and register the clock source and clock event
> - * timers with Linux kernal timer framework
> - */
> -static int __init ttc_timer_init(struct device_node *timer)
> +static int __init ttc_timer_probe(struct platform_device *pdev)
>  {
>  	unsigned int irq;
>  	void __iomem *timer_baseaddr;
> @@ -478,6 +474,7 @@ static int __init ttc_timer_init(struct device_node *timer)
>  	static int initialized;
>  	int clksel, ret;
>  	u32 timer_width = 16;
> +	struct device_node *timer = pdev->dev.of_node;
> 
>  	if (initialized)
>  		return 0;
> @@ -532,4 +529,17 @@ static int __init ttc_timer_init(struct device_node *timer)
>  	return 0;
>  }
> 
> -TIMER_OF_DECLARE(ttc, "cdns,ttc", ttc_timer_init);
> +static const struct of_device_id ttc_timer_of_match[] = {
> +	{.compatible = "cdns,ttc"},
> +	{},
> +};
> +
> +MODULE_DEVICE_TABLE(of, ttc_timer_of_match);
> +
> +static struct platform_driver ttc_timer_driver = {
> +	.driver = {
> +		.name	= "cdns_ttc_timer",
> +		.of_match_table = ttc_timer_of_match,
> +	},
> +};
> +builtin_platform_driver_probe(ttc_timer_driver, ttc_timer_probe);
> --
> 2.7.4


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

* RE: [PATCH] drivers: clocksource: Use ttc driver as platform driver
@ 2019-11-26 11:35   ` Rajan Vaja
  0 siblings, 0 replies; 16+ messages in thread
From: Rajan Vaja @ 2019-11-26 11:35 UTC (permalink / raw)
  To: Rajan Vaja, ichal.simek, daniel.lezcano, tglx
  Cc: linux-kernel, linux-arm-kernel

Request for review.

Thanks,
Rajan

> -----Original Message-----
> From: Rajan Vaja <rajan.vaja@xilinx.com>
> Sent: 07 November 2019 04:01 PM
> To: ichal.simek@xilinx.com; daniel.lezcano@linaro.org; tglx@linutronix.de
> Cc: linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org; Rajan Vaja
> <RAJANV@xilinx.com>
> Subject: [PATCH] drivers: clocksource: Use ttc driver as platform driver
> 
> Currently TTC driver is TIMER_OF_DECLARE type driver. Because of
> that, TTC driver may be initialized before other clock drivers. If
> TTC driver is dependent on that clock driver then initialization of
> TTC driver will failed.
> 
> So use TTC driver as platform driver instead of using
> TIMER_OF_DECLARE.
> 
> Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
> ---
>  drivers/clocksource/timer-cadence-ttc.c | 26 ++++++++++++++++++--------
>  1 file changed, 18 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/clocksource/timer-cadence-ttc.c b/drivers/clocksource/timer-
> cadence-ttc.c
> index 88fe2e9..38858e1 100644
> --- a/drivers/clocksource/timer-cadence-ttc.c
> +++ b/drivers/clocksource/timer-cadence-ttc.c
> @@ -15,6 +15,8 @@
>  #include <linux/of_irq.h>
>  #include <linux/slab.h>
>  #include <linux/sched_clock.h>
> +#include <linux/module.h>
> +#include <linux/of_platform.h>
> 
>  /*
>   * This driver configures the 2 16/32-bit count-up timers as follows:
> @@ -464,13 +466,7 @@ static int __init ttc_setup_clockevent(struct clk *clk,
>  	return 0;
>  }
> 
> -/**
> - * ttc_timer_init - Initialize the timer
> - *
> - * Initializes the timer hardware and register the clock source and clock event
> - * timers with Linux kernal timer framework
> - */
> -static int __init ttc_timer_init(struct device_node *timer)
> +static int __init ttc_timer_probe(struct platform_device *pdev)
>  {
>  	unsigned int irq;
>  	void __iomem *timer_baseaddr;
> @@ -478,6 +474,7 @@ static int __init ttc_timer_init(struct device_node *timer)
>  	static int initialized;
>  	int clksel, ret;
>  	u32 timer_width = 16;
> +	struct device_node *timer = pdev->dev.of_node;
> 
>  	if (initialized)
>  		return 0;
> @@ -532,4 +529,17 @@ static int __init ttc_timer_init(struct device_node *timer)
>  	return 0;
>  }
> 
> -TIMER_OF_DECLARE(ttc, "cdns,ttc", ttc_timer_init);
> +static const struct of_device_id ttc_timer_of_match[] = {
> +	{.compatible = "cdns,ttc"},
> +	{},
> +};
> +
> +MODULE_DEVICE_TABLE(of, ttc_timer_of_match);
> +
> +static struct platform_driver ttc_timer_driver = {
> +	.driver = {
> +		.name	= "cdns_ttc_timer",
> +		.of_match_table = ttc_timer_of_match,
> +	},
> +};
> +builtin_platform_driver_probe(ttc_timer_driver, ttc_timer_probe);
> --
> 2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* RE: [PATCH] drivers: clocksource: Use ttc driver as platform driver
  2019-11-26 11:35   ` Rajan Vaja
@ 2019-11-26 11:56     ` Rajan Vaja
  -1 siblings, 0 replies; 16+ messages in thread
From: Rajan Vaja @ 2019-11-26 11:56 UTC (permalink / raw)
  To: daniel.lezcano, tglx; +Cc: linux-arm-kernel, linux-kernel

Please ignore this request.

Thanks,
Rajan

> -----Original Message-----
> From: Rajan Vaja
> Sent: 26 November 2019 05:06 PM
> To: Rajan Vaja <RAJANV@xilinx.com>; ichal.simek@xilinx.com;
> daniel.lezcano@linaro.org; tglx@linutronix.de
> Cc: linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org
> Subject: RE: [PATCH] drivers: clocksource: Use ttc driver as platform driver
> 
> Request for review.
> 
> Thanks,
> Rajan
> 
> > -----Original Message-----
> > From: Rajan Vaja <rajan.vaja@xilinx.com>
> > Sent: 07 November 2019 04:01 PM
> > To: ichal.simek@xilinx.com; daniel.lezcano@linaro.org; tglx@linutronix.de
> > Cc: linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org; Rajan
> Vaja
> > <RAJANV@xilinx.com>
> > Subject: [PATCH] drivers: clocksource: Use ttc driver as platform driver
> >
> > Currently TTC driver is TIMER_OF_DECLARE type driver. Because of
> > that, TTC driver may be initialized before other clock drivers. If
> > TTC driver is dependent on that clock driver then initialization of
> > TTC driver will failed.
> >
> > So use TTC driver as platform driver instead of using
> > TIMER_OF_DECLARE.
> >
> > Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
> > ---
> >  drivers/clocksource/timer-cadence-ttc.c | 26 ++++++++++++++++++--------
> >  1 file changed, 18 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/clocksource/timer-cadence-ttc.c b/drivers/clocksource/timer-
> > cadence-ttc.c
> > index 88fe2e9..38858e1 100644
> > --- a/drivers/clocksource/timer-cadence-ttc.c
> > +++ b/drivers/clocksource/timer-cadence-ttc.c
> > @@ -15,6 +15,8 @@
> >  #include <linux/of_irq.h>
> >  #include <linux/slab.h>
> >  #include <linux/sched_clock.h>
> > +#include <linux/module.h>
> > +#include <linux/of_platform.h>
> >
> >  /*
> >   * This driver configures the 2 16/32-bit count-up timers as follows:
> > @@ -464,13 +466,7 @@ static int __init ttc_setup_clockevent(struct clk *clk,
> >  	return 0;
> >  }
> >
> > -/**
> > - * ttc_timer_init - Initialize the timer
> > - *
> > - * Initializes the timer hardware and register the clock source and clock event
> > - * timers with Linux kernal timer framework
> > - */
> > -static int __init ttc_timer_init(struct device_node *timer)
> > +static int __init ttc_timer_probe(struct platform_device *pdev)
> >  {
> >  	unsigned int irq;
> >  	void __iomem *timer_baseaddr;
> > @@ -478,6 +474,7 @@ static int __init ttc_timer_init(struct device_node *timer)
> >  	static int initialized;
> >  	int clksel, ret;
> >  	u32 timer_width = 16;
> > +	struct device_node *timer = pdev->dev.of_node;
> >
> >  	if (initialized)
> >  		return 0;
> > @@ -532,4 +529,17 @@ static int __init ttc_timer_init(struct device_node
> *timer)
> >  	return 0;
> >  }
> >
> > -TIMER_OF_DECLARE(ttc, "cdns,ttc", ttc_timer_init);
> > +static const struct of_device_id ttc_timer_of_match[] = {
> > +	{.compatible = "cdns,ttc"},
> > +	{},
> > +};
> > +
> > +MODULE_DEVICE_TABLE(of, ttc_timer_of_match);
> > +
> > +static struct platform_driver ttc_timer_driver = {
> > +	.driver = {
> > +		.name	= "cdns_ttc_timer",
> > +		.of_match_table = ttc_timer_of_match,
> > +	},
> > +};
> > +builtin_platform_driver_probe(ttc_timer_driver, ttc_timer_probe);
> > --
> > 2.7.4


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

* RE: [PATCH] drivers: clocksource: Use ttc driver as platform driver
@ 2019-11-26 11:56     ` Rajan Vaja
  0 siblings, 0 replies; 16+ messages in thread
From: Rajan Vaja @ 2019-11-26 11:56 UTC (permalink / raw)
  To: daniel.lezcano, tglx; +Cc: linux-kernel, linux-arm-kernel

Please ignore this request.

Thanks,
Rajan

> -----Original Message-----
> From: Rajan Vaja
> Sent: 26 November 2019 05:06 PM
> To: Rajan Vaja <RAJANV@xilinx.com>; ichal.simek@xilinx.com;
> daniel.lezcano@linaro.org; tglx@linutronix.de
> Cc: linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org
> Subject: RE: [PATCH] drivers: clocksource: Use ttc driver as platform driver
> 
> Request for review.
> 
> Thanks,
> Rajan
> 
> > -----Original Message-----
> > From: Rajan Vaja <rajan.vaja@xilinx.com>
> > Sent: 07 November 2019 04:01 PM
> > To: ichal.simek@xilinx.com; daniel.lezcano@linaro.org; tglx@linutronix.de
> > Cc: linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org; Rajan
> Vaja
> > <RAJANV@xilinx.com>
> > Subject: [PATCH] drivers: clocksource: Use ttc driver as platform driver
> >
> > Currently TTC driver is TIMER_OF_DECLARE type driver. Because of
> > that, TTC driver may be initialized before other clock drivers. If
> > TTC driver is dependent on that clock driver then initialization of
> > TTC driver will failed.
> >
> > So use TTC driver as platform driver instead of using
> > TIMER_OF_DECLARE.
> >
> > Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
> > ---
> >  drivers/clocksource/timer-cadence-ttc.c | 26 ++++++++++++++++++--------
> >  1 file changed, 18 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/clocksource/timer-cadence-ttc.c b/drivers/clocksource/timer-
> > cadence-ttc.c
> > index 88fe2e9..38858e1 100644
> > --- a/drivers/clocksource/timer-cadence-ttc.c
> > +++ b/drivers/clocksource/timer-cadence-ttc.c
> > @@ -15,6 +15,8 @@
> >  #include <linux/of_irq.h>
> >  #include <linux/slab.h>
> >  #include <linux/sched_clock.h>
> > +#include <linux/module.h>
> > +#include <linux/of_platform.h>
> >
> >  /*
> >   * This driver configures the 2 16/32-bit count-up timers as follows:
> > @@ -464,13 +466,7 @@ static int __init ttc_setup_clockevent(struct clk *clk,
> >  	return 0;
> >  }
> >
> > -/**
> > - * ttc_timer_init - Initialize the timer
> > - *
> > - * Initializes the timer hardware and register the clock source and clock event
> > - * timers with Linux kernal timer framework
> > - */
> > -static int __init ttc_timer_init(struct device_node *timer)
> > +static int __init ttc_timer_probe(struct platform_device *pdev)
> >  {
> >  	unsigned int irq;
> >  	void __iomem *timer_baseaddr;
> > @@ -478,6 +474,7 @@ static int __init ttc_timer_init(struct device_node *timer)
> >  	static int initialized;
> >  	int clksel, ret;
> >  	u32 timer_width = 16;
> > +	struct device_node *timer = pdev->dev.of_node;
> >
> >  	if (initialized)
> >  		return 0;
> > @@ -532,4 +529,17 @@ static int __init ttc_timer_init(struct device_node
> *timer)
> >  	return 0;
> >  }
> >
> > -TIMER_OF_DECLARE(ttc, "cdns,ttc", ttc_timer_init);
> > +static const struct of_device_id ttc_timer_of_match[] = {
> > +	{.compatible = "cdns,ttc"},
> > +	{},
> > +};
> > +
> > +MODULE_DEVICE_TABLE(of, ttc_timer_of_match);
> > +
> > +static struct platform_driver ttc_timer_driver = {
> > +	.driver = {
> > +		.name	= "cdns_ttc_timer",
> > +		.of_match_table = ttc_timer_of_match,
> > +	},
> > +};
> > +builtin_platform_driver_probe(ttc_timer_driver, ttc_timer_probe);
> > --
> > 2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] drivers: clocksource: Use ttc driver as platform driver
  2019-12-05 16:24     ` Daniel Lezcano
@ 2019-12-17 15:00       ` Michal Simek
  -1 siblings, 0 replies; 16+ messages in thread
From: Michal Simek @ 2019-12-17 15:00 UTC (permalink / raw)
  To: Daniel Lezcano, Rajan Vaja, tglx
  Cc: linux-arm-kernel, Jolly Shah, linux-kernel

On 05. 12. 19 17:24, Daniel Lezcano wrote:
> On 26/11/2019 12:53, Rajan Vaja wrote:
>> Request for review.
> 
> Waiting from Michal Simek review ...
> 
> 
>>> -----Original Message-----
>>> From: Rajan Vaja <rajan.vaja@xilinx.com>
>>> Sent: 07 November 2019 04:06 PM
>>> To: Michal Simek <michals@xilinx.com>; daniel.lezcano@linaro.org;
>>> tglx@linutronix.de
>>> Cc: linux-arm-kernel@lists.infradead.org; Jolly Shah <JOLLYS@xilinx.com>; linux-
>>> kernel@vger.kernel.org; Rajan Vaja <RAJANV@xilinx.com>
>>> Subject: [PATCH] drivers: clocksource: Use ttc driver as platform driver
>>>
>>> Currently TTC driver is TIMER_OF_DECLARE type driver. Because of
>>> that, TTC driver may be initialized before other clock drivers. If
>>> TTC driver is dependent on that clock driver then initialization of
>>> TTC driver will failed.
>>>
>>> So use TTC driver as platform driver instead of using
>>> TIMER_OF_DECLARE.
>>>
>>> Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
>>> ---
>>>  drivers/clocksource/timer-cadence-ttc.c | 26 ++++++++++++++++++--------
>>>  1 file changed, 18 insertions(+), 8 deletions(-)
>>>
>>> diff --git a/drivers/clocksource/timer-cadence-ttc.c b/drivers/clocksource/timer-
>>> cadence-ttc.c
>>> index 88fe2e9..38858e1 100644
>>> --- a/drivers/clocksource/timer-cadence-ttc.c
>>> +++ b/drivers/clocksource/timer-cadence-ttc.c
>>> @@ -15,6 +15,8 @@
>>>  #include <linux/of_irq.h>
>>>  #include <linux/slab.h>
>>>  #include <linux/sched_clock.h>
>>> +#include <linux/module.h>
>>> +#include <linux/of_platform.h>
>>>
>>>  /*
>>>   * This driver configures the 2 16/32-bit count-up timers as follows:
>>> @@ -464,13 +466,7 @@ static int __init ttc_setup_clockevent(struct clk *clk,
>>>  	return 0;
>>>  }
>>>
>>> -/**
>>> - * ttc_timer_init - Initialize the timer
>>> - *
>>> - * Initializes the timer hardware and register the clock source and clock event
>>> - * timers with Linux kernal timer framework
>>> - */
>>> -static int __init ttc_timer_init(struct device_node *timer)
>>> +static int __init ttc_timer_probe(struct platform_device *pdev)
>>>  {
>>>  	unsigned int irq;
>>>  	void __iomem *timer_baseaddr;
>>> @@ -478,6 +474,7 @@ static int __init ttc_timer_init(struct device_node *timer)
>>>  	static int initialized;
>>>  	int clksel, ret;
>>>  	u32 timer_width = 16;
>>> +	struct device_node *timer = pdev->dev.of_node;
>>>
>>>  	if (initialized)
>>>  		return 0;
>>> @@ -532,4 +529,17 @@ static int __init ttc_timer_init(struct device_node *timer)
>>>  	return 0;
>>>  }
>>>
>>> -TIMER_OF_DECLARE(ttc, "cdns,ttc", ttc_timer_init);
>>> +static const struct of_device_id ttc_timer_of_match[] = {
>>> +	{.compatible = "cdns,ttc"},
>>> +	{},
>>> +};
>>> +
>>> +MODULE_DEVICE_TABLE(of, ttc_timer_of_match);
>>> +
>>> +static struct platform_driver ttc_timer_driver = {
>>> +	.driver = {
>>> +		.name	= "cdns_ttc_timer",
>>> +		.of_match_table = ttc_timer_of_match,
>>> +	},
>>> +};
>>> +builtin_platform_driver_probe(ttc_timer_driver, ttc_timer_probe);
>>> --
>>> 2.7.4
>>

Looks good. I have also tested it on zc706.

Tested-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>

Note: headers are not sorted but they weren't even before this patch.

Thanks,
Michal



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

* Re: [PATCH] drivers: clocksource: Use ttc driver as platform driver
@ 2019-12-17 15:00       ` Michal Simek
  0 siblings, 0 replies; 16+ messages in thread
From: Michal Simek @ 2019-12-17 15:00 UTC (permalink / raw)
  To: Daniel Lezcano, Rajan Vaja, tglx
  Cc: Jolly Shah, linux-kernel, linux-arm-kernel

On 05. 12. 19 17:24, Daniel Lezcano wrote:
> On 26/11/2019 12:53, Rajan Vaja wrote:
>> Request for review.
> 
> Waiting from Michal Simek review ...
> 
> 
>>> -----Original Message-----
>>> From: Rajan Vaja <rajan.vaja@xilinx.com>
>>> Sent: 07 November 2019 04:06 PM
>>> To: Michal Simek <michals@xilinx.com>; daniel.lezcano@linaro.org;
>>> tglx@linutronix.de
>>> Cc: linux-arm-kernel@lists.infradead.org; Jolly Shah <JOLLYS@xilinx.com>; linux-
>>> kernel@vger.kernel.org; Rajan Vaja <RAJANV@xilinx.com>
>>> Subject: [PATCH] drivers: clocksource: Use ttc driver as platform driver
>>>
>>> Currently TTC driver is TIMER_OF_DECLARE type driver. Because of
>>> that, TTC driver may be initialized before other clock drivers. If
>>> TTC driver is dependent on that clock driver then initialization of
>>> TTC driver will failed.
>>>
>>> So use TTC driver as platform driver instead of using
>>> TIMER_OF_DECLARE.
>>>
>>> Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
>>> ---
>>>  drivers/clocksource/timer-cadence-ttc.c | 26 ++++++++++++++++++--------
>>>  1 file changed, 18 insertions(+), 8 deletions(-)
>>>
>>> diff --git a/drivers/clocksource/timer-cadence-ttc.c b/drivers/clocksource/timer-
>>> cadence-ttc.c
>>> index 88fe2e9..38858e1 100644
>>> --- a/drivers/clocksource/timer-cadence-ttc.c
>>> +++ b/drivers/clocksource/timer-cadence-ttc.c
>>> @@ -15,6 +15,8 @@
>>>  #include <linux/of_irq.h>
>>>  #include <linux/slab.h>
>>>  #include <linux/sched_clock.h>
>>> +#include <linux/module.h>
>>> +#include <linux/of_platform.h>
>>>
>>>  /*
>>>   * This driver configures the 2 16/32-bit count-up timers as follows:
>>> @@ -464,13 +466,7 @@ static int __init ttc_setup_clockevent(struct clk *clk,
>>>  	return 0;
>>>  }
>>>
>>> -/**
>>> - * ttc_timer_init - Initialize the timer
>>> - *
>>> - * Initializes the timer hardware and register the clock source and clock event
>>> - * timers with Linux kernal timer framework
>>> - */
>>> -static int __init ttc_timer_init(struct device_node *timer)
>>> +static int __init ttc_timer_probe(struct platform_device *pdev)
>>>  {
>>>  	unsigned int irq;
>>>  	void __iomem *timer_baseaddr;
>>> @@ -478,6 +474,7 @@ static int __init ttc_timer_init(struct device_node *timer)
>>>  	static int initialized;
>>>  	int clksel, ret;
>>>  	u32 timer_width = 16;
>>> +	struct device_node *timer = pdev->dev.of_node;
>>>
>>>  	if (initialized)
>>>  		return 0;
>>> @@ -532,4 +529,17 @@ static int __init ttc_timer_init(struct device_node *timer)
>>>  	return 0;
>>>  }
>>>
>>> -TIMER_OF_DECLARE(ttc, "cdns,ttc", ttc_timer_init);
>>> +static const struct of_device_id ttc_timer_of_match[] = {
>>> +	{.compatible = "cdns,ttc"},
>>> +	{},
>>> +};
>>> +
>>> +MODULE_DEVICE_TABLE(of, ttc_timer_of_match);
>>> +
>>> +static struct platform_driver ttc_timer_driver = {
>>> +	.driver = {
>>> +		.name	= "cdns_ttc_timer",
>>> +		.of_match_table = ttc_timer_of_match,
>>> +	},
>>> +};
>>> +builtin_platform_driver_probe(ttc_timer_driver, ttc_timer_probe);
>>> --
>>> 2.7.4
>>

Looks good. I have also tested it on zc706.

Tested-by: Michal Simek <michal.simek@xilinx.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>

Note: headers are not sorted but they weren't even before this patch.

Thanks,
Michal



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] drivers: clocksource: Use ttc driver as platform driver
  2019-11-26 11:53   ` Rajan Vaja
@ 2019-12-05 16:24     ` Daniel Lezcano
  -1 siblings, 0 replies; 16+ messages in thread
From: Daniel Lezcano @ 2019-12-05 16:24 UTC (permalink / raw)
  To: Rajan Vaja, Michal Simek, tglx; +Cc: linux-arm-kernel, Jolly Shah, linux-kernel

On 26/11/2019 12:53, Rajan Vaja wrote:
> Request for review.

Waiting from Michal Simek review ...


>> -----Original Message-----
>> From: Rajan Vaja <rajan.vaja@xilinx.com>
>> Sent: 07 November 2019 04:06 PM
>> To: Michal Simek <michals@xilinx.com>; daniel.lezcano@linaro.org;
>> tglx@linutronix.de
>> Cc: linux-arm-kernel@lists.infradead.org; Jolly Shah <JOLLYS@xilinx.com>; linux-
>> kernel@vger.kernel.org; Rajan Vaja <RAJANV@xilinx.com>
>> Subject: [PATCH] drivers: clocksource: Use ttc driver as platform driver
>>
>> Currently TTC driver is TIMER_OF_DECLARE type driver. Because of
>> that, TTC driver may be initialized before other clock drivers. If
>> TTC driver is dependent on that clock driver then initialization of
>> TTC driver will failed.
>>
>> So use TTC driver as platform driver instead of using
>> TIMER_OF_DECLARE.
>>
>> Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
>> ---
>>  drivers/clocksource/timer-cadence-ttc.c | 26 ++++++++++++++++++--------
>>  1 file changed, 18 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/clocksource/timer-cadence-ttc.c b/drivers/clocksource/timer-
>> cadence-ttc.c
>> index 88fe2e9..38858e1 100644
>> --- a/drivers/clocksource/timer-cadence-ttc.c
>> +++ b/drivers/clocksource/timer-cadence-ttc.c
>> @@ -15,6 +15,8 @@
>>  #include <linux/of_irq.h>
>>  #include <linux/slab.h>
>>  #include <linux/sched_clock.h>
>> +#include <linux/module.h>
>> +#include <linux/of_platform.h>
>>
>>  /*
>>   * This driver configures the 2 16/32-bit count-up timers as follows:
>> @@ -464,13 +466,7 @@ static int __init ttc_setup_clockevent(struct clk *clk,
>>  	return 0;
>>  }
>>
>> -/**
>> - * ttc_timer_init - Initialize the timer
>> - *
>> - * Initializes the timer hardware and register the clock source and clock event
>> - * timers with Linux kernal timer framework
>> - */
>> -static int __init ttc_timer_init(struct device_node *timer)
>> +static int __init ttc_timer_probe(struct platform_device *pdev)
>>  {
>>  	unsigned int irq;
>>  	void __iomem *timer_baseaddr;
>> @@ -478,6 +474,7 @@ static int __init ttc_timer_init(struct device_node *timer)
>>  	static int initialized;
>>  	int clksel, ret;
>>  	u32 timer_width = 16;
>> +	struct device_node *timer = pdev->dev.of_node;
>>
>>  	if (initialized)
>>  		return 0;
>> @@ -532,4 +529,17 @@ static int __init ttc_timer_init(struct device_node *timer)
>>  	return 0;
>>  }
>>
>> -TIMER_OF_DECLARE(ttc, "cdns,ttc", ttc_timer_init);
>> +static const struct of_device_id ttc_timer_of_match[] = {
>> +	{.compatible = "cdns,ttc"},
>> +	{},
>> +};
>> +
>> +MODULE_DEVICE_TABLE(of, ttc_timer_of_match);
>> +
>> +static struct platform_driver ttc_timer_driver = {
>> +	.driver = {
>> +		.name	= "cdns_ttc_timer",
>> +		.of_match_table = ttc_timer_of_match,
>> +	},
>> +};
>> +builtin_platform_driver_probe(ttc_timer_driver, ttc_timer_probe);
>> --
>> 2.7.4
> 


-- 
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


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

* Re: [PATCH] drivers: clocksource: Use ttc driver as platform driver
@ 2019-12-05 16:24     ` Daniel Lezcano
  0 siblings, 0 replies; 16+ messages in thread
From: Daniel Lezcano @ 2019-12-05 16:24 UTC (permalink / raw)
  To: Rajan Vaja, Michal Simek, tglx; +Cc: Jolly Shah, linux-kernel, linux-arm-kernel

On 26/11/2019 12:53, Rajan Vaja wrote:
> Request for review.

Waiting from Michal Simek review ...


>> -----Original Message-----
>> From: Rajan Vaja <rajan.vaja@xilinx.com>
>> Sent: 07 November 2019 04:06 PM
>> To: Michal Simek <michals@xilinx.com>; daniel.lezcano@linaro.org;
>> tglx@linutronix.de
>> Cc: linux-arm-kernel@lists.infradead.org; Jolly Shah <JOLLYS@xilinx.com>; linux-
>> kernel@vger.kernel.org; Rajan Vaja <RAJANV@xilinx.com>
>> Subject: [PATCH] drivers: clocksource: Use ttc driver as platform driver
>>
>> Currently TTC driver is TIMER_OF_DECLARE type driver. Because of
>> that, TTC driver may be initialized before other clock drivers. If
>> TTC driver is dependent on that clock driver then initialization of
>> TTC driver will failed.
>>
>> So use TTC driver as platform driver instead of using
>> TIMER_OF_DECLARE.
>>
>> Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
>> ---
>>  drivers/clocksource/timer-cadence-ttc.c | 26 ++++++++++++++++++--------
>>  1 file changed, 18 insertions(+), 8 deletions(-)
>>
>> diff --git a/drivers/clocksource/timer-cadence-ttc.c b/drivers/clocksource/timer-
>> cadence-ttc.c
>> index 88fe2e9..38858e1 100644
>> --- a/drivers/clocksource/timer-cadence-ttc.c
>> +++ b/drivers/clocksource/timer-cadence-ttc.c
>> @@ -15,6 +15,8 @@
>>  #include <linux/of_irq.h>
>>  #include <linux/slab.h>
>>  #include <linux/sched_clock.h>
>> +#include <linux/module.h>
>> +#include <linux/of_platform.h>
>>
>>  /*
>>   * This driver configures the 2 16/32-bit count-up timers as follows:
>> @@ -464,13 +466,7 @@ static int __init ttc_setup_clockevent(struct clk *clk,
>>  	return 0;
>>  }
>>
>> -/**
>> - * ttc_timer_init - Initialize the timer
>> - *
>> - * Initializes the timer hardware and register the clock source and clock event
>> - * timers with Linux kernal timer framework
>> - */
>> -static int __init ttc_timer_init(struct device_node *timer)
>> +static int __init ttc_timer_probe(struct platform_device *pdev)
>>  {
>>  	unsigned int irq;
>>  	void __iomem *timer_baseaddr;
>> @@ -478,6 +474,7 @@ static int __init ttc_timer_init(struct device_node *timer)
>>  	static int initialized;
>>  	int clksel, ret;
>>  	u32 timer_width = 16;
>> +	struct device_node *timer = pdev->dev.of_node;
>>
>>  	if (initialized)
>>  		return 0;
>> @@ -532,4 +529,17 @@ static int __init ttc_timer_init(struct device_node *timer)
>>  	return 0;
>>  }
>>
>> -TIMER_OF_DECLARE(ttc, "cdns,ttc", ttc_timer_init);
>> +static const struct of_device_id ttc_timer_of_match[] = {
>> +	{.compatible = "cdns,ttc"},
>> +	{},
>> +};
>> +
>> +MODULE_DEVICE_TABLE(of, ttc_timer_of_match);
>> +
>> +static struct platform_driver ttc_timer_driver = {
>> +	.driver = {
>> +		.name	= "cdns_ttc_timer",
>> +		.of_match_table = ttc_timer_of_match,
>> +	},
>> +};
>> +builtin_platform_driver_probe(ttc_timer_driver, ttc_timer_probe);
>> --
>> 2.7.4
> 


-- 
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* RE: [PATCH] drivers: clocksource: Use ttc driver as platform driver
  2019-11-07 10:36 ` Rajan Vaja
@ 2019-11-26 11:53   ` Rajan Vaja
  -1 siblings, 0 replies; 16+ messages in thread
From: Rajan Vaja @ 2019-11-26 11:53 UTC (permalink / raw)
  To: Rajan Vaja, Michal Simek, daniel.lezcano, tglx
  Cc: linux-arm-kernel, Jolly Shah, linux-kernel

Request for review.

Thanks,
Rajan

> -----Original Message-----
> From: Rajan Vaja <rajan.vaja@xilinx.com>
> Sent: 07 November 2019 04:06 PM
> To: Michal Simek <michals@xilinx.com>; daniel.lezcano@linaro.org;
> tglx@linutronix.de
> Cc: linux-arm-kernel@lists.infradead.org; Jolly Shah <JOLLYS@xilinx.com>; linux-
> kernel@vger.kernel.org; Rajan Vaja <RAJANV@xilinx.com>
> Subject: [PATCH] drivers: clocksource: Use ttc driver as platform driver
> 
> Currently TTC driver is TIMER_OF_DECLARE type driver. Because of
> that, TTC driver may be initialized before other clock drivers. If
> TTC driver is dependent on that clock driver then initialization of
> TTC driver will failed.
> 
> So use TTC driver as platform driver instead of using
> TIMER_OF_DECLARE.
> 
> Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
> ---
>  drivers/clocksource/timer-cadence-ttc.c | 26 ++++++++++++++++++--------
>  1 file changed, 18 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/clocksource/timer-cadence-ttc.c b/drivers/clocksource/timer-
> cadence-ttc.c
> index 88fe2e9..38858e1 100644
> --- a/drivers/clocksource/timer-cadence-ttc.c
> +++ b/drivers/clocksource/timer-cadence-ttc.c
> @@ -15,6 +15,8 @@
>  #include <linux/of_irq.h>
>  #include <linux/slab.h>
>  #include <linux/sched_clock.h>
> +#include <linux/module.h>
> +#include <linux/of_platform.h>
> 
>  /*
>   * This driver configures the 2 16/32-bit count-up timers as follows:
> @@ -464,13 +466,7 @@ static int __init ttc_setup_clockevent(struct clk *clk,
>  	return 0;
>  }
> 
> -/**
> - * ttc_timer_init - Initialize the timer
> - *
> - * Initializes the timer hardware and register the clock source and clock event
> - * timers with Linux kernal timer framework
> - */
> -static int __init ttc_timer_init(struct device_node *timer)
> +static int __init ttc_timer_probe(struct platform_device *pdev)
>  {
>  	unsigned int irq;
>  	void __iomem *timer_baseaddr;
> @@ -478,6 +474,7 @@ static int __init ttc_timer_init(struct device_node *timer)
>  	static int initialized;
>  	int clksel, ret;
>  	u32 timer_width = 16;
> +	struct device_node *timer = pdev->dev.of_node;
> 
>  	if (initialized)
>  		return 0;
> @@ -532,4 +529,17 @@ static int __init ttc_timer_init(struct device_node *timer)
>  	return 0;
>  }
> 
> -TIMER_OF_DECLARE(ttc, "cdns,ttc", ttc_timer_init);
> +static const struct of_device_id ttc_timer_of_match[] = {
> +	{.compatible = "cdns,ttc"},
> +	{},
> +};
> +
> +MODULE_DEVICE_TABLE(of, ttc_timer_of_match);
> +
> +static struct platform_driver ttc_timer_driver = {
> +	.driver = {
> +		.name	= "cdns_ttc_timer",
> +		.of_match_table = ttc_timer_of_match,
> +	},
> +};
> +builtin_platform_driver_probe(ttc_timer_driver, ttc_timer_probe);
> --
> 2.7.4


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

* RE: [PATCH] drivers: clocksource: Use ttc driver as platform driver
@ 2019-11-26 11:53   ` Rajan Vaja
  0 siblings, 0 replies; 16+ messages in thread
From: Rajan Vaja @ 2019-11-26 11:53 UTC (permalink / raw)
  To: Rajan Vaja, Michal Simek, daniel.lezcano, tglx
  Cc: Jolly Shah, linux-kernel, linux-arm-kernel

Request for review.

Thanks,
Rajan

> -----Original Message-----
> From: Rajan Vaja <rajan.vaja@xilinx.com>
> Sent: 07 November 2019 04:06 PM
> To: Michal Simek <michals@xilinx.com>; daniel.lezcano@linaro.org;
> tglx@linutronix.de
> Cc: linux-arm-kernel@lists.infradead.org; Jolly Shah <JOLLYS@xilinx.com>; linux-
> kernel@vger.kernel.org; Rajan Vaja <RAJANV@xilinx.com>
> Subject: [PATCH] drivers: clocksource: Use ttc driver as platform driver
> 
> Currently TTC driver is TIMER_OF_DECLARE type driver. Because of
> that, TTC driver may be initialized before other clock drivers. If
> TTC driver is dependent on that clock driver then initialization of
> TTC driver will failed.
> 
> So use TTC driver as platform driver instead of using
> TIMER_OF_DECLARE.
> 
> Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
> ---
>  drivers/clocksource/timer-cadence-ttc.c | 26 ++++++++++++++++++--------
>  1 file changed, 18 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/clocksource/timer-cadence-ttc.c b/drivers/clocksource/timer-
> cadence-ttc.c
> index 88fe2e9..38858e1 100644
> --- a/drivers/clocksource/timer-cadence-ttc.c
> +++ b/drivers/clocksource/timer-cadence-ttc.c
> @@ -15,6 +15,8 @@
>  #include <linux/of_irq.h>
>  #include <linux/slab.h>
>  #include <linux/sched_clock.h>
> +#include <linux/module.h>
> +#include <linux/of_platform.h>
> 
>  /*
>   * This driver configures the 2 16/32-bit count-up timers as follows:
> @@ -464,13 +466,7 @@ static int __init ttc_setup_clockevent(struct clk *clk,
>  	return 0;
>  }
> 
> -/**
> - * ttc_timer_init - Initialize the timer
> - *
> - * Initializes the timer hardware and register the clock source and clock event
> - * timers with Linux kernal timer framework
> - */
> -static int __init ttc_timer_init(struct device_node *timer)
> +static int __init ttc_timer_probe(struct platform_device *pdev)
>  {
>  	unsigned int irq;
>  	void __iomem *timer_baseaddr;
> @@ -478,6 +474,7 @@ static int __init ttc_timer_init(struct device_node *timer)
>  	static int initialized;
>  	int clksel, ret;
>  	u32 timer_width = 16;
> +	struct device_node *timer = pdev->dev.of_node;
> 
>  	if (initialized)
>  		return 0;
> @@ -532,4 +529,17 @@ static int __init ttc_timer_init(struct device_node *timer)
>  	return 0;
>  }
> 
> -TIMER_OF_DECLARE(ttc, "cdns,ttc", ttc_timer_init);
> +static const struct of_device_id ttc_timer_of_match[] = {
> +	{.compatible = "cdns,ttc"},
> +	{},
> +};
> +
> +MODULE_DEVICE_TABLE(of, ttc_timer_of_match);
> +
> +static struct platform_driver ttc_timer_driver = {
> +	.driver = {
> +		.name	= "cdns_ttc_timer",
> +		.of_match_table = ttc_timer_of_match,
> +	},
> +};
> +builtin_platform_driver_probe(ttc_timer_driver, ttc_timer_probe);
> --
> 2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH] drivers: clocksource: Use ttc driver as platform driver
@ 2019-11-07 10:36 ` Rajan Vaja
  0 siblings, 0 replies; 16+ messages in thread
From: Rajan Vaja @ 2019-11-07 10:36 UTC (permalink / raw)
  To: michal.simek, daniel.lezcano, tglx
  Cc: linux-arm-kernel, JOLLYS, linux-kernel, Rajan Vaja

Currently TTC driver is TIMER_OF_DECLARE type driver. Because of
that, TTC driver may be initialized before other clock drivers. If
TTC driver is dependent on that clock driver then initialization of
TTC driver will failed.

So use TTC driver as platform driver instead of using
TIMER_OF_DECLARE.

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
---
 drivers/clocksource/timer-cadence-ttc.c | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/drivers/clocksource/timer-cadence-ttc.c b/drivers/clocksource/timer-cadence-ttc.c
index 88fe2e9..38858e1 100644
--- a/drivers/clocksource/timer-cadence-ttc.c
+++ b/drivers/clocksource/timer-cadence-ttc.c
@@ -15,6 +15,8 @@
 #include <linux/of_irq.h>
 #include <linux/slab.h>
 #include <linux/sched_clock.h>
+#include <linux/module.h>
+#include <linux/of_platform.h>
 
 /*
  * This driver configures the 2 16/32-bit count-up timers as follows:
@@ -464,13 +466,7 @@ static int __init ttc_setup_clockevent(struct clk *clk,
 	return 0;
 }
 
-/**
- * ttc_timer_init - Initialize the timer
- *
- * Initializes the timer hardware and register the clock source and clock event
- * timers with Linux kernal timer framework
- */
-static int __init ttc_timer_init(struct device_node *timer)
+static int __init ttc_timer_probe(struct platform_device *pdev)
 {
 	unsigned int irq;
 	void __iomem *timer_baseaddr;
@@ -478,6 +474,7 @@ static int __init ttc_timer_init(struct device_node *timer)
 	static int initialized;
 	int clksel, ret;
 	u32 timer_width = 16;
+	struct device_node *timer = pdev->dev.of_node;
 
 	if (initialized)
 		return 0;
@@ -532,4 +529,17 @@ static int __init ttc_timer_init(struct device_node *timer)
 	return 0;
 }
 
-TIMER_OF_DECLARE(ttc, "cdns,ttc", ttc_timer_init);
+static const struct of_device_id ttc_timer_of_match[] = {
+	{.compatible = "cdns,ttc"},
+	{},
+};
+
+MODULE_DEVICE_TABLE(of, ttc_timer_of_match);
+
+static struct platform_driver ttc_timer_driver = {
+	.driver = {
+		.name	= "cdns_ttc_timer",
+		.of_match_table = ttc_timer_of_match,
+	},
+};
+builtin_platform_driver_probe(ttc_timer_driver, ttc_timer_probe);
-- 
2.7.4


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

* [PATCH] drivers: clocksource: Use ttc driver as platform driver
@ 2019-11-07 10:36 ` Rajan Vaja
  0 siblings, 0 replies; 16+ messages in thread
From: Rajan Vaja @ 2019-11-07 10:36 UTC (permalink / raw)
  To: michal.simek, daniel.lezcano, tglx
  Cc: JOLLYS, Rajan Vaja, linux-kernel, linux-arm-kernel

Currently TTC driver is TIMER_OF_DECLARE type driver. Because of
that, TTC driver may be initialized before other clock drivers. If
TTC driver is dependent on that clock driver then initialization of
TTC driver will failed.

So use TTC driver as platform driver instead of using
TIMER_OF_DECLARE.

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
---
 drivers/clocksource/timer-cadence-ttc.c | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/drivers/clocksource/timer-cadence-ttc.c b/drivers/clocksource/timer-cadence-ttc.c
index 88fe2e9..38858e1 100644
--- a/drivers/clocksource/timer-cadence-ttc.c
+++ b/drivers/clocksource/timer-cadence-ttc.c
@@ -15,6 +15,8 @@
 #include <linux/of_irq.h>
 #include <linux/slab.h>
 #include <linux/sched_clock.h>
+#include <linux/module.h>
+#include <linux/of_platform.h>
 
 /*
  * This driver configures the 2 16/32-bit count-up timers as follows:
@@ -464,13 +466,7 @@ static int __init ttc_setup_clockevent(struct clk *clk,
 	return 0;
 }
 
-/**
- * ttc_timer_init - Initialize the timer
- *
- * Initializes the timer hardware and register the clock source and clock event
- * timers with Linux kernal timer framework
- */
-static int __init ttc_timer_init(struct device_node *timer)
+static int __init ttc_timer_probe(struct platform_device *pdev)
 {
 	unsigned int irq;
 	void __iomem *timer_baseaddr;
@@ -478,6 +474,7 @@ static int __init ttc_timer_init(struct device_node *timer)
 	static int initialized;
 	int clksel, ret;
 	u32 timer_width = 16;
+	struct device_node *timer = pdev->dev.of_node;
 
 	if (initialized)
 		return 0;
@@ -532,4 +529,17 @@ static int __init ttc_timer_init(struct device_node *timer)
 	return 0;
 }
 
-TIMER_OF_DECLARE(ttc, "cdns,ttc", ttc_timer_init);
+static const struct of_device_id ttc_timer_of_match[] = {
+	{.compatible = "cdns,ttc"},
+	{},
+};
+
+MODULE_DEVICE_TABLE(of, ttc_timer_of_match);
+
+static struct platform_driver ttc_timer_driver = {
+	.driver = {
+		.name	= "cdns_ttc_timer",
+		.of_match_table = ttc_timer_of_match,
+	},
+};
+builtin_platform_driver_probe(ttc_timer_driver, ttc_timer_probe);
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2019-12-17 15:00 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-07 10:30 [PATCH] drivers: clocksource: Use ttc driver as platform driver Rajan Vaja
2019-11-07 10:30 ` Rajan Vaja
2019-11-07 10:34 ` Rajan Vaja
2019-11-07 10:34   ` Rajan Vaja
2019-11-26 11:35 ` Rajan Vaja
2019-11-26 11:35   ` Rajan Vaja
2019-11-26 11:56   ` Rajan Vaja
2019-11-26 11:56     ` Rajan Vaja
2019-11-07 10:36 Rajan Vaja
2019-11-07 10:36 ` Rajan Vaja
2019-11-26 11:53 ` Rajan Vaja
2019-11-26 11:53   ` Rajan Vaja
2019-12-05 16:24   ` Daniel Lezcano
2019-12-05 16:24     ` Daniel Lezcano
2019-12-17 15:00     ` Michal Simek
2019-12-17 15:00       ` Michal Simek

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.