Re: [RFC PATCH 0/3] pwm: omap: Add PWM support using dual-mode timers

2015-10-18 Thread Neil Brown
Neil Armstrong  writes:

> This patch is based on an earlier patch by NeilBrown which is based on
> a older patch from Grant Erickson which provided PWM devices using
> the 'legacy' interface.
>
> The pwm driver was renamed to not be confused with the OMAP4 PWM dedicated
> hardware and was cleaned with the review from Thierry Reding.
>
> The first patch introduces a way to select to dmtimer clock source via a
> clocks binding and a dedicated function wit the legacy fallback.
>
> In order to prepare for the future form of the dmtimer (clksource or whatever)
> the first patch introduces the PWM driver with all the dmtimer calls into a
> platform data structure.
>
> The structure is then filled in plat-omap and added as auxdata for the
> ti,pwm-dmtimer-omap compatible nodes.
>
> Cc: Grant Erickson 
> Cc: NeilBrown 
> Cc: Joachim Eastwood 
> Suggested-by: Tony Lindgren 
>
> Neil Armstrong (3):
>   arm: plat-omap: dmtimer: Add clock source from DT
>   pwm: Add PWM driver for OMAP using dual-mode timers
>   arm: plat-omap: Add PWM dmtimer platforma data quirks
>
>  .../devicetree/bindings/pwm/pwm-omap-dmtimer.txt   |  18 ++
>  arch/arm/mach-omap2/pdata-quirks.c |  23 ++
>  arch/arm/plat-omap/dmtimer.c   |  32 +-
>  drivers/pwm/Kconfig|   9 +
>  drivers/pwm/Makefile   |   1 +
>  drivers/pwm/pwm-omap-dmtimer.c | 322 
> +
>  include/linux/platform_data/pwm_omap_dmtimer.h |  69 +
>  7 files changed, 472 insertions(+), 2 deletions(-)
>  create mode 100644 Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
>  create mode 100644 drivers/pwm/pwm-omap-dmtimer.c
>  create mode 100644 include/linux/platform_data/pwm_omap_dmtimer.h
>

Thanks for much for doing this!
I haven't looked and wont have a chance for a least a couple of weeks,
but I'm very encouraged that someone is pursuing it.

Thanks,
NeilBrown


signature.asc
Description: PGP signature


Re: [PATCH v3] ARM: OMAP: Change all cpu_is_* occurences to soc_is_*

2015-10-18 Thread Keerthy

Hi Tony,

On Friday 16 October 2015 11:18 PM, Tony Lindgren wrote:

Hi,

* Keerthy  [151013 22:47]:

--- a/arch/arm/mach-omap2/soc.h
+++ b/arch/arm/mach-omap2/soc.h
@@ -155,6 +155,13 @@ static inline int soc_is_omap(void)
   * cpu_is_omap443x(): True for OMAP4430
   * cpu_is_omap446x(): True for OMAP4460
   * cpu_is_omap447x(): True for OMAP4470
+ * soc_is_omap24xx():  True for OMAP2420, OMAP2422, OMAP2423, OMAP2430
+ * soc_is_omap242x():  True for OMAP2420, OMAP2422, OMAP2423
+ * soc_is_omap243x():  True for OMAP2430
+ * soc_is_omap343x():  True for OMAP3430
+ * soc_is_omap443x():  True for OMAP4430
+ * soc_is_omap446x():  True for OMAP4460
+ * soc_is_omap447x():  True for OMAP4470
   * soc_is_omap543x(): True for OMAP5430, OMAP5432
   */
  #define GET_OMAP_CLASS(omap_rev() & 0xff)


We don't want cpu_is stuff mixed into soc.h at all..


@@ -227,12 +234,24 @@ IS_AM_SUBCLASS(437x, 0x437)

  #define cpu_is_omap24xx() 0
  #define cpu_is_omap242x() 0
+#define cpu_is_omap2420()   0
  #define cpu_is_omap243x() 0
+#define cpu_is_omap2430()   0
  #define cpu_is_omap34xx() 0
  #define cpu_is_omap343x() 0
+#define cpu_is_omap3430()  0
+#define cpu_is_omap3630()  0
  #define cpu_is_ti81xx()   0
  #define cpu_is_ti816x()   0
  #define cpu_is_ti814x()   0
+#define soc_is_omap24xx()  0
+#define soc_is_omap242x()  0
+#define soc_is_omap243x()  0
+#define soc_is_omap34xx()  0
+#define soc_is_omap343x()  0
+#define soc_is_ti81xx()0
+#define soc_is_ti816x()0
+#define soc_is_ti814x()0
  #define soc_is_am35xx()   0
  #define soc_is_am33xx()   0
  #define soc_is_am335x()   0


Here too..


@@ -250,54 +273,74 @@ IS_AM_SUBCLASS(437x, 0x437)

  #if defined(MULTI_OMAP2)
  # if defined(CONFIG_ARCH_OMAP2)
+#  undef  soc_is_omap24xx
+#  define soc_is_omap24xx()is_omap24xx()
  #  undef  cpu_is_omap24xx
-#  define cpu_is_omap24xx()is_omap24xx()
+#  define cpu_is_omap24xx  soc_is_omap24xx
  # endif
  # if defined (CONFIG_SOC_OMAP2420)
+#  undef  soc_is_omap242x
+#  define soc_is_omap242x()is_omap242x()
  #  undef  cpu_is_omap242x
-#  define cpu_is_omap242x()is_omap242x()
+#  define cpu_is_omap242x  soc_is_omap242x
  # endif
  # if defined (CONFIG_SOC_OMAP2430)
+#  undef  soc_is_omap243x
+#  define soc_is_omap243x()is_omap243x()
  #  undef  cpu_is_omap243x
-#  define cpu_is_omap243x()is_omap243x()
+#  define cpu_is_omap243x  soc_is_omap243x
  # endif

...

And so on. And these changes should be kept to minimum, so..

I decided to redo the soc.h changes first with minimal search and replace
to cut down on any chance of errors. And then just added the legacy defines
for cpu_is at the end of the file for the ones that are still in use.

After some testing I'll apply just your id.c related changes on top of
the patch below :)

Regards,

Tony

8< ---
From: Tony Lindgren 
Date: Fri, 16 Oct 2015 10:08:45 -0700
Subject: [PATCH] ARM: OMAP2+: Rename cpu_is macros to soc_is

The naming for the cpu_is macros is confusing as the CPU is separate
and within the SoC. Let's rename all the macros to soc_is, and let's
define cpu_is also for the ones still in use. Then we can just remove
the cpu_is macros once the users are fixed up.

To keep the chances of breaking anything, the changes were
generated with the following regular expressions:

s/cpu_is/soc_is/g
s/CPU/SoC/g

Then the list of existing cpu_is users was generated with:

$ $ grep -o -e 'cpu_is_.\+()' arch/arm/mach-omap2/*.[chS] | \
cut -d: -f2 | sort | uniq

And added to the end of the soc.h.

I decided to rework the earlier patches by Keerthy 
to keep changes down to minimum to avoid potential errors and stick
to just search and replace.



Compile tested individual SoC Configs and boot tested on: AM437x-gp-evm,
am335x-bone, dra72-evm and dra7-evm.

Tested-by: Keerthy 


Signed-off-by: Tony Lindgren 

--- a/arch/arm/mach-omap2/soc.h
+++ b/arch/arm/mach-omap2/soc.h
@@ -129,9 +129,9 @@ int omap_type(void);

  /*
   * omap_rev bits:
- * CPU id bits (0730, 1510, 1710, 2422...) [31:16]
- * CPU revision(See _REV_ defined in cpu.h)[15:08]
- * CPU class bits (15xx, 16xx, 24xx, 34xx...)  [07:00]
+ * SoC id bits (0730, 1510, 1710, 2422...) [31:16]
+ * SoC revision(See _REV_ defined in cpu.h)[15:08]
+ * SoC class bits (15xx, 16xx, 24xx, 34xx...)  [07:00]
   */
  unsigned int omap_rev(void);

@@ -141,20 +141,20 @@ static inline int soc_is_omap(void)
  }

  /*
- * Get the CPU revision for OMAP