linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/36] ARM: samsung platform cleanup
@ 2019-10-10 20:28 Arnd Bergmann
       [not found] ` <20191010203043.1241612-1-arnd@arndb.de>
  2019-10-23 13:10 ` [PATCH 00/36] ARM: samsung platform cleanup Krzysztof Kozlowski
  0 siblings, 2 replies; 22+ messages in thread
From: Arnd Bergmann @ 2019-10-10 20:28 UTC (permalink / raw)
  To: Kukjin Kim, Krzysztof Kozlowski
  Cc: linux-samsung-soc, linux-arm-kernel, Arnd Bergmann, linux-kernel,
	linux-pm, patches, linux-stm32, linux-clk, linux-hwmon,
	linux-input, linux-leds, linux-mmc, linux-pwm, linux-spi,
	linux-serial, linux-usb, dri-devel, linux-fbdev, alsa-devel

I've spent some time looking at the remaining ARMv4/ARMv5 platforms
that are not part of ARCH_MULTIPLATFORM, and tried to get them closer
to that. Here is what came out of that for the samsung platforms:

* Exynos and s5pv210 are made independent of plat-samsung
* device drivers stop using mach/*.h headers for s3c24xx
  (and other platforms not in this series)
* s3c24xx and s3c64xx get merged into mach-s3c, removing
  the need for plat-samsung (I have other patches for the
  remaining plat-* directories)
* mach/io.h gets cleaned up to only be needed for BAST
  PC104 mode (looking for ideas to proceed)
* mach/irqs.h remains for now, this still needs to be converted
  to sparse IRQs.

Some bits are a little ugly, but overall I think this a big
improvement.

The contents are available for testing in

git://kernel.org:/pub/scm/linux/kernel/git/arnd/playground.git s3c-multiplatform

Given the overall size of the series I expect that there will
be bugs, so at this points I'm looking for reviews, acks and
testing from anyone who still has the hardware, in particular
s3c24xx, but also the other samsung platforms I'm touching.

      Arnd

Arnd Bergmann (36):
  ARM: samsung: make S3C24XX_MISCCR access indirect
  ARM: s3c: simplify mach/io.h
  usb: gadget: s3c: use platform resources
  usb: gadget: s3c-hsudc: remove platform header dependency
  ARM: samsung: make pm-debug platform independent
  ARM: samsung: move CONFIG_DEBUG_S3C_UART to Kconfig.debug
  ARM: exynos: use private samsung_cpu_id copy
  ARM: exynos: stop selecting PLAT_SAMSUNG
  ARM: samsung: move pm check code to drivers/soc
  ARM: s5pv210: use private pm save/restore
  ARM: s5pv210: split from plat-samsung
  ARM: s3c64xx: remove mach/hardware.h
  ARM: s3c: move regs-spi.h into spi driver
  ARM: s3c: move irqchip driver back into platform
  ARM: s3c: adc: move header to linux/soc/samsung
  ARM: s3c: move spi fiq handler into platform
  ARM: s3c: h1940-audio: turn into platform driver
  ARM: s3c: gta02-audio: turn into platform driver
  ARM: s3c: rx1950: turn into platform driver
  ASoC: samsung: s3c2412-i2s: avoid hardcoded S3C2410_PA_IIS
  ARM: s3c: move iis pinctrl config into boards
  ARM: s3c: leds: move setpull() calls into board files
  ARM: s3c: move s3cmci pinctrl handling into board files
  ARM: s3c: include mach/irqs.h where needed
  ARM: s3c: spi: avoid hardcoding fiq number in driver
  ARM: s3c: bast: avoid irq_desc array usage
  ARM: s3c: fix mmc gpio lookup tables
  fbdev: s3c2410fb: remove mach header dependency
  ARM: s3c: cpufreq: split out registers
  ARM: s3c: remove cpufreq header dependencies
  ARM: s3c: cpufreq: use global s3c2412_cpufreq_setrefresh
  ARM: s3c: iotiming: make functions static
  ARM: s3c: move low-level clk reg access into platform code
  ARM: s3c: stop including mach/hardware.h from mach/io.h
  ARM: s3c: move into a common directory
  ARM: s3c: make headers local if possible

 MAINTAINERS                                   |  16 +-
 arch/arm/Kconfig                              |   5 +-
 arch/arm/Kconfig.debug                        |  18 +-
 arch/arm/Makefile                             |   7 +-
 arch/arm/mach-exynos/Makefile                 |   4 -
 arch/arm/mach-exynos/common.h                 |   6 +-
 arch/arm/mach-exynos/exynos.c                 |  19 +-
 arch/arm/mach-exynos/include/mach/map.h       |  18 --
 arch/arm/mach-exynos/platsmp.c                |   4 +-
 arch/arm/mach-exynos/pm.c                     |   8 +-
 arch/arm/{plat-samsung => mach-s3c}/Kconfig   |  62 +----
 .../Kconfig => mach-s3c/Kconfig.s3c24xx}      |   0
 .../Kconfig => mach-s3c/Kconfig.s3c64xx}      |   0
 arch/arm/{plat-samsung => mach-s3c}/Makefile  |  15 +-
 .../{mach-s3c24xx => mach-s3c}/Makefile.boot  |   0
 .../Makefile => mach-s3c/Makefile.s3c24xx}    |  15 +-
 .../Makefile => mach-s3c/Makefile.s3c64xx}    |  14 +-
 .../include/plat => mach-s3c}/adc-core.h      |   0
 arch/arm/{plat-samsung => mach-s3c}/adc.c     |   4 +-
 arch/arm/{mach-s3c24xx => mach-s3c}/anubis.h  |   0
 .../arm/{mach-s3c64xx => mach-s3c}/ata-core.h |   0
 .../{mach-s3c64xx => mach-s3c}/backlight.h    |   0
 .../arm/{mach-s3c24xx => mach-s3c}/bast-ide.c |   3 +-
 .../arm/{mach-s3c24xx => mach-s3c}/bast-irq.c |   8 +-
 arch/arm/{mach-s3c24xx => mach-s3c}/bast.h    |   0
 .../{mach-s3c24xx => mach-s3c}/common-smdk.c  |  17 +-
 .../{mach-s3c24xx => mach-s3c}/common-smdk.h  |   0
 arch/arm/{plat-samsung => mach-s3c}/cpu.c     |  21 +-
 .../include/plat => mach-s3c}/cpu.h           |  11 -
 .../cpufreq-utils.c                           |  38 +++-
 arch/arm/{mach-s3c64xx => mach-s3c}/cpuidle.c |   4 +-
 .../arm/{mach-s3c64xx => mach-s3c}/crag6410.h |   2 +-
 .../{mach-s3c64xx => mach-s3c}/dev-audio.c    |   9 +-
 .../dev-backlight.c                           |   4 +-
 .../dev-uart-s3c64xx.c}                       |   5 +-
 .../arm/{plat-samsung => mach-s3c}/dev-uart.c |   2 +-
 arch/arm/{plat-samsung => mach-s3c}/devs.c    |  56 +++--
 .../include/plat => mach-s3c}/devs.h          |   0
 .../mach/dma.h => mach-s3c/dma-s3c24xx.h}     |   0
 .../mach/dma.h => mach-s3c/dma-s3c64xx.h}     |   0
 arch/arm/mach-s3c/dma.h                       |   7 +
 arch/arm/{mach-s3c24xx => mach-s3c}/fb-core.h |   0
 .../include/plat => mach-s3c}/fb.h            |   0
 .../plat => mach-s3c}/gpio-cfg-helpers.h      |   0
 .../include/plat => mach-s3c}/gpio-cfg.h      |   0
 .../include/plat => mach-s3c}/gpio-core.h     |   2 +-
 .../gpio-samsung-s3c24xx.h}                   |   2 +
 .../gpio-samsung-s3c64xx.h}                   |   0
 .../{plat-samsung => mach-s3c}/gpio-samsung.c |  18 +-
 arch/arm/mach-s3c/gpio-samsung.h              |   7 +
 arch/arm/{mach-s3c24xx => mach-s3c}/gta02.h   |   2 +-
 .../h1940-bluetooth.c                         |   7 +-
 arch/arm/{mach-s3c24xx => mach-s3c}/h1940.h   |   0
 .../include/mach => mach-s3c}/hardware.h      |   7 -
 .../include/plat => mach-s3c}/iic-core.h      |   0
 arch/arm/mach-s3c/include/mach/io.h           |  50 +++++
 .../include/mach/irqs-s3c24xx.h}              |   0
 .../include/mach/irqs-s3c64xx.h}              |   0
 arch/arm/mach-s3c/include/mach/irqs.h         |   7 +
 .../plat => mach-s3c/include/mach}/map-base.h |   0
 arch/arm/{plat-samsung => mach-s3c}/init.c    |   4 +-
 .../iotiming-s3c2410.c                        |  12 +-
 .../iotiming-s3c2412.c                        |   6 +-
 .../irq-pm.c => mach-s3c/irq-pm-s3c24xx.c}    |  16 +-
 .../irq-pm.c => mach-s3c/irq-pm-s3c64xx.c}    |   8 +-
 arch/arm/mach-s3c/irq-s3c24xx-fiq-exports.c   |   9 +
 .../arm/mach-s3c/irq-s3c24xx-fiq.S            |  10 +-
 .../arm/mach-s3c}/irq-s3c24xx.c               |  23 +-
 .../arm/{mach-s3c64xx => mach-s3c}/irq-uart.h |   0
 .../include/plat => mach-s3c}/keypad.h        |   0
 .../mach-amlm5900.c                           |  37 ++-
 .../{mach-s3c24xx => mach-s3c}/mach-anubis.c  |  14 +-
 .../{mach-s3c64xx => mach-s3c}/mach-anw6410.c |  17 +-
 .../mach-at2440evb.c                          |  28 ++-
 .../{mach-s3c24xx => mach-s3c}/mach-bast.c    |  22 +-
 .../mach-crag6410-module.c                    |   2 +-
 .../mach-crag6410.c                           |  27 ++-
 .../{mach-s3c24xx => mach-s3c}/mach-gta02.c   |  57 ++++-
 .../{mach-s3c24xx => mach-s3c}/mach-h1940.c   |  65 ++++--
 .../arm/{mach-s3c64xx => mach-s3c}/mach-hmt.c |  15 +-
 .../{mach-s3c24xx => mach-s3c}/mach-jive.c    |  27 ++-
 .../mach-mini2440.c                           |  48 ++--
 .../mach-mini6410.c                           |  22 +-
 .../arm/{mach-s3c24xx => mach-s3c}/mach-n30.c |  40 +++-
 .../arm/{mach-s3c64xx => mach-s3c}/mach-ncp.c |  13 +-
 .../mach-nexcoder.c                           |  20 +-
 .../mach-osiris-dvs.c                         |   4 +-
 .../{mach-s3c24xx => mach-s3c}/mach-osiris.c  |  22 +-
 .../{mach-s3c24xx => mach-s3c}/mach-otom.c    |  17 +-
 .../{mach-s3c24xx => mach-s3c}/mach-qt2410.c  |  37 ++-
 .../mach-real6410.c                           |  18 +-
 .../{mach-s3c24xx => mach-s3c}/mach-rx1950.c  |  57 +++--
 .../{mach-s3c24xx => mach-s3c}/mach-rx3715.c  |  26 ++-
 .../mach-s3c2416-dt.c                         |   8 +-
 .../mach-s3c64xx-dt.c                         |   6 +-
 .../{mach-s3c64xx => mach-s3c}/mach-smartq.c  |  18 +-
 .../{mach-s3c64xx => mach-s3c}/mach-smartq.h  |   0
 .../{mach-s3c64xx => mach-s3c}/mach-smartq5.c |  18 +-
 .../{mach-s3c64xx => mach-s3c}/mach-smartq7.c |  18 +-
 .../mach-smdk2410.c                           |  14 +-
 .../mach-smdk2413.c                           |  21 +-
 .../mach-smdk2416.c                           |  23 +-
 .../mach-smdk2440.c                           |  25 ++-
 .../mach-smdk2443.c                           |  14 +-
 .../mach-smdk6400.c                           |  13 +-
 .../mach-smdk6410.c                           |  23 +-
 .../mach-tct_hammer.c                         |  24 +-
 .../{mach-s3c24xx => mach-s3c}/mach-vr1000.c  |  20 +-
 .../{mach-s3c24xx => mach-s3c}/mach-vstms.c   |  20 +-
 .../include/plat => mach-s3c}/map-s3c.h       |  12 +-
 .../mach/map.h => mach-s3c/map-s3c24xx.h}     |   6 +-
 .../mach/map.h => mach-s3c/map-s3c64xx.h}     |   4 +-
 .../include/plat => mach-s3c}/map-s5p.h       |   4 +-
 arch/arm/mach-s3c/map.h                       |   7 +
 .../{mach-s3c24xx => mach-s3c}/nand-core.h    |   0
 .../{mach-s3c64xx => mach-s3c}/onenand-core.h |   0
 arch/arm/{mach-s3c24xx => mach-s3c}/osiris.h  |   0
 arch/arm/{mach-s3c24xx => mach-s3c}/otom.h    |   0
 arch/arm/{mach-s3c64xx => mach-s3c}/pl080.c   |   4 +-
 .../{plat-samsung => mach-s3c}/platformdata.c |   4 +-
 .../{mach-s3c24xx => mach-s3c}/pll-s3c2410.c  |   4 +-
 .../pll-s3c2440-12000000.c                    |   4 +-
 .../pll-s3c2440-16934400.c                    |   4 +-
 .../{plat-samsung => mach-s3c}/pm-common.c    |   2 +-
 arch/arm/mach-s3c/pm-common.h                 |  40 ++++
 .../pm-core.h => mach-s3c/pm-core-s3c24xx.h}  |   8 +-
 .../pm-core.h => mach-s3c/pm-core-s3c64xx.h}  |  50 +----
 arch/arm/mach-s3c/pm-core.h                   |   7 +
 arch/arm/{plat-samsung => mach-s3c}/pm-gpio.c |   6 +-
 .../arm/{mach-s3c24xx => mach-s3c}/pm-h1940.S |   5 +-
 .../{mach-s3c24xx => mach-s3c}/pm-s3c2410.c   |  11 +-
 .../{mach-s3c24xx => mach-s3c}/pm-s3c2412.c   |  11 +-
 .../{mach-s3c24xx => mach-s3c}/pm-s3c2416.c   |   6 +-
 .../pm.c => mach-s3c/pm-s3c24xx.c}            |  12 +-
 .../pm.c => mach-s3c/pm-s3c64xx.c}            |  66 +++++-
 arch/arm/{plat-samsung => mach-s3c}/pm.c      |  20 +-
 .../include/plat => mach-s3c}/pm.h            |   2 +-
 .../include/plat => mach-s3c}/pwm-core.h      |   0
 .../include/plat => mach-s3c}/regs-adc.h      |   0
 .../regs-clock-s3c24xx.h}                     |   2 +
 .../regs-clock-s3c64xx.h}                     |   0
 arch/arm/mach-s3c/regs-clock.h                |   7 +
 .../arm/{mach-s3c24xx => mach-s3c}/regs-dsc.h |   0
 .../regs-gpio-memport.h                       |   0
 .../regs-gpio-s3c24xx.h}                      |   2 +
 .../regs-gpio-s3c64xx.h}                      |   0
 arch/arm/mach-s3c/regs-gpio.h                 |   7 +
 .../regs-irq-s3c24xx.h}                       |   2 +
 .../regs-irq-s3c64xx.h}                       |   0
 arch/arm/mach-s3c/regs-irq.h                  |   7 +
 .../include/plat => mach-s3c}/regs-irqtype.h  |   0
 .../arm/{mach-s3c24xx => mach-s3c}/regs-mem.h |   2 +
 .../{mach-s3c64xx => mach-s3c}/regs-modem.h   |   0
 .../mach => mach-s3c}/regs-s3c2443-clock.h    |  50 +++++
 .../{mach-s3c64xx => mach-s3c}/regs-srom.h    |   0
 .../arm/{mach-s3c64xx => mach-s3c}/regs-sys.h |   0
 .../regs-syscon-power.h                       |   0
 .../regs-usb-hsotg-phy.h                      |   0
 .../include/mach => mach-s3c}/rtc-core.h      |   0
 arch/arm/{mach-s3c24xx => mach-s3c}/s3c2410.c |  21 +-
 .../s3c2412-power.h                           |   0
 arch/arm/{mach-s3c24xx => mach-s3c}/s3c2412.c |  16 +-
 .../include/mach => mach-s3c}/s3c2412.h       |   2 +
 arch/arm/{mach-s3c24xx => mach-s3c}/s3c2416.c |  28 +--
 arch/arm/{mach-s3c24xx => mach-s3c}/s3c2440.c |  17 +-
 arch/arm/{mach-s3c24xx => mach-s3c}/s3c2442.c |  17 +-
 arch/arm/{mach-s3c24xx => mach-s3c}/s3c2443.c |  21 +-
 arch/arm/{mach-s3c24xx => mach-s3c}/s3c244x.c |  16 +-
 .../common.c => mach-s3c/s3c24xx.c}           |  21 +-
 .../common.h => mach-s3c/s3c24xx.h}           |   1 +
 arch/arm/{mach-s3c64xx => mach-s3c}/s3c6400.c |  14 +-
 arch/arm/{mach-s3c64xx => mach-s3c}/s3c6410.c |  17 +-
 .../common.c => mach-s3c/s3c64xx.c}           |  24 +-
 .../common.h => mach-s3c/s3c64xx.h}           |   0
 .../include/plat => mach-s3c}/samsung-time.h  |   0
 .../include/plat => mach-s3c}/sdhci.h         |   2 +-
 .../{mach-s3c24xx => mach-s3c}/setup-camif.c  |   4 +-
 .../setup-fb-24bpp.c                          |   6 +-
 .../{mach-s3c24xx => mach-s3c}/setup-i2c.c    |   7 +-
 .../{mach-s3c64xx => mach-s3c}/setup-i2c0.c   |   4 +-
 .../{mach-s3c64xx => mach-s3c}/setup-i2c1.c   |   4 +-
 .../{mach-s3c64xx => mach-s3c}/setup-ide.c    |   8 +-
 .../{mach-s3c64xx => mach-s3c}/setup-keypad.c |   6 +-
 .../setup-sdhci-gpio-s3c24xx.c}               |   6 +-
 .../setup-sdhci-gpio-s3c64xx.c}               |   6 +-
 .../setup-spi-s3c24xx.c}                      |   6 +-
 .../setup-spi-s3c64xx.c}                      |   4 +-
 .../arm/{mach-s3c24xx => mach-s3c}/setup-ts.c |   5 +-
 .../setup-usb-phy.c                           |   6 +-
 .../{mach-s3c24xx => mach-s3c}/simtec-audio.c |  11 +-
 .../{mach-s3c24xx => mach-s3c}/simtec-nor.c   |   2 +-
 .../{mach-s3c24xx => mach-s3c}/simtec-pm.c    |   8 +-
 .../{mach-s3c24xx => mach-s3c}/simtec-usb.c   |   6 +-
 arch/arm/{mach-s3c24xx => mach-s3c}/simtec.h  |   0
 .../sleep-s3c2410.S                           |   7 +-
 .../sleep-s3c2412.S                           |   5 +-
 .../sleep.S => mach-s3c/sleep-s3c24xx.S}      |   7 +-
 .../sleep.S => mach-s3c/sleep-s3c64xx.S}      |   4 +-
 .../arm/{mach-s3c24xx => mach-s3c}/spi-core.h |   0
 .../include/plat => mach-s3c}/usb-phy.h       |   0
 arch/arm/{mach-s3c24xx => mach-s3c}/vr1000.h  |   0
 .../{plat-samsung => mach-s3c}/wakeup-mask.c  |   4 +-
 .../include/plat => mach-s3c}/wakeup-mask.h   |   0
 .../watchdog-reset.c                          |   0
 .../watchdog-reset.h                          |   0
 arch/arm/mach-s3c24xx/include/mach/fb.h       |   2 -
 arch/arm/mach-s3c24xx/include/mach/io.h       | 212 ------------------
 arch/arm/mach-s3c64xx/include/mach/hardware.h |  17 --
 arch/arm/mach-s5pv210/Kconfig                 |   1 +
 arch/arm/mach-s5pv210/Makefile                |   7 -
 arch/arm/mach-s5pv210/pm.c                    |  51 ++++-
 arch/arm/mach-s5pv210/regs-clock.h            |   2 +-
 arch/arm/mach-s5pv210/s5pv210.c               |   2 -
 drivers/clk/samsung/clk-s3c2410-dclk.c        |  10 +-
 drivers/cpufreq/s3c2410-cpufreq.c             |  10 +-
 drivers/cpufreq/s3c2412-cpufreq.c             |  44 ++--
 drivers/cpufreq/s3c2440-cpufreq.c             |  29 ++-
 drivers/cpufreq/s3c24xx-cpufreq-debugfs.c     |   2 +-
 drivers/cpufreq/s3c24xx-cpufreq.c             |  14 +-
 drivers/hwmon/s3c-hwmon.c                     |   2 +-
 drivers/input/touchscreen/s3c2410_ts.c        |  37 ++-
 drivers/irqchip/Makefile                      |   1 -
 drivers/leds/leds-s3c24xx.c                   |   7 -
 drivers/mmc/host/Kconfig                      |   2 +-
 drivers/mmc/host/s3cmci.c                     |  72 ++----
 drivers/power/supply/s3c_adc_battery.c        |   2 +-
 drivers/pwm/Kconfig                           |   2 +-
 drivers/soc/samsung/Kconfig                   |  48 +++-
 drivers/soc/samsung/Makefile                  |   3 +
 .../soc/samsung/s3c-pm-check.c                |   2 +-
 .../soc/samsung/s3c-pm-debug.c                |  26 +--
 drivers/spi/Kconfig                           |   2 +-
 drivers/spi/Makefile                          |   1 -
 .../spi/spi-s3c24xx-regs.h                    |   3 +-
 drivers/spi/spi-s3c24xx.c                     |  28 +--
 drivers/tty/serial/Kconfig                    |   2 +-
 drivers/usb/gadget/udc/s3c-hsudc.c            |  55 +----
 drivers/usb/gadget/udc/s3c2410_udc.c          |  31 +--
 drivers/usb/gadget/udc/s3c2410_udc.h          |   1 +
 .../usb/gadget/udc/s3c2410_udc_regs.h         |   2 +
 .../video/fbdev/s3c2410fb-regs-lcd.h          |  28 +--
 drivers/video/fbdev/s3c2410fb.c               |  16 +-
 .../linux/platform_data}/fb-s3c2410.h         |  33 ++-
 include/linux/platform_data/mmc-s3cmci.h      |   2 +
 include/linux/platform_data/s3c-hsudc.h       |   2 +
 .../linux/soc/samsung/s3c-adc.h               |   0
 .../linux/soc/samsung/s3c-cpu-freq.h          |   0
 .../linux/soc/samsung/s3c-cpufreq-core.h      |  10 +-
 .../linux/soc/samsung/s3c-pm.h                |  69 +++---
 .../linux/spi/s3c24xx-fiq.h                   |   5 +
 include/linux/spi/s3c24xx.h                   |   2 +-
 sound/soc/samsung/Kconfig                     |   2 +-
 sound/soc/samsung/h1940_uda1380.c             |  71 ++----
 sound/soc/samsung/neo1973_wm8753.c            |  85 +++----
 sound/soc/samsung/rx1950_uda1380.c            |  72 ++----
 sound/soc/samsung/s3c-i2s-v2.c                |   3 +-
 sound/soc/samsung/s3c-i2s-v2.h                |   3 +-
 sound/soc/samsung/s3c2412-i2s.c               |   9 +-
 sound/soc/samsung/s3c24xx-i2s.c               |   7 -
 259 files changed, 1716 insertions(+), 1648 deletions(-)
 delete mode 100644 arch/arm/mach-exynos/include/mach/map.h
 rename arch/arm/{plat-samsung => mach-s3c}/Kconfig (73%)
 rename arch/arm/{mach-s3c24xx/Kconfig => mach-s3c/Kconfig.s3c24xx} (100%)
 rename arch/arm/{mach-s3c64xx/Kconfig => mach-s3c/Kconfig.s3c64xx} (100%)
 rename arch/arm/{plat-samsung => mach-s3c}/Makefile (67%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/Makefile.boot (100%)
 rename arch/arm/{mach-s3c24xx/Makefile => mach-s3c/Makefile.s3c24xx} (86%)
 rename arch/arm/{mach-s3c64xx/Makefile => mach-s3c/Makefile.s3c64xx} (83%)
 rename arch/arm/{plat-samsung/include/plat => mach-s3c}/adc-core.h (100%)
 rename arch/arm/{plat-samsung => mach-s3c}/adc.c (99%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/anubis.h (100%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/ata-core.h (100%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/backlight.h (100%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/bast-ide.c (97%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/bast-irq.c (95%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/bast.h (100%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/common-smdk.c (93%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/common-smdk.h (100%)
 rename arch/arm/{plat-samsung => mach-s3c}/cpu.c (62%)
 rename arch/arm/{plat-samsung/include/plat => mach-s3c}/cpu.h (91%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/cpufreq-utils.c (70%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/cpuidle.c (96%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/crag6410.h (95%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/dev-audio.c (97%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/dev-backlight.c (98%)
 rename arch/arm/{mach-s3c64xx/dev-uart.c => mach-s3c/dev-uart-s3c64xx.c} (95%)
 rename arch/arm/{plat-samsung => mach-s3c}/dev-uart.c (97%)
 rename arch/arm/{plat-samsung => mach-s3c}/devs.c (96%)
 rename arch/arm/{plat-samsung/include/plat => mach-s3c}/devs.h (100%)
 rename arch/arm/{mach-s3c24xx/include/mach/dma.h => mach-s3c/dma-s3c24xx.h} (100%)
 rename arch/arm/{mach-s3c64xx/include/mach/dma.h => mach-s3c/dma-s3c64xx.h} (100%)
 create mode 100644 arch/arm/mach-s3c/dma.h
 rename arch/arm/{mach-s3c24xx => mach-s3c}/fb-core.h (100%)
 rename arch/arm/{plat-samsung/include/plat => mach-s3c}/fb.h (100%)
 rename arch/arm/{plat-samsung/include/plat => mach-s3c}/gpio-cfg-helpers.h (100%)
 rename arch/arm/{plat-samsung/include/plat => mach-s3c}/gpio-cfg.h (100%)
 rename arch/arm/{plat-samsung/include/plat => mach-s3c}/gpio-core.h (99%)
 rename arch/arm/{mach-s3c24xx/include/mach/gpio-samsung.h => mach-s3c/gpio-samsung-s3c24xx.h} (99%)
 rename arch/arm/{mach-s3c64xx/include/mach/gpio-samsung.h => mach-s3c/gpio-samsung-s3c64xx.h} (100%)
 rename arch/arm/{plat-samsung => mach-s3c}/gpio-samsung.c (99%)
 create mode 100644 arch/arm/mach-s3c/gpio-samsung.h
 rename arch/arm/{mach-s3c24xx => mach-s3c}/gta02.h (94%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/h1940-bluetooth.c (96%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/h1940.h (100%)
 rename arch/arm/{mach-s3c24xx/include/mach => mach-s3c}/hardware.h (76%)
 rename arch/arm/{plat-samsung/include/plat => mach-s3c}/iic-core.h (100%)
 create mode 100644 arch/arm/mach-s3c/include/mach/io.h
 rename arch/arm/{mach-s3c24xx/include/mach/irqs.h => mach-s3c/include/mach/irqs-s3c24xx.h} (100%)
 rename arch/arm/{mach-s3c64xx/include/mach/irqs.h => mach-s3c/include/mach/irqs-s3c64xx.h} (100%)
 create mode 100644 arch/arm/mach-s3c/include/mach/irqs.h
 rename arch/arm/{plat-samsung/include/plat => mach-s3c/include/mach}/map-base.h (100%)
 rename arch/arm/{plat-samsung => mach-s3c}/init.c (98%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/iotiming-s3c2410.c (97%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/iotiming-s3c2412.c (98%)
 rename arch/arm/{mach-s3c24xx/irq-pm.c => mach-s3c/irq-pm-s3c24xx.c} (93%)
 rename arch/arm/{mach-s3c64xx/irq-pm.c => mach-s3c/irq-pm-s3c64xx.c} (97%)
 create mode 100644 arch/arm/mach-s3c/irq-s3c24xx-fiq-exports.c
 rename drivers/spi/spi-s3c24xx-fiq.S => arch/arm/mach-s3c/irq-s3c24xx-fiq.S (94%)
 rename {drivers/irqchip => arch/arm/mach-s3c}/irq-s3c24xx.c (99%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/irq-uart.h (100%)
 rename arch/arm/{plat-samsung/include/plat => mach-s3c}/keypad.h (100%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/mach-amlm5900.c (84%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/mach-anubis.c (97%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/mach-anw6410.c (96%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/mach-at2440evb.c (88%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/mach-bast.c (98%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/mach-crag6410-module.c (99%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/mach-crag6410.c (98%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/mach-gta02.c (90%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/mach-h1940.c (92%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/mach-hmt.c (97%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/mach-jive.c (97%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/mach-mini2440.c (93%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/mach-mini6410.c (97%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/mach-n30.c (93%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/mach-ncp.c (92%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/mach-nexcoder.c (92%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/mach-osiris-dvs.c (98%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/mach-osiris.c (97%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/mach-otom.c (89%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/mach-qt2410.c (88%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/mach-real6410.c (97%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/mach-rx1950.c (93%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/mach-rx3715.c (90%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/mach-s3c2416-dt.c (92%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/mach-s3c64xx-dt.c (95%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/mach-smartq.c (97%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/mach-smartq.h (100%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/mach-smartq5.c (93%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/mach-smartq7.c (94%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/mach-smdk2410.c (89%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/mach-smdk2413.c (90%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/mach-smdk2416.c (95%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/mach-smdk2440.c (89%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/mach-smdk2443.c (93%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/mach-smdk6400.c (92%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/mach-smdk6410.c (98%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/mach-tct_hammer.c (82%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/mach-vr1000.c (95%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/mach-vstms.c (90%)
 rename arch/arm/{plat-samsung/include/plat => mach-s3c}/map-s3c.h (87%)
 rename arch/arm/{mach-s3c24xx/include/mach/map.h => mach-s3c/map-s3c24xx.h} (97%)
 rename arch/arm/{mach-s3c64xx/include/mach/map.h => mach-s3c/map-s3c64xx.h} (98%)
 rename arch/arm/{plat-samsung/include/plat => mach-s3c}/map-s5p.h (85%)
 create mode 100644 arch/arm/mach-s3c/map.h
 rename arch/arm/{mach-s3c24xx => mach-s3c}/nand-core.h (100%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/onenand-core.h (100%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/osiris.h (100%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/otom.h (100%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/pl080.c (99%)
 rename arch/arm/{plat-samsung => mach-s3c}/platformdata.c (96%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/pll-s3c2410.c (97%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/pll-s3c2440-12000000.c (97%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/pll-s3c2440-16934400.c (98%)
 rename arch/arm/{plat-samsung => mach-s3c}/pm-common.c (98%)
 create mode 100644 arch/arm/mach-s3c/pm-common.h
 rename arch/arm/{mach-s3c24xx/include/mach/pm-core.h => mach-s3c/pm-core-s3c24xx.h} (95%)
 rename arch/arm/{mach-s3c64xx/include/mach/pm-core.h => mach-s3c/pm-core-s3c64xx.h} (58%)
 create mode 100644 arch/arm/mach-s3c/pm-core.h
 rename arch/arm/{plat-samsung => mach-s3c}/pm-gpio.c (99%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/pm-h1940.S (80%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/pm-s3c2410.c (96%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/pm-s3c2412.c (95%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/pm-s3c2416.c (95%)
 rename arch/arm/{mach-s3c24xx/pm.c => mach-s3c/pm-s3c24xx.c} (94%)
 rename arch/arm/{mach-s3c64xx/pm.c => mach-s3c/pm-s3c64xx.c} (83%)
 rename arch/arm/{plat-samsung => mach-s3c}/pm.c (94%)
 rename arch/arm/{plat-samsung/include/plat => mach-s3c}/pm.h (98%)
 rename arch/arm/{plat-samsung/include/plat => mach-s3c}/pwm-core.h (100%)
 rename arch/arm/{plat-samsung/include/plat => mach-s3c}/regs-adc.h (100%)
 rename arch/arm/{mach-s3c24xx/include/mach/regs-clock.h => mach-s3c/regs-clock-s3c24xx.h} (99%)
 rename arch/arm/{mach-s3c64xx/include/mach/regs-clock.h => mach-s3c/regs-clock-s3c64xx.h} (100%)
 create mode 100644 arch/arm/mach-s3c/regs-clock.h
 rename arch/arm/{mach-s3c24xx => mach-s3c}/regs-dsc.h (100%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/regs-gpio-memport.h (100%)
 rename arch/arm/{mach-s3c24xx/include/mach/regs-gpio.h => mach-s3c/regs-gpio-s3c24xx.h} (99%)
 rename arch/arm/{mach-s3c64xx/include/mach/regs-gpio.h => mach-s3c/regs-gpio-s3c64xx.h} (100%)
 create mode 100644 arch/arm/mach-s3c/regs-gpio.h
 rename arch/arm/{mach-s3c24xx/include/mach/regs-irq.h => mach-s3c/regs-irq-s3c24xx.h} (98%)
 rename arch/arm/{mach-s3c64xx/include/mach/regs-irq.h => mach-s3c/regs-irq-s3c64xx.h} (100%)
 create mode 100644 arch/arm/mach-s3c/regs-irq.h
 rename arch/arm/{plat-samsung/include/plat => mach-s3c}/regs-irqtype.h (100%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/regs-mem.h (98%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/regs-modem.h (100%)
 rename arch/arm/{mach-s3c24xx/include/mach => mach-s3c}/regs-s3c2443-clock.h (81%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/regs-srom.h (100%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/regs-sys.h (100%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/regs-syscon-power.h (100%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/regs-usb-hsotg-phy.h (100%)
 rename arch/arm/{mach-s3c24xx/include/mach => mach-s3c}/rtc-core.h (100%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/s3c2410.c (90%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/s3c2412-power.h (100%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/s3c2412.c (94%)
 rename arch/arm/{mach-s3c24xx/include/mach => mach-s3c}/s3c2412.h (96%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/s3c2416.c (88%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/s3c2440.c (85%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/s3c2442.c (82%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/s3c2443.c (89%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/s3c244x.c (93%)
 rename arch/arm/{mach-s3c24xx/common.c => mach-s3c/s3c24xx.c} (98%)
 rename arch/arm/{mach-s3c24xx/common.h => mach-s3c/s3c24xx.h} (99%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/s3c6400.c (89%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/s3c6410.c (89%)
 rename arch/arm/{mach-s3c64xx/common.c => mach-s3c/s3c64xx.c} (97%)
 rename arch/arm/{mach-s3c64xx/common.h => mach-s3c/s3c64xx.h} (100%)
 rename arch/arm/{plat-samsung/include/plat => mach-s3c}/samsung-time.h (100%)
 rename arch/arm/{plat-samsung/include/plat => mach-s3c}/sdhci.h (99%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/setup-camif.c (95%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/setup-fb-24bpp.c (86%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/setup-i2c.c (79%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/setup-i2c0.c (90%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/setup-i2c1.c (90%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/setup-ide.c (89%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/setup-keypad.c (86%)
 rename arch/arm/{mach-s3c24xx/setup-sdhci-gpio.c => mach-s3c/setup-sdhci-gpio-s3c24xx.c} (90%)
 rename arch/arm/{mach-s3c64xx/setup-sdhci-gpio.c => mach-s3c/setup-sdhci-gpio-s3c64xx.c} (95%)
 rename arch/arm/{mach-s3c24xx/setup-spi.c => mach-s3c/setup-spi-s3c24xx.c} (85%)
 rename arch/arm/{mach-s3c64xx/setup-spi.c => mach-s3c/setup-spi-s3c64xx.c} (89%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/setup-ts.c (88%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/setup-usb-phy.c (96%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/simtec-audio.c (86%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/simtec-nor.c (98%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/simtec-pm.c (92%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/simtec-usb.c (96%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/simtec.h (100%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/sleep-s3c2410.S (92%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/sleep-s3c2412.S (93%)
 rename arch/arm/{mach-s3c24xx/sleep.S => mach-s3c/sleep-s3c24xx.S} (92%)
 rename arch/arm/{mach-s3c64xx/sleep.S => mach-s3c/sleep-s3c64xx.S} (97%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/spi-core.h (100%)
 rename arch/arm/{plat-samsung/include/plat => mach-s3c}/usb-phy.h (100%)
 rename arch/arm/{mach-s3c24xx => mach-s3c}/vr1000.h (100%)
 rename arch/arm/{plat-samsung => mach-s3c}/wakeup-mask.c (94%)
 rename arch/arm/{plat-samsung/include/plat => mach-s3c}/wakeup-mask.h (100%)
 rename arch/arm/{plat-samsung => mach-s3c}/watchdog-reset.c (100%)
 rename arch/arm/{mach-s3c64xx => mach-s3c}/watchdog-reset.h (100%)
 delete mode 100644 arch/arm/mach-s3c24xx/include/mach/fb.h
 delete mode 100644 arch/arm/mach-s3c24xx/include/mach/io.h
 delete mode 100644 arch/arm/mach-s3c64xx/include/mach/hardware.h
 rename arch/arm/plat-samsung/pm-check.c => drivers/soc/samsung/s3c-pm-check.c (99%)
 rename arch/arm/plat-samsung/pm-debug.c => drivers/soc/samsung/s3c-pm-debug.c (78%)
 rename arch/arm/plat-samsung/include/plat/regs-spi.h => drivers/spi/spi-s3c24xx-regs.h (95%)
 rename arch/arm/plat-samsung/include/plat/regs-udc.h => drivers/usb/gadget/udc/s3c2410_udc_regs.h (99%)
 rename arch/arm/mach-s3c24xx/include/mach/regs-lcd.h => drivers/video/fbdev/s3c2410fb-regs-lcd.h (84%)
 rename {arch/arm/plat-samsung/include/plat => include/linux/platform_data}/fb-s3c2410.h (57%)
 rename arch/arm/plat-samsung/include/plat/adc.h => include/linux/soc/samsung/s3c-adc.h (100%)
 rename arch/arm/plat-samsung/include/plat/cpu-freq.h => include/linux/soc/samsung/s3c-cpu-freq.h (100%)
 rename arch/arm/plat-samsung/include/plat/cpu-freq-core.h => include/linux/soc/samsung/s3c-cpufreq-core.h (96%)
 rename arch/arm/plat-samsung/include/plat/pm-common.h => include/linux/soc/samsung/s3c-pm.h (55%)
 rename drivers/spi/spi-s3c24xx-fiq.h => include/linux/spi/s3c24xx-fiq.h (78%)

Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: linux-pm@vger.kernel.org
Cc: patches@opensource.cirrus.com
Cc: linux-stm32@st-md-mailman.stormreply.com
Cc: linux-clk@vger.kernel.org
Cc: linux-hwmon@vger.kernel.org
Cc: linux-input@vger.kernel.org
Cc: linux-leds@vger.kernel.org
Cc: linux-mmc@vger.kernel.org
Cc: linux-pwm@vger.kernel.org
Cc: linux-spi@vger.kernel.org
Cc: linux-serial@vger.kernel.org
Cc: linux-usb@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-fbdev@vger.kernel.org
Cc: alsa-devel@alsa-project.org
-- 
2.20.0


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

* [PATCH 07/36] ARM: exynos: use private samsung_cpu_id copy
       [not found] ` <20191010203043.1241612-1-arnd@arndb.de>
@ 2019-10-10 20:29   ` Arnd Bergmann
  2019-10-23 10:54     ` Krzysztof Kozlowski
  2019-10-10 20:29   ` [PATCH 15/36] ARM: s3c: adc: move header to linux/soc/samsung Arnd Bergmann
                     ` (4 subsequent siblings)
  5 siblings, 1 reply; 22+ messages in thread
From: Arnd Bergmann @ 2019-10-10 20:29 UTC (permalink / raw)
  To: Kukjin Kim, Krzysztof Kozlowski, Bartlomiej Zolnierkiewicz,
	Daniel Lezcano
  Cc: linux-samsung-soc, linux-arm-kernel, linus.walleij,
	Arnd Bergmann, Tomasz Figa, Marek Szyprowski, Pankaj Dubey,
	linux-kernel, linux-pm

The only part of plat-samsung that is shared with arch-exynos
is the CPU identification code.

Having a separate exynos_cpu_id variable makes the two completely
independent and is actually a bit less code in total.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-exynos/common.h                |  6 +++---
 arch/arm/mach-exynos/exynos.c                | 19 +++++++++++++++----
 arch/arm/mach-exynos/include/mach/map.h      | 18 ------------------
 arch/arm/mach-exynos/platsmp.c               |  4 +---
 arch/arm/mach-exynos/pm.c                    |  8 ++++----
 arch/arm/plat-samsung/cpu.c                  | 17 -----------------
 arch/arm/plat-samsung/include/plat/cpu.h     |  2 --
 arch/arm/plat-samsung/include/plat/map-s5p.h |  2 --
 8 files changed, 23 insertions(+), 53 deletions(-)
 delete mode 100644 arch/arm/mach-exynos/include/mach/map.h

diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
index 56411bb63d45..adf7db9c0885 100644
--- a/arch/arm/mach-exynos/common.h
+++ b/arch/arm/mach-exynos/common.h
@@ -24,12 +24,12 @@
 #define EXYNOS5800_SOC_ID	0xE5422000
 #define EXYNOS5_SOC_MASK	0xFFFFF000
 
-extern unsigned long samsung_cpu_id;
+extern unsigned long exynos_cpu_id;
 
 #define IS_SAMSUNG_CPU(name, id, mask)		\
 static inline int is_samsung_##name(void)	\
 {						\
-	return ((samsung_cpu_id & mask) == (id & mask));	\
+	return ((exynos_cpu_id & mask) == (id & mask));	\
 }
 
 IS_SAMSUNG_CPU(exynos3250, EXYNOS3250_SOC_ID, EXYNOS3_SOC_MASK)
@@ -147,7 +147,7 @@ extern struct cpuidle_exynos_data cpuidle_coupled_exynos_data;
 
 extern void exynos_set_delayed_reset_assertion(bool enable);
 
-extern unsigned int samsung_rev(void);
+extern unsigned int exynos_rev(void);
 extern void exynos_core_restart(u32 core_id);
 extern int exynos_set_boot_addr(u32 core_id, unsigned long boot_addr);
 extern int exynos_get_boot_addr(u32 core_id, unsigned long *boot_addr);
diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
index 9aa483366ebc..da9300d655c6 100644
--- a/arch/arm/mach-exynos/exynos.c
+++ b/arch/arm/mach-exynos/exynos.c
@@ -19,11 +19,10 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
-#include <mach/map.h>
-#include <plat/cpu.h>
-
 #include "common.h"
 
+#define S5P_VA_CHIPID	((void __iomem __force *)0xF8000000)
+
 static struct platform_device exynos_cpuidle = {
 	.name              = "exynos_cpuidle",
 #ifdef CONFIG_ARM_EXYNOS_CPUIDLE
@@ -36,6 +35,14 @@ void __iomem *sysram_base_addr __ro_after_init;
 phys_addr_t sysram_base_phys __ro_after_init;
 void __iomem *sysram_ns_base_addr __ro_after_init;
 
+unsigned long exynos_cpu_id;
+static unsigned int exynos_cpu_rev;
+
+unsigned int exynos_rev(void)
+{
+	return exynos_cpu_rev;
+}
+
 void __init exynos_sysram_init(void)
 {
 	struct device_node *node;
@@ -86,7 +93,11 @@ static void __init exynos_init_io(void)
 	of_scan_flat_dt(exynos_fdt_map_chipid, NULL);
 
 	/* detect cpu id and rev. */
-	s5p_init_cpu(S5P_VA_CHIPID);
+	exynos_cpu_id = readl_relaxed(S5P_VA_CHIPID);
+	exynos_cpu_rev = exynos_cpu_id & 0xFF;
+
+	pr_info("Samsung CPU ID: 0x%08lx\n", exynos_cpu_id);
+
 }
 
 /*
diff --git a/arch/arm/mach-exynos/include/mach/map.h b/arch/arm/mach-exynos/include/mach/map.h
deleted file mode 100644
index 22ebe3654633..000000000000
--- a/arch/arm/mach-exynos/include/mach/map.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-/*
- * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
- *		http://www.samsung.com/
- *
- * EXYNOS - Memory map definitions
- */
-
-#ifndef __ASM_ARCH_MAP_H
-#define __ASM_ARCH_MAP_H __FILE__
-
-#include <plat/map-base.h>
-
-#include <plat/map-s5p.h>
-
-#define EXYNOS_PA_CHIPID		0x10000000
-
-#endif /* __ASM_ARCH_MAP_H */
diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c
index 0cbbae8bf1f8..d7fedbb2eefe 100644
--- a/arch/arm/mach-exynos/platsmp.c
+++ b/arch/arm/mach-exynos/platsmp.c
@@ -22,8 +22,6 @@
 #include <asm/smp_scu.h>
 #include <asm/firmware.h>
 
-#include <mach/map.h>
-
 #include "common.h"
 
 extern void exynos4_secondary_startup(void);
@@ -188,7 +186,7 @@ void exynos_scu_enable(void)
 
 static void __iomem *cpu_boot_reg_base(void)
 {
-	if (soc_is_exynos4210() && samsung_rev() == EXYNOS4210_REV_1_1)
+	if (soc_is_exynos4210() && exynos_rev() == EXYNOS4210_REV_1_1)
 		return pmu_base_addr + S5P_INFORM5;
 	return sysram_base_addr;
 }
diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c
index 48e7fb38613e..624585641a9c 100644
--- a/arch/arm/mach-exynos/pm.c
+++ b/arch/arm/mach-exynos/pm.c
@@ -26,18 +26,18 @@
 
 static inline void __iomem *exynos_boot_vector_addr(void)
 {
-	if (samsung_rev() == EXYNOS4210_REV_1_1)
+	if (exynos_rev() == EXYNOS4210_REV_1_1)
 		return pmu_base_addr + S5P_INFORM7;
-	else if (samsung_rev() == EXYNOS4210_REV_1_0)
+	else if (exynos_rev() == EXYNOS4210_REV_1_0)
 		return sysram_base_addr + 0x24;
 	return pmu_base_addr + S5P_INFORM0;
 }
 
 static inline void __iomem *exynos_boot_vector_flag(void)
 {
-	if (samsung_rev() == EXYNOS4210_REV_1_1)
+	if (exynos_rev() == EXYNOS4210_REV_1_1)
 		return pmu_base_addr + S5P_INFORM6;
-	else if (samsung_rev() == EXYNOS4210_REV_1_0)
+	else if (exynos_rev() == EXYNOS4210_REV_1_0)
 		return sysram_base_addr + 0x20;
 	return pmu_base_addr + S5P_INFORM1;
 }
diff --git a/arch/arm/plat-samsung/cpu.c b/arch/arm/plat-samsung/cpu.c
index e1ba88ba31d8..8acba21bbf4b 100644
--- a/arch/arm/plat-samsung/cpu.c
+++ b/arch/arm/plat-samsung/cpu.c
@@ -14,13 +14,6 @@
 #include <plat/cpu.h>
 
 unsigned long samsung_cpu_id;
-static unsigned int samsung_cpu_rev;
-
-unsigned int samsung_rev(void)
-{
-	return samsung_cpu_rev;
-}
-EXPORT_SYMBOL(samsung_rev);
 
 void __init s3c64xx_init_cpu(void)
 {
@@ -34,15 +27,5 @@ void __init s3c64xx_init_cpu(void)
 		samsung_cpu_id = readl_relaxed(S3C_VA_SYS + 0xA1C);
 	}
 
-	samsung_cpu_rev = 0;
-
-	pr_info("Samsung CPU ID: 0x%08lx\n", samsung_cpu_id);
-}
-
-void __init s5p_init_cpu(const void __iomem *cpuid_addr)
-{
-	samsung_cpu_id = readl_relaxed(cpuid_addr);
-	samsung_cpu_rev = samsung_cpu_id & 0xFF;
-
 	pr_info("Samsung CPU ID: 0x%08lx\n", samsung_cpu_id);
 }
diff --git a/arch/arm/plat-samsung/include/plat/cpu.h b/arch/arm/plat-samsung/include/plat/cpu.h
index fadcddbea064..02d7f991d5a3 100644
--- a/arch/arm/plat-samsung/include/plat/cpu.h
+++ b/arch/arm/plat-samsung/include/plat/cpu.h
@@ -111,8 +111,6 @@ extern void s3c24xx_init_io(struct map_desc *mach_desc, int size);
 extern void s3c64xx_init_cpu(void);
 extern void s5p_init_cpu(const void __iomem *cpuid_addr);
 
-extern unsigned int samsung_rev(void);
-
 extern void s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no);
 
 extern void s3c24xx_init_clocks(int xtal);
diff --git a/arch/arm/plat-samsung/include/plat/map-s5p.h b/arch/arm/plat-samsung/include/plat/map-s5p.h
index d69a0ca09fb5..3812085f8761 100644
--- a/arch/arm/plat-samsung/include/plat/map-s5p.h
+++ b/arch/arm/plat-samsung/include/plat/map-s5p.h
@@ -9,8 +9,6 @@
 #ifndef __ASM_PLAT_MAP_S5P_H
 #define __ASM_PLAT_MAP_S5P_H __FILE__
 
-#define S5P_VA_CHIPID		S3C_ADDR(0x02000000)
-
 #define VA_VIC(x)		(S3C_VA_IRQ + ((x) * 0x10000))
 #define VA_VIC0			VA_VIC(0)
 #define VA_VIC1			VA_VIC(1)
-- 
2.20.0


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

* [PATCH 15/36] ARM: s3c: adc: move header to linux/soc/samsung
       [not found] ` <20191010203043.1241612-1-arnd@arndb.de>
  2019-10-10 20:29   ` [PATCH 07/36] ARM: exynos: use private samsung_cpu_id copy Arnd Bergmann
@ 2019-10-10 20:29   ` Arnd Bergmann
  2019-10-10 22:20     ` Guenter Roeck
  2019-10-23 12:37     ` Krzysztof Kozlowski
  2019-10-10 20:30   ` [PATCH 29/36] ARM: s3c: cpufreq: split out registers Arnd Bergmann
                     ` (3 subsequent siblings)
  5 siblings, 2 replies; 22+ messages in thread
From: Arnd Bergmann @ 2019-10-10 20:29 UTC (permalink / raw)
  To: Kukjin Kim, Krzysztof Kozlowski, Jean Delvare, Guenter Roeck,
	Dmitry Torokhov, Sebastian Reichel
  Cc: linux-samsung-soc, linux-arm-kernel, linus.walleij,
	Arnd Bergmann, linux-kernel, linux-hwmon, linux-input, linux-pm

There are multiple drivers using the private adc interface.
It seems unlikely that they would ever get converted to iio,
so make the current state official by making the header file
global.

The s3c2410_ts driver needs a couple of register definitions
as well.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-s3c64xx/mach-crag6410.c         |  2 +-
 arch/arm/mach-s3c64xx/mach-mini6410.c         |  2 +-
 arch/arm/mach-s3c64xx/mach-real6410.c         |  2 +-
 arch/arm/mach-s3c64xx/mach-smdk6410.c         |  2 +-
 arch/arm/plat-samsung/adc.c                   |  2 +-
 arch/arm/plat-samsung/devs.c                  |  2 +-
 drivers/hwmon/s3c-hwmon.c                     |  2 +-
 drivers/input/touchscreen/s3c2410_ts.c        | 37 ++++++++++++++++++-
 drivers/power/supply/s3c_adc_battery.c        |  2 +-
 .../linux/soc/samsung/s3c-adc.h               |  0
 10 files changed, 43 insertions(+), 10 deletions(-)
 rename arch/arm/plat-samsung/include/plat/adc.h => include/linux/soc/samsung/s3c-adc.h (100%)

diff --git a/arch/arm/mach-s3c64xx/mach-crag6410.c b/arch/arm/mach-s3c64xx/mach-crag6410.c
index da5b50981a14..133453562d23 100644
--- a/arch/arm/mach-s3c64xx/mach-crag6410.c
+++ b/arch/arm/mach-s3c64xx/mach-crag6410.c
@@ -57,7 +57,7 @@
 #include <plat/keypad.h>
 #include <plat/devs.h>
 #include <plat/cpu.h>
-#include <plat/adc.h>
+#include <linux/soc/samsung/s3c-adc.h>
 #include <linux/platform_data/i2c-s3c2410.h>
 #include <plat/pm.h>
 #include <plat/samsung-time.h>
diff --git a/arch/arm/mach-s3c64xx/mach-mini6410.c b/arch/arm/mach-s3c64xx/mach-mini6410.c
index 0dd36ae49e6a..c7140300bd3f 100644
--- a/arch/arm/mach-s3c64xx/mach-mini6410.c
+++ b/arch/arm/mach-s3c64xx/mach-mini6410.c
@@ -27,7 +27,7 @@
 #include <mach/regs-gpio.h>
 #include <mach/gpio-samsung.h>
 
-#include <plat/adc.h>
+#include <linux/soc/samsung/s3c-adc.h>
 #include <plat/cpu.h>
 #include <plat/devs.h>
 #include <plat/fb.h>
diff --git a/arch/arm/mach-s3c64xx/mach-real6410.c b/arch/arm/mach-s3c64xx/mach-real6410.c
index 0ff88b6859c4..f55097fde94c 100644
--- a/arch/arm/mach-s3c64xx/mach-real6410.c
+++ b/arch/arm/mach-s3c64xx/mach-real6410.c
@@ -29,7 +29,7 @@
 #include <mach/gpio-samsung.h>
 #include <mach/irqs.h>
 
-#include <plat/adc.h>
+#include <linux/soc/samsung/s3c-adc.h>
 #include <plat/cpu.h>
 #include <plat/devs.h>
 #include <plat/fb.h>
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c
index 95bdcfe95a53..3042f6cbffd9 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
@@ -60,7 +60,7 @@
 
 #include <plat/devs.h>
 #include <plat/cpu.h>
-#include <plat/adc.h>
+#include <linux/soc/samsung/s3c-adc.h>
 #include <linux/platform_data/touchscreen-s3c2410.h>
 #include <plat/keypad.h>
 #include <plat/samsung-time.h>
diff --git a/arch/arm/plat-samsung/adc.c b/arch/arm/plat-samsung/adc.c
index ee3d5c989a76..623a9774cc52 100644
--- a/arch/arm/plat-samsung/adc.c
+++ b/arch/arm/plat-samsung/adc.c
@@ -20,7 +20,7 @@
 #include <linux/regulator/consumer.h>
 
 #include <plat/regs-adc.h>
-#include <plat/adc.h>
+#include <linux/soc/samsung/s3c-adc.h>
 
 /* This driver is designed to control the usage of the ADC block between
  * the touchscreen and any other drivers that may need to use it, such as
diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c
index fd94a35e22f8..ddd90f0bb380 100644
--- a/arch/arm/plat-samsung/devs.c
+++ b/arch/arm/plat-samsung/devs.c
@@ -44,7 +44,7 @@
 
 #include <plat/cpu.h>
 #include <plat/devs.h>
-#include <plat/adc.h>
+#include <linux/soc/samsung/s3c-adc.h>
 #include <linux/platform_data/ata-samsung_cf.h>
 #include <plat/fb.h>
 #include <plat/fb-s3c2410.h>
diff --git a/drivers/hwmon/s3c-hwmon.c b/drivers/hwmon/s3c-hwmon.c
index b490fe3d2ee8..f2703c5460d0 100644
--- a/drivers/hwmon/s3c-hwmon.c
+++ b/drivers/hwmon/s3c-hwmon.c
@@ -20,7 +20,7 @@
 #include <linux/hwmon.h>
 #include <linux/hwmon-sysfs.h>
 
-#include <plat/adc.h>
+#include <linux/soc/samsung/s3c-adc.h>
 #include <linux/platform_data/hwmon-s3c.h>
 
 struct s3c_hwmon_attr {
diff --git a/drivers/input/touchscreen/s3c2410_ts.c b/drivers/input/touchscreen/s3c2410_ts.c
index b346e7cafd62..1a5a178ea286 100644
--- a/drivers/input/touchscreen/s3c2410_ts.c
+++ b/drivers/input/touchscreen/s3c2410_ts.c
@@ -21,10 +21,43 @@
 #include <linux/clk.h>
 #include <linux/io.h>
 
-#include <plat/adc.h>
-#include <plat/regs-adc.h>
+#include <linux/soc/samsung/s3c-adc.h>
 #include <linux/platform_data/touchscreen-s3c2410.h>
 
+#define	S3C2410_ADCCON			(0x00)
+#define	S3C2410_ADCTSC			(0x04)
+#define	S3C2410_ADCDLY			(0x08)
+#define	S3C2410_ADCDAT0			(0x0C)
+#define	S3C2410_ADCDAT1			(0x10)
+#define	S3C64XX_ADCUPDN			(0x14)
+#define	S3C2443_ADCMUX			(0x18)
+#define	S3C64XX_ADCCLRINT		(0x18)
+#define	S5P_ADCMUX			(0x1C)
+#define	S3C64XX_ADCCLRINTPNDNUP		(0x20)
+
+/* ADCTSC Register Bits */
+#define S3C2443_ADCTSC_UD_SEN		(1 << 8)
+#define S3C2410_ADCTSC_YM_SEN		(1<<7)
+#define S3C2410_ADCTSC_YP_SEN		(1<<6)
+#define S3C2410_ADCTSC_XM_SEN		(1<<5)
+#define S3C2410_ADCTSC_XP_SEN		(1<<4)
+#define S3C2410_ADCTSC_PULL_UP_DISABLE	(1<<3)
+#define S3C2410_ADCTSC_AUTO_PST		(1<<2)
+#define S3C2410_ADCTSC_XY_PST(x)	(((x)&0x3)<<0)
+
+/* ADCDAT0 Bits */
+#define S3C2410_ADCDAT0_UPDOWN		(1<<15)
+#define S3C2410_ADCDAT0_AUTO_PST	(1<<14)
+#define S3C2410_ADCDAT0_XY_PST		(0x3<<12)
+#define S3C2410_ADCDAT0_XPDATA_MASK	(0x03FF)
+
+/* ADCDAT1 Bits */
+#define S3C2410_ADCDAT1_UPDOWN		(1<<15)
+#define S3C2410_ADCDAT1_AUTO_PST	(1<<14)
+#define S3C2410_ADCDAT1_XY_PST		(0x3<<12)
+#define S3C2410_ADCDAT1_YPDATA_MASK	(0x03FF)
+
+
 #define TSC_SLEEP  (S3C2410_ADCTSC_PULL_UP_DISABLE | S3C2410_ADCTSC_XY_PST(0))
 
 #define INT_DOWN	(0)
diff --git a/drivers/power/supply/s3c_adc_battery.c b/drivers/power/supply/s3c_adc_battery.c
index 3d00b35cafc9..60b7f41ab063 100644
--- a/drivers/power/supply/s3c_adc_battery.c
+++ b/drivers/power/supply/s3c_adc_battery.c
@@ -22,7 +22,7 @@
 #include <linux/init.h>
 #include <linux/module.h>
 
-#include <plat/adc.h>
+#include <linux/soc/samsung/s3c-adc.h>
 
 #define BAT_POLL_INTERVAL		10000 /* ms */
 #define JITTER_DELAY			500 /* ms */
diff --git a/arch/arm/plat-samsung/include/plat/adc.h b/include/linux/soc/samsung/s3c-adc.h
similarity index 100%
rename from arch/arm/plat-samsung/include/plat/adc.h
rename to include/linux/soc/samsung/s3c-adc.h
-- 
2.20.0


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

* [PATCH 29/36] ARM: s3c: cpufreq: split out registers
       [not found] ` <20191010203043.1241612-1-arnd@arndb.de>
  2019-10-10 20:29   ` [PATCH 07/36] ARM: exynos: use private samsung_cpu_id copy Arnd Bergmann
  2019-10-10 20:29   ` [PATCH 15/36] ARM: s3c: adc: move header to linux/soc/samsung Arnd Bergmann
@ 2019-10-10 20:30   ` Arnd Bergmann
  2019-10-10 20:30   ` [PATCH 30/36] ARM: s3c: remove cpufreq header dependencies Arnd Bergmann
                     ` (2 subsequent siblings)
  5 siblings, 0 replies; 22+ messages in thread
From: Arnd Bergmann @ 2019-10-10 20:30 UTC (permalink / raw)
  To: Kukjin Kim, Krzysztof Kozlowski, Rafael J. Wysocki, Viresh Kumar
  Cc: linux-samsung-soc, linux-arm-kernel, linus.walleij,
	Arnd Bergmann, linux-pm, linux-kernel

Each of the cpufreq drivers uses a fixed set of register
bits, copy those definitions into the drivers to avoid
including mach/regs-clock.h.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/cpufreq/s3c2410-cpufreq.c | 11 +++++++++--
 drivers/cpufreq/s3c2412-cpufreq.c | 20 +++++++++++++++++++-
 drivers/cpufreq/s3c2440-cpufreq.c | 24 ++++++++++++++++++++++--
 drivers/cpufreq/s3c24xx-cpufreq.c |  4 +++-
 4 files changed, 53 insertions(+), 6 deletions(-)

diff --git a/drivers/cpufreq/s3c2410-cpufreq.c b/drivers/cpufreq/s3c2410-cpufreq.c
index 0c4f2ccd7e22..5c6cb590b63f 100644
--- a/drivers/cpufreq/s3c2410-cpufreq.c
+++ b/drivers/cpufreq/s3c2410-cpufreq.c
@@ -20,11 +20,18 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
-#include <mach/regs-clock.h>
-
 #include <plat/cpu.h>
 #include <plat/cpu-freq-core.h>
 
+#include <mach/map.h>
+
+#define S3C2410_CLKREG(x) ((x) + S3C24XX_VA_CLKPWR)
+
+#define S3C2410_CLKDIVN	    S3C2410_CLKREG(0x14)
+
+#define S3C2410_CLKDIVN_PDIVN	     (1<<0)
+#define S3C2410_CLKDIVN_HDIVN	     (1<<1)
+
 /* Note, 2410A has an extra mode for 1:4:4 ratio, bit 2 of CLKDIV */
 
 static void s3c2410_cpufreq_setdivs(struct s3c_cpufreq_config *cfg)
diff --git a/drivers/cpufreq/s3c2412-cpufreq.c b/drivers/cpufreq/s3c2412-cpufreq.c
index 53385a9ab957..d922d0d47c80 100644
--- a/drivers/cpufreq/s3c2412-cpufreq.c
+++ b/drivers/cpufreq/s3c2412-cpufreq.c
@@ -23,12 +23,30 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
-#include <mach/regs-clock.h>
 #include <mach/s3c2412.h>
 
 #include <plat/cpu.h>
 #include <plat/cpu-freq-core.h>
 
+#include <mach/map.h>
+
+#define S3C2410_CLKREG(x) ((x) + S3C24XX_VA_CLKPWR)
+
+#define S3C2410_CLKDIVN	    S3C2410_CLKREG(0x14)
+
+#define S3C2412_CLKDIVN_PDIVN		(1<<2)
+#define S3C2412_CLKDIVN_HDIVN_MASK	(3<<0)
+#define S3C2412_CLKDIVN_ARMDIVN		(1<<3)
+#define S3C2412_CLKDIVN_DVSEN		(1<<4)
+#define S3C2412_CLKDIVN_HALFHCLK	(1<<5)
+#define S3C2412_CLKDIVN_USB48DIV	(1<<6)
+#define S3C2412_CLKDIVN_UARTDIV_MASK	(15<<8)
+#define S3C2412_CLKDIVN_UARTDIV_SHIFT	(8)
+#define S3C2412_CLKDIVN_I2SDIV_MASK	(15<<12)
+#define S3C2412_CLKDIVN_I2SDIV_SHIFT	(12)
+#define S3C2412_CLKDIVN_CAMDIV_MASK	(15<<16)
+#define S3C2412_CLKDIVN_CAMDIV_SHIFT	(16)
+
 /* our clock resources. */
 static struct clk *xtal;
 static struct clk *fclk;
diff --git a/drivers/cpufreq/s3c2440-cpufreq.c b/drivers/cpufreq/s3c2440-cpufreq.c
index 3f772ba8896e..5fe7a891fa13 100644
--- a/drivers/cpufreq/s3c2440-cpufreq.c
+++ b/drivers/cpufreq/s3c2440-cpufreq.c
@@ -24,11 +24,31 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
-#include <mach/regs-clock.h>
-
 #include <plat/cpu.h>
 #include <plat/cpu-freq-core.h>
 
+#include <mach/map.h>
+
+#define S3C2410_CLKREG(x) ((x) + S3C24XX_VA_CLKPWR)
+#define S3C2410_CLKDIVN	    S3C2410_CLKREG(0x14)
+#define S3C2440_CAMDIVN	    S3C2410_CLKREG(0x18)
+
+#define S3C2440_CLKDIVN_PDIVN	     (1<<0)
+#define S3C2440_CLKDIVN_HDIVN_MASK   (3<<1)
+#define S3C2440_CLKDIVN_HDIVN_1      (0<<1)
+#define S3C2440_CLKDIVN_HDIVN_2      (1<<1)
+#define S3C2440_CLKDIVN_HDIVN_4_8    (2<<1)
+#define S3C2440_CLKDIVN_HDIVN_3_6    (3<<1)
+#define S3C2440_CLKDIVN_UCLK         (1<<3)
+
+#define S3C2440_CAMDIVN_CAMCLK_MASK  (0xf<<0)
+#define S3C2440_CAMDIVN_CAMCLK_SEL   (1<<4)
+#define S3C2440_CAMDIVN_HCLK3_HALF   (1<<8)
+#define S3C2440_CAMDIVN_HCLK4_HALF   (1<<9)
+#define S3C2440_CAMDIVN_DVSEN        (1<<12)
+
+#define S3C2442_CAMDIVN_CAMCLK_DIV3  (1<<5)
+
 static struct clk *xtal;
 static struct clk *fclk;
 static struct clk *hclk;
diff --git a/drivers/cpufreq/s3c24xx-cpufreq.c b/drivers/cpufreq/s3c24xx-cpufreq.c
index ed0e713b1b57..c786e1197d3c 100644
--- a/drivers/cpufreq/s3c24xx-cpufreq.c
+++ b/drivers/cpufreq/s3c24xx-cpufreq.c
@@ -28,9 +28,11 @@
 #include <plat/cpu.h>
 #include <plat/cpu-freq-core.h>
 
-#include <mach/regs-clock.h>
+#include <mach/map.h>
 
 /* note, cpufreq support deals in kHz, no Hz */
+#define S3C2410_CLKREG(x) ((x) + S3C24XX_VA_CLKPWR)
+#define S3C2410_MPLLCON     S3C2410_CLKREG(0x04)
 
 static struct cpufreq_driver s3c24xx_driver;
 static struct s3c_cpufreq_config cpu_cur;
-- 
2.20.0


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

* [PATCH 30/36] ARM: s3c: remove cpufreq header dependencies
       [not found] ` <20191010203043.1241612-1-arnd@arndb.de>
                     ` (2 preceding siblings ...)
  2019-10-10 20:30   ` [PATCH 29/36] ARM: s3c: cpufreq: split out registers Arnd Bergmann
@ 2019-10-10 20:30   ` Arnd Bergmann
  2019-10-23 13:38     ` Krzysztof Kozlowski
  2019-10-10 20:30   ` [PATCH 31/36] ARM: s3c: cpufreq: use global s3c2412_cpufreq_setrefresh Arnd Bergmann
  2019-10-10 20:30   ` [PATCH 33/36] ARM: s3c: move low-level clk reg access into platform code Arnd Bergmann
  5 siblings, 1 reply; 22+ messages in thread
From: Arnd Bergmann @ 2019-10-10 20:30 UTC (permalink / raw)
  To: Kukjin Kim, Krzysztof Kozlowski, Rafael J. Wysocki, Viresh Kumar
  Cc: linux-samsung-soc, linux-arm-kernel, linus.walleij,
	Arnd Bergmann, linux-kernel, linux-pm

The cpufreq drivers are split between the machine directory
and the drivers/cpufreq directory. In order to share header
files after we convert s3c to multiplatform, those headers
have to live in a different global location.

Move them to linux/soc/samsung/ in lack of a better place.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-s3c24xx/common.c                         |  1 -
 arch/arm/mach-s3c24xx/cpufreq-utils.c                  |  2 +-
 arch/arm/mach-s3c24xx/iotiming-s3c2410.c               |  2 +-
 arch/arm/mach-s3c24xx/iotiming-s3c2412.c               |  2 +-
 arch/arm/mach-s3c24xx/mach-bast.c                      |  2 +-
 arch/arm/mach-s3c24xx/mach-osiris-dvs.c                |  2 +-
 arch/arm/mach-s3c24xx/mach-osiris.c                    |  2 +-
 arch/arm/mach-s3c24xx/pll-s3c2410.c                    |  4 ++--
 arch/arm/mach-s3c24xx/pll-s3c2440-12000000.c           |  4 ++--
 arch/arm/mach-s3c24xx/pll-s3c2440-16934400.c           |  4 ++--
 arch/arm/mach-s3c24xx/s3c2410.c                        |  1 -
 arch/arm/mach-s3c24xx/s3c2412.c                        |  1 -
 arch/arm/mach-s3c24xx/s3c244x.c                        |  2 --
 arch/arm/mach-s3c64xx/s3c6400.c                        |  1 -
 arch/arm/mach-s3c64xx/s3c6410.c                        |  2 +-
 arch/arm/plat-samsung/include/plat/cpu.h               |  9 ---------
 drivers/cpufreq/s3c2410-cpufreq.c                      |  5 ++---
 drivers/cpufreq/s3c2412-cpufreq.c                      |  5 ++---
 drivers/cpufreq/s3c2440-cpufreq.c                      |  5 ++---
 drivers/cpufreq/s3c24xx-cpufreq-debugfs.c              |  2 +-
 drivers/cpufreq/s3c24xx-cpufreq.c                      |  5 ++---
 .../linux/soc/samsung/s3c-cpu-freq.h                   |  0
 .../linux/soc/samsung/s3c-cpufreq-core.h               |  2 +-
 include/linux/soc/samsung/s3c-pm.h                     | 10 ++++++++++
 24 files changed, 33 insertions(+), 42 deletions(-)
 rename arch/arm/plat-samsung/include/plat/cpu-freq.h => include/linux/soc/samsung/s3c-cpu-freq.h (100%)
 rename arch/arm/plat-samsung/include/plat/cpu-freq-core.h => include/linux/soc/samsung/s3c-cpufreq-core.h (99%)

diff --git a/arch/arm/mach-s3c24xx/common.c b/arch/arm/mach-s3c24xx/common.c
index ebf6bde67816..d16a164df6c4 100644
--- a/arch/arm/mach-s3c24xx/common.c
+++ b/arch/arm/mach-s3c24xx/common.c
@@ -35,7 +35,6 @@
 
 #include <plat/cpu.h>
 #include <plat/devs.h>
-#include <plat/cpu-freq.h>
 #include <plat/pwm-core.h>
 
 #include "common.h"
diff --git a/arch/arm/mach-s3c24xx/cpufreq-utils.c b/arch/arm/mach-s3c24xx/cpufreq-utils.c
index 1a7f38d085dd..43ab714eaa9e 100644
--- a/arch/arm/mach-s3c24xx/cpufreq-utils.c
+++ b/arch/arm/mach-s3c24xx/cpufreq-utils.c
@@ -15,7 +15,7 @@
 #include <mach/map.h>
 #include <mach/regs-clock.h>
 
-#include <plat/cpu-freq-core.h>
+#include <linux/soc/samsung/s3c-cpufreq-core.h>
 
 #include "regs-mem.h"
 
diff --git a/arch/arm/mach-s3c24xx/iotiming-s3c2410.c b/arch/arm/mach-s3c24xx/iotiming-s3c2410.c
index 9f90aaf70bf3..5b3b16dd0ce8 100644
--- a/arch/arm/mach-s3c24xx/iotiming-s3c2410.c
+++ b/arch/arm/mach-s3c24xx/iotiming-s3c2410.c
@@ -17,7 +17,7 @@
 #include <mach/map.h>
 #include <mach/regs-clock.h>
 
-#include <plat/cpu-freq-core.h>
+#include <linux/soc/samsung/s3c-cpufreq-core.h>
 
 #include "regs-mem.h"
 
diff --git a/arch/arm/mach-s3c24xx/iotiming-s3c2412.c b/arch/arm/mach-s3c24xx/iotiming-s3c2412.c
index 59356d10fbcf..a22b5611697d 100644
--- a/arch/arm/mach-s3c24xx/iotiming-s3c2412.c
+++ b/arch/arm/mach-s3c24xx/iotiming-s3c2412.c
@@ -24,7 +24,7 @@
 #include <asm/mach/map.h>
 
 #include <plat/cpu.h>
-#include <plat/cpu-freq-core.h>
+#include <linux/soc/samsung/s3c-cpufreq-core.h>
 
 #include <mach/s3c2412.h>
 
diff --git a/arch/arm/mach-s3c24xx/mach-bast.c b/arch/arm/mach-s3c24xx/mach-bast.c
index cc941b5030ea..b2f2d036bca2 100644
--- a/arch/arm/mach-s3c24xx/mach-bast.c
+++ b/arch/arm/mach-s3c24xx/mach-bast.c
@@ -46,7 +46,7 @@
 #include <mach/gpio-samsung.h>
 
 #include <plat/cpu.h>
-#include <plat/cpu-freq.h>
+#include <linux/soc/samsung/s3c-cpu-freq.h>
 #include <plat/devs.h>
 #include <plat/gpio-cfg.h>
 #include <plat/samsung-time.h>
diff --git a/arch/arm/mach-s3c24xx/mach-osiris-dvs.c b/arch/arm/mach-s3c24xx/mach-osiris-dvs.c
index 5d819b6ea428..1250520b3bcc 100644
--- a/arch/arm/mach-s3c24xx/mach-osiris-dvs.c
+++ b/arch/arm/mach-s3c24xx/mach-osiris-dvs.c
@@ -14,7 +14,7 @@
 
 #include <linux/mfd/tps65010.h>
 
-#include <plat/cpu-freq.h>
+#include <linux/soc/samsung/s3c-cpu-freq.h>
 #include <mach/gpio-samsung.h>
 
 #define OSIRIS_GPIO_DVS	S3C2410_GPB(5)
diff --git a/arch/arm/mach-s3c24xx/mach-osiris.c b/arch/arm/mach-s3c24xx/mach-osiris.c
index 262e77bd48de..674164264076 100644
--- a/arch/arm/mach-s3c24xx/mach-osiris.c
+++ b/arch/arm/mach-s3c24xx/mach-osiris.c
@@ -37,7 +37,7 @@
 #include <linux/mtd/partitions.h>
 
 #include <plat/cpu.h>
-#include <plat/cpu-freq.h>
+#include <linux/soc/samsung/s3c-cpu-freq.h>
 #include <plat/devs.h>
 #include <plat/gpio-cfg.h>
 #include <plat/samsung-time.h>
diff --git a/arch/arm/mach-s3c24xx/pll-s3c2410.c b/arch/arm/mach-s3c24xx/pll-s3c2410.c
index 0561f79ddce8..3fbc99eaa4a2 100644
--- a/arch/arm/mach-s3c24xx/pll-s3c2410.c
+++ b/arch/arm/mach-s3c24xx/pll-s3c2410.c
@@ -15,8 +15,8 @@
 #include <linux/clk.h>
 #include <linux/err.h>
 
-#include <plat/cpu.h>
-#include <plat/cpu-freq-core.h>
+#include <linux/soc/samsung/s3c-cpufreq-core.h>
+#include <linux/soc/samsung/s3c-pm.h>
 
 /* This array should be sorted in ascending order of the frequencies */
 static struct cpufreq_frequency_table pll_vals_12MHz[] = {
diff --git a/arch/arm/mach-s3c24xx/pll-s3c2440-12000000.c b/arch/arm/mach-s3c24xx/pll-s3c2440-12000000.c
index 2ec3a2f9a6a5..fdb8e8c2fe3b 100644
--- a/arch/arm/mach-s3c24xx/pll-s3c2440-12000000.c
+++ b/arch/arm/mach-s3c24xx/pll-s3c2440-12000000.c
@@ -13,8 +13,8 @@
 #include <linux/clk.h>
 #include <linux/err.h>
 
-#include <plat/cpu.h>
-#include <plat/cpu-freq-core.h>
+#include <linux/soc/samsung/s3c-cpufreq-core.h>
+#include <linux/soc/samsung/s3c-pm.h>
 
 /* This array should be sorted in ascending order of the frequencies */
 static struct cpufreq_frequency_table s3c2440_plls_12[] = {
diff --git a/arch/arm/mach-s3c24xx/pll-s3c2440-16934400.c b/arch/arm/mach-s3c24xx/pll-s3c2440-16934400.c
index 4b3d9e36c6bb..438b6fc099a4 100644
--- a/arch/arm/mach-s3c24xx/pll-s3c2440-16934400.c
+++ b/arch/arm/mach-s3c24xx/pll-s3c2440-16934400.c
@@ -13,8 +13,8 @@
 #include <linux/clk.h>
 #include <linux/err.h>
 
-#include <plat/cpu.h>
-#include <plat/cpu-freq-core.h>
+#include <linux/soc/samsung/s3c-cpufreq-core.h>
+#include <linux/soc/samsung/s3c-pm.h>
 
 /* This array should be sorted in ascending order of the frequencies */
 static struct cpufreq_frequency_table s3c2440_plls_169344[] = {
diff --git a/arch/arm/mach-s3c24xx/s3c2410.c b/arch/arm/mach-s3c24xx/s3c2410.c
index 21fd5404bc98..8427c150dd22 100644
--- a/arch/arm/mach-s3c24xx/s3c2410.c
+++ b/arch/arm/mach-s3c24xx/s3c2410.c
@@ -30,7 +30,6 @@
 #include <asm/irq.h>
 #include <asm/system_misc.h>
 
-#include <plat/cpu-freq.h>
 
 #include <mach/regs-clock.h>
 
diff --git a/arch/arm/mach-s3c24xx/s3c2412.c b/arch/arm/mach-s3c24xx/s3c2412.c
index c3fb3e6c0dd8..209f952a6c98 100644
--- a/arch/arm/mach-s3c24xx/s3c2412.c
+++ b/arch/arm/mach-s3c24xx/s3c2412.c
@@ -34,7 +34,6 @@
 #include <mach/regs-gpio.h>
 
 #include <plat/cpu.h>
-#include <plat/cpu-freq.h>
 #include <plat/devs.h>
 #include <plat/pm.h>
 
diff --git a/arch/arm/mach-s3c24xx/s3c244x.c b/arch/arm/mach-s3c24xx/s3c244x.c
index a75f588b9d45..f5bd489bac85 100644
--- a/arch/arm/mach-s3c24xx/s3c244x.c
+++ b/arch/arm/mach-s3c24xx/s3c244x.c
@@ -28,8 +28,6 @@
 #include <mach/hardware.h>
 #include <asm/irq.h>
 
-#include <plat/cpu-freq.h>
-
 #include <mach/regs-clock.h>
 #include <mach/regs-gpio.h>
 
diff --git a/arch/arm/mach-s3c64xx/s3c6400.c b/arch/arm/mach-s3c64xx/s3c6400.c
index 81233495d548..d18af724c807 100644
--- a/arch/arm/mach-s3c64xx/s3c6400.c
+++ b/arch/arm/mach-s3c64xx/s3c6400.c
@@ -28,7 +28,6 @@
 
 #include <asm/irq.h>
 
-#include <plat/cpu-freq.h>
 #include <mach/regs-clock.h>
 
 #include <plat/cpu.h>
diff --git a/arch/arm/mach-s3c64xx/s3c6410.c b/arch/arm/mach-s3c64xx/s3c6410.c
index 9465a6e0f068..b1d725e55cd2 100644
--- a/arch/arm/mach-s3c64xx/s3c6410.c
+++ b/arch/arm/mach-s3c64xx/s3c6410.c
@@ -29,7 +29,7 @@
 
 #include <asm/irq.h>
 
-#include <plat/cpu-freq.h>
+#include <linux/soc/samsung/s3c-pm.h>
 #include <mach/regs-clock.h>
 
 #include <plat/cpu.h>
diff --git a/arch/arm/plat-samsung/include/plat/cpu.h b/arch/arm/plat-samsung/include/plat/cpu.h
index 02d7f991d5a3..9dfd58bcc03d 100644
--- a/arch/arm/plat-samsung/include/plat/cpu.h
+++ b/arch/arm/plat-samsung/include/plat/cpu.h
@@ -124,15 +124,6 @@ extern struct syscore_ops s3c2412_pm_syscore_ops;
 extern struct syscore_ops s3c2416_pm_syscore_ops;
 extern struct syscore_ops s3c244x_pm_syscore_ops;
 
-/* system device subsystems */
-
-extern struct bus_type s3c2410_subsys;
-extern struct bus_type s3c2410a_subsys;
-extern struct bus_type s3c2412_subsys;
-extern struct bus_type s3c2416_subsys;
-extern struct bus_type s3c2440_subsys;
-extern struct bus_type s3c2442_subsys;
-extern struct bus_type s3c2443_subsys;
 extern struct bus_type s3c6410_subsys;
 
 #endif
diff --git a/drivers/cpufreq/s3c2410-cpufreq.c b/drivers/cpufreq/s3c2410-cpufreq.c
index 5c6cb590b63f..9c2f29cacdd0 100644
--- a/drivers/cpufreq/s3c2410-cpufreq.c
+++ b/drivers/cpufreq/s3c2410-cpufreq.c
@@ -16,13 +16,12 @@
 #include <linux/clk.h>
 #include <linux/err.h>
 #include <linux/io.h>
+#include <linux/soc/samsung/s3c-cpufreq-core.h>
+#include <linux/soc/samsung/s3c-pm.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
-#include <plat/cpu.h>
-#include <plat/cpu-freq-core.h>
-
 #include <mach/map.h>
 
 #define S3C2410_CLKREG(x) ((x) + S3C24XX_VA_CLKPWR)
diff --git a/drivers/cpufreq/s3c2412-cpufreq.c b/drivers/cpufreq/s3c2412-cpufreq.c
index d922d0d47c80..38dc9e6db633 100644
--- a/drivers/cpufreq/s3c2412-cpufreq.c
+++ b/drivers/cpufreq/s3c2412-cpufreq.c
@@ -19,15 +19,14 @@
 #include <linux/clk.h>
 #include <linux/err.h>
 #include <linux/io.h>
+#include <linux/soc/samsung/s3c-cpufreq-core.h>
+#include <linux/soc/samsung/s3c-pm.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
 #include <mach/s3c2412.h>
 
-#include <plat/cpu.h>
-#include <plat/cpu-freq-core.h>
-
 #include <mach/map.h>
 
 #define S3C2410_CLKREG(x) ((x) + S3C24XX_VA_CLKPWR)
diff --git a/drivers/cpufreq/s3c2440-cpufreq.c b/drivers/cpufreq/s3c2440-cpufreq.c
index 5fe7a891fa13..442abdccb9c1 100644
--- a/drivers/cpufreq/s3c2440-cpufreq.c
+++ b/drivers/cpufreq/s3c2440-cpufreq.c
@@ -20,13 +20,12 @@
 #include <linux/clk.h>
 #include <linux/err.h>
 #include <linux/io.h>
+#include <linux/soc/samsung/s3c-cpufreq-core.h>
+#include <linux/soc/samsung/s3c-pm.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
-#include <plat/cpu.h>
-#include <plat/cpu-freq-core.h>
-
 #include <mach/map.h>
 
 #define S3C2410_CLKREG(x) ((x) + S3C24XX_VA_CLKPWR)
diff --git a/drivers/cpufreq/s3c24xx-cpufreq-debugfs.c b/drivers/cpufreq/s3c24xx-cpufreq-debugfs.c
index 290e3539d03e..93971dfe7c75 100644
--- a/drivers/cpufreq/s3c24xx-cpufreq-debugfs.c
+++ b/drivers/cpufreq/s3c24xx-cpufreq-debugfs.c
@@ -18,7 +18,7 @@
 #include <linux/seq_file.h>
 #include <linux/err.h>
 
-#include <plat/cpu-freq-core.h>
+#include <linux/soc/samsung/s3c-cpufreq-core.h>
 
 static struct dentry *dbgfs_root;
 static struct dentry *dbgfs_file_io;
diff --git a/drivers/cpufreq/s3c24xx-cpufreq.c b/drivers/cpufreq/s3c24xx-cpufreq.c
index c786e1197d3c..01b1823ea208 100644
--- a/drivers/cpufreq/s3c24xx-cpufreq.c
+++ b/drivers/cpufreq/s3c24xx-cpufreq.c
@@ -21,13 +21,12 @@
 #include <linux/device.h>
 #include <linux/sysfs.h>
 #include <linux/slab.h>
+#include <linux/soc/samsung/s3c-cpufreq-core.h>
+#include <linux/soc/samsung/s3c-pm.h>
 
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
-#include <plat/cpu.h>
-#include <plat/cpu-freq-core.h>
-
 #include <mach/map.h>
 
 /* note, cpufreq support deals in kHz, no Hz */
diff --git a/arch/arm/plat-samsung/include/plat/cpu-freq.h b/include/linux/soc/samsung/s3c-cpu-freq.h
similarity index 100%
rename from arch/arm/plat-samsung/include/plat/cpu-freq.h
rename to include/linux/soc/samsung/s3c-cpu-freq.h
diff --git a/arch/arm/plat-samsung/include/plat/cpu-freq-core.h b/include/linux/soc/samsung/s3c-cpufreq-core.h
similarity index 99%
rename from arch/arm/plat-samsung/include/plat/cpu-freq-core.h
rename to include/linux/soc/samsung/s3c-cpufreq-core.h
index 2c7cf2665634..4d22be1031b9 100644
--- a/arch/arm/plat-samsung/include/plat/cpu-freq-core.h
+++ b/include/linux/soc/samsung/s3c-cpufreq-core.h
@@ -7,7 +7,7 @@
  * S3C CPU frequency scaling support - core support
  */
 
-#include <plat/cpu-freq.h>
+#include <linux/soc/samsung/s3c-cpu-freq.h>
 
 struct seq_file;
 
diff --git a/include/linux/soc/samsung/s3c-pm.h b/include/linux/soc/samsung/s3c-pm.h
index d477b314d034..55935993a111 100644
--- a/include/linux/soc/samsung/s3c-pm.h
+++ b/include/linux/soc/samsung/s3c-pm.h
@@ -81,4 +81,14 @@ extern void s3c_pm_check_store(void);
 #define s3c_pm_check_store()   do { } while (0)
 #endif
 
+/* system device subsystems */
+
+extern struct bus_type s3c2410_subsys;
+extern struct bus_type s3c2410a_subsys;
+extern struct bus_type s3c2412_subsys;
+extern struct bus_type s3c2416_subsys;
+extern struct bus_type s3c2440_subsys;
+extern struct bus_type s3c2442_subsys;
+extern struct bus_type s3c2443_subsys;
+
 #endif
-- 
2.20.0


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

* [PATCH 31/36] ARM: s3c: cpufreq: use global s3c2412_cpufreq_setrefresh
       [not found] ` <20191010203043.1241612-1-arnd@arndb.de>
                     ` (3 preceding siblings ...)
  2019-10-10 20:30   ` [PATCH 30/36] ARM: s3c: remove cpufreq header dependencies Arnd Bergmann
@ 2019-10-10 20:30   ` Arnd Bergmann
  2019-10-23 13:44     ` Krzysztof Kozlowski
  2019-10-10 20:30   ` [PATCH 33/36] ARM: s3c: move low-level clk reg access into platform code Arnd Bergmann
  5 siblings, 1 reply; 22+ messages in thread
From: Arnd Bergmann @ 2019-10-10 20:30 UTC (permalink / raw)
  To: Kukjin Kim, Krzysztof Kozlowski, Rafael J. Wysocki, Viresh Kumar
  Cc: linux-samsung-soc, linux-arm-kernel, linus.walleij,
	Arnd Bergmann, linux-pm, linux-kernel

There are two identical copies of the s3c2412_cpufreq_setrefresh
function: a static one in the cpufreq driver and a global
version in iotiming-s3c2412.c.

As the function requires the use of a hardcoded register address
from a header that we want to not be visible to drivers, just
move the existing global function and add a declaration in
one of the cpufreq header files.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/cpufreq/s3c2412-cpufreq.c            | 23 --------------------
 include/linux/soc/samsung/s3c-cpufreq-core.h |  1 +
 2 files changed, 1 insertion(+), 23 deletions(-)

diff --git a/drivers/cpufreq/s3c2412-cpufreq.c b/drivers/cpufreq/s3c2412-cpufreq.c
index 38dc9e6db633..a77c63e92e1a 100644
--- a/drivers/cpufreq/s3c2412-cpufreq.c
+++ b/drivers/cpufreq/s3c2412-cpufreq.c
@@ -25,8 +25,6 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
-#include <mach/s3c2412.h>
-
 #include <mach/map.h>
 
 #define S3C2410_CLKREG(x) ((x) + S3C24XX_VA_CLKPWR)
@@ -156,27 +154,6 @@ static void s3c2412_cpufreq_setdivs(struct s3c_cpufreq_config *cfg)
 	clk_set_parent(armclk, cfg->divs.dvs ? hclk : fclk);
 }
 
-static void s3c2412_cpufreq_setrefresh(struct s3c_cpufreq_config *cfg)
-{
-	struct s3c_cpufreq_board *board = cfg->board;
-	unsigned long refresh;
-
-	s3c_freq_dbg("%s: refresh %u ns, hclk %lu\n", __func__,
-		     board->refresh, cfg->freq.hclk);
-
-	/* Reduce both the refresh time (in ns) and the frequency (in MHz)
-	 * by 10 each to ensure that we do not overflow 32 bit numbers. This
-	 * should work for HCLK up to 133MHz and refresh period up to 30usec.
-	 */
-
-	refresh = (board->refresh / 10);
-	refresh *= (cfg->freq.hclk / 100);
-	refresh /= (1 * 1000 * 1000);	/* 10^6 */
-
-	s3c_freq_dbg("%s: setting refresh 0x%08lx\n", __func__, refresh);
-	__raw_writel(refresh, S3C2412_REFRESH);
-}
-
 /* set the default cpu frequency information, based on an 200MHz part
  * as we have no other way of detecting the speed rating in software.
  */
diff --git a/include/linux/soc/samsung/s3c-cpufreq-core.h b/include/linux/soc/samsung/s3c-cpufreq-core.h
index 4d22be1031b9..eca942559014 100644
--- a/include/linux/soc/samsung/s3c-cpufreq-core.h
+++ b/include/linux/soc/samsung/s3c-cpufreq-core.h
@@ -246,6 +246,7 @@ extern int s3c2412_iotiming_calc(struct s3c_cpufreq_config *cfg,
 
 extern void s3c2412_iotiming_set(struct s3c_cpufreq_config *cfg,
 				 struct s3c_iotimings *iot);
+extern void s3c2412_cpufreq_setrefresh(struct s3c_cpufreq_config *cfg);
 #else
 #define s3c2412_iotiming_debugfs NULL
 #define s3c2412_iotiming_calc NULL
-- 
2.20.0


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

* [PATCH 33/36] ARM: s3c: move low-level clk reg access into platform code
       [not found] ` <20191010203043.1241612-1-arnd@arndb.de>
                     ` (4 preceding siblings ...)
  2019-10-10 20:30   ` [PATCH 31/36] ARM: s3c: cpufreq: use global s3c2412_cpufreq_setrefresh Arnd Bergmann
@ 2019-10-10 20:30   ` Arnd Bergmann
  2019-10-23 13:49     ` Krzysztof Kozlowski
  5 siblings, 1 reply; 22+ messages in thread
From: Arnd Bergmann @ 2019-10-10 20:30 UTC (permalink / raw)
  To: Kukjin Kim, Krzysztof Kozlowski, Rafael J. Wysocki, Viresh Kumar
  Cc: linux-samsung-soc, linux-arm-kernel, linus.walleij,
	Arnd Bergmann, linux-kernel, linux-pm

Rather than have the cpufreq drivers touch include the
common headers to get the constants, add a small indirection.
This is still not the proper way that would do this through
the common clk API, but it lets us kill off the header file
usage.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-s3c24xx/Makefile               |  2 +-
 arch/arm/mach-s3c24xx/cpufreq-utils.c        | 32 ++++++++++++++++++++
 drivers/cpufreq/s3c2410-cpufreq.c            |  8 +----
 drivers/cpufreq/s3c2412-cpufreq.c            | 10 ++----
 drivers/cpufreq/s3c2440-cpufreq.c            | 16 +++-------
 drivers/cpufreq/s3c24xx-cpufreq.c            | 11 ++-----
 include/linux/soc/samsung/s3c-cpufreq-core.h |  7 +++++
 7 files changed, 51 insertions(+), 35 deletions(-)

diff --git a/arch/arm/mach-s3c24xx/Makefile b/arch/arm/mach-s3c24xx/Makefile
index 695573df00b1..195a4cb23ecb 100644
--- a/arch/arm/mach-s3c24xx/Makefile
+++ b/arch/arm/mach-s3c24xx/Makefile
@@ -38,7 +38,7 @@ obj-$(CONFIG_PM_SLEEP)		+= irq-pm.o sleep.o
 
 # common code
 
-obj-$(CONFIG_S3C2410_CPUFREQ_UTILS) += cpufreq-utils.o
+obj-$(CONFIG_ARM_S3C24XX_CPUFREQ) += cpufreq-utils.o
 
 obj-$(CONFIG_S3C2410_IOTIMING)	+= iotiming-s3c2410.o
 obj-$(CONFIG_S3C2412_IOTIMING)	+= iotiming-s3c2412.o
diff --git a/arch/arm/mach-s3c24xx/cpufreq-utils.c b/arch/arm/mach-s3c24xx/cpufreq-utils.c
index 43ab714eaa9e..75c197d59a75 100644
--- a/arch/arm/mach-s3c24xx/cpufreq-utils.c
+++ b/arch/arm/mach-s3c24xx/cpufreq-utils.c
@@ -60,3 +60,35 @@ void s3c2410_set_fvco(struct s3c_cpufreq_config *cfg)
 	if (!IS_ERR(cfg->mpll))
 		clk_set_rate(cfg->mpll, cfg->pll.frequency);
 }
+
+#if defined(CONFIG_CPU_S3C2440) || defined(CONFIG_CPU_S3C2442)
+u32 s3c2440_read_camdivn()
+{
+	return __raw_readl(S3C2440_CAMDIVN);
+}
+
+void s3c2440_write_camdivn(u32 camdiv)
+{
+	__raw_writel(camdiv, S3C2440_CAMDIVN);
+}
+#endif
+
+u32 s3c24xx_read_clkdivn()
+{
+	return __raw_readl(S3C2410_CLKDIVN);
+}
+
+void s3c24xx_write_clkdivn(u32 clkdiv)
+{
+	__raw_writel(clkdiv, S3C2410_CLKDIVN);
+}
+
+u32 s3c24xx_read_mpllcon()
+{
+	return __raw_readl(S3C2410_MPLLCON);
+}
+
+void s3c24xx_write_locktime(u32 locktime)
+{
+	return __raw_writel(locktime, S3C2410_LOCKTIME);
+}
diff --git a/drivers/cpufreq/s3c2410-cpufreq.c b/drivers/cpufreq/s3c2410-cpufreq.c
index 9c2f29cacdd0..5dcfbf0bfb74 100644
--- a/drivers/cpufreq/s3c2410-cpufreq.c
+++ b/drivers/cpufreq/s3c2410-cpufreq.c
@@ -22,12 +22,6 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
-#include <mach/map.h>
-
-#define S3C2410_CLKREG(x) ((x) + S3C24XX_VA_CLKPWR)
-
-#define S3C2410_CLKDIVN	    S3C2410_CLKREG(0x14)
-
 #define S3C2410_CLKDIVN_PDIVN	     (1<<0)
 #define S3C2410_CLKDIVN_HDIVN	     (1<<1)
 
@@ -43,7 +37,7 @@ static void s3c2410_cpufreq_setdivs(struct s3c_cpufreq_config *cfg)
 	if (cfg->divs.p_divisor != cfg->divs.h_divisor)
 		clkdiv |= S3C2410_CLKDIVN_PDIVN;
 
-	__raw_writel(clkdiv, S3C2410_CLKDIVN);
+	s3c24xx_write_clkdivn(clkdiv);
 }
 
 static int s3c2410_cpufreq_calcdivs(struct s3c_cpufreq_config *cfg)
diff --git a/drivers/cpufreq/s3c2412-cpufreq.c b/drivers/cpufreq/s3c2412-cpufreq.c
index a77c63e92e1a..5945945ead7c 100644
--- a/drivers/cpufreq/s3c2412-cpufreq.c
+++ b/drivers/cpufreq/s3c2412-cpufreq.c
@@ -25,12 +25,6 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
-#include <mach/map.h>
-
-#define S3C2410_CLKREG(x) ((x) + S3C24XX_VA_CLKPWR)
-
-#define S3C2410_CLKDIVN	    S3C2410_CLKREG(0x14)
-
 #define S3C2412_CLKDIVN_PDIVN		(1<<2)
 #define S3C2412_CLKDIVN_HDIVN_MASK	(3<<0)
 #define S3C2412_CLKDIVN_ARMDIVN		(1<<3)
@@ -132,7 +126,7 @@ static void s3c2412_cpufreq_setdivs(struct s3c_cpufreq_config *cfg)
 	unsigned long clkdiv;
 	unsigned long olddiv;
 
-	olddiv = clkdiv = __raw_readl(S3C2410_CLKDIVN);
+	olddiv = clkdiv = s3c24xx_read_clkdivn();
 
 	/* clear off current clock info */
 
@@ -149,7 +143,7 @@ static void s3c2412_cpufreq_setdivs(struct s3c_cpufreq_config *cfg)
 		clkdiv |= S3C2412_CLKDIVN_PDIVN;
 
 	s3c_freq_dbg("%s: div %08lx => %08lx\n", __func__, olddiv, clkdiv);
-	__raw_writel(clkdiv, S3C2410_CLKDIVN);
+	s3c24xx_write_clkdivn(clkdiv);
 
 	clk_set_parent(armclk, cfg->divs.dvs ? hclk : fclk);
 }
diff --git a/drivers/cpufreq/s3c2440-cpufreq.c b/drivers/cpufreq/s3c2440-cpufreq.c
index 442abdccb9c1..148e8aedefa9 100644
--- a/drivers/cpufreq/s3c2440-cpufreq.c
+++ b/drivers/cpufreq/s3c2440-cpufreq.c
@@ -26,12 +26,6 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
-#include <mach/map.h>
-
-#define S3C2410_CLKREG(x) ((x) + S3C24XX_VA_CLKPWR)
-#define S3C2410_CLKDIVN	    S3C2410_CLKREG(0x14)
-#define S3C2440_CAMDIVN	    S3C2410_CLKREG(0x18)
-
 #define S3C2440_CLKDIVN_PDIVN	     (1<<0)
 #define S3C2440_CLKDIVN_HDIVN_MASK   (3<<1)
 #define S3C2440_CLKDIVN_HDIVN_1      (0<<1)
@@ -162,8 +156,8 @@ static void s3c2440_cpufreq_setdivs(struct s3c_cpufreq_config *cfg)
 	s3c_freq_dbg("%s: divisors: h=%d, p=%d\n", __func__,
 		     cfg->divs.h_divisor, cfg->divs.p_divisor);
 
-	clkdiv = __raw_readl(S3C2410_CLKDIVN);
-	camdiv = __raw_readl(S3C2440_CAMDIVN);
+	clkdiv = s3c24xx_read_clkdivn();
+	camdiv = s3c2440_read_camdivn();
 
 	clkdiv &= ~(S3C2440_CLKDIVN_HDIVN_MASK | S3C2440_CLKDIVN_PDIVN);
 	camdiv &= ~CAMDIVN_HCLK_HALF;
@@ -203,11 +197,11 @@ static void s3c2440_cpufreq_setdivs(struct s3c_cpufreq_config *cfg)
 	 * then make a short delay and remove the hclk halving if necessary.
 	 */
 
-	__raw_writel(camdiv | CAMDIVN_HCLK_HALF, S3C2440_CAMDIVN);
-	__raw_writel(clkdiv, S3C2410_CLKDIVN);
+	s3c2440_write_camdivn(camdiv | CAMDIVN_HCLK_HALF);
+	s3c24xx_write_clkdivn(clkdiv);
 
 	ndelay(20);
-	__raw_writel(camdiv, S3C2440_CAMDIVN);
+	s3c2440_write_camdivn(camdiv);
 
 	clk_set_parent(armclk, cfg->divs.dvs ? hclk : fclk);
 }
diff --git a/drivers/cpufreq/s3c24xx-cpufreq.c b/drivers/cpufreq/s3c24xx-cpufreq.c
index 01b1823ea208..37efc0dc3f91 100644
--- a/drivers/cpufreq/s3c24xx-cpufreq.c
+++ b/drivers/cpufreq/s3c24xx-cpufreq.c
@@ -27,12 +27,7 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
 
-#include <mach/map.h>
-
 /* note, cpufreq support deals in kHz, no Hz */
-#define S3C2410_CLKREG(x) ((x) + S3C24XX_VA_CLKPWR)
-#define S3C2410_MPLLCON     S3C2410_CLKREG(0x04)
-
 static struct cpufreq_driver s3c24xx_driver;
 static struct s3c_cpufreq_config cpu_cur;
 static struct s3c_iotimings s3c24xx_iotiming;
@@ -69,7 +64,7 @@ static void s3c_cpufreq_getcur(struct s3c_cpufreq_config *cfg)
 	cfg->freq.pclk = pclk = clk_get_rate(clk_pclk);
 	cfg->freq.armclk = armclk = clk_get_rate(clk_arm);
 
-	cfg->pll.driver_data = __raw_readl(S3C2410_MPLLCON);
+	cfg->pll.driver_data = s3c24xx_read_mpllcon();
 	cfg->pll.frequency = fclk;
 
 	cfg->freq.hclk_tns = 1000000000 / (cfg->freq.hclk / 10);
@@ -387,7 +382,7 @@ static unsigned int suspend_freq;
 static int s3c_cpufreq_suspend(struct cpufreq_policy *policy)
 {
 	suspend_pll.frequency = clk_get_rate(_clk_mpll);
-	suspend_pll.driver_data = __raw_readl(S3C2410_MPLLCON);
+	suspend_pll.driver_data = s3c24xx_read_mpllcon();
 	suspend_freq = clk_get_rate(clk_arm);
 
 	return 0;
@@ -548,7 +543,7 @@ static void s3c_cpufreq_update_loctkime(void)
 	val |= calc_locktime(rate, cpu_cur.info->locktime_m);
 
 	pr_info("%s: new locktime is 0x%08x\n", __func__, val);
-	__raw_writel(val, S3C2410_LOCKTIME);
+	s3c24xx_write_locktime(val);
 }
 
 static int s3c_cpufreq_build_freq(void)
diff --git a/include/linux/soc/samsung/s3c-cpufreq-core.h b/include/linux/soc/samsung/s3c-cpufreq-core.h
index eca942559014..eaee883008a8 100644
--- a/include/linux/soc/samsung/s3c-cpufreq-core.h
+++ b/include/linux/soc/samsung/s3c-cpufreq-core.h
@@ -286,3 +286,10 @@ static inline int s3c_cpufreq_addfreq(struct cpufreq_frequency_table *table,
 
 	return index + 1;
 }
+
+u32 s3c2440_read_camdivn(void);
+void s3c2440_write_camdivn(u32 camdiv);
+u32 s3c24xx_read_clkdivn(void);
+void s3c24xx_write_clkdivn(u32 clkdiv);
+u32 s3c24xx_read_mpllcon(void);
+void s3c24xx_write_locktime(u32 locktime);
-- 
2.20.0


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

* Re: [PATCH 15/36] ARM: s3c: adc: move header to linux/soc/samsung
  2019-10-10 20:29   ` [PATCH 15/36] ARM: s3c: adc: move header to linux/soc/samsung Arnd Bergmann
@ 2019-10-10 22:20     ` Guenter Roeck
  2019-10-10 22:29       ` Dmitry Torokhov
  2019-10-23 12:37     ` Krzysztof Kozlowski
  1 sibling, 1 reply; 22+ messages in thread
From: Guenter Roeck @ 2019-10-10 22:20 UTC (permalink / raw)
  To: Arnd Bergmann, Kukjin Kim, Krzysztof Kozlowski, Jean Delvare,
	Dmitry Torokhov, Sebastian Reichel
  Cc: linux-samsung-soc, linux-arm-kernel, linus.walleij, linux-kernel,
	linux-hwmon, linux-input, linux-pm

On 10/10/19 1:29 PM, Arnd Bergmann wrote:
> There are multiple drivers using the private adc interface.
> It seems unlikely that they would ever get converted to iio,
> so make the current state official by making the header file
> global.
> 
> The s3c2410_ts driver needs a couple of register definitions
> as well.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

For hwmon:

Acked-by: Guenter Roeck <linux@roeck-us.net>

> ---
>   arch/arm/mach-s3c64xx/mach-crag6410.c         |  2 +-
>   arch/arm/mach-s3c64xx/mach-mini6410.c         |  2 +-
>   arch/arm/mach-s3c64xx/mach-real6410.c         |  2 +-
>   arch/arm/mach-s3c64xx/mach-smdk6410.c         |  2 +-
>   arch/arm/plat-samsung/adc.c                   |  2 +-
>   arch/arm/plat-samsung/devs.c                  |  2 +-
>   drivers/hwmon/s3c-hwmon.c                     |  2 +-
>   drivers/input/touchscreen/s3c2410_ts.c        | 37 ++++++++++++++++++-
>   drivers/power/supply/s3c_adc_battery.c        |  2 +-
>   .../linux/soc/samsung/s3c-adc.h               |  0
>   10 files changed, 43 insertions(+), 10 deletions(-)
>   rename arch/arm/plat-samsung/include/plat/adc.h => include/linux/soc/samsung/s3c-adc.h (100%)
> 
> diff --git a/arch/arm/mach-s3c64xx/mach-crag6410.c b/arch/arm/mach-s3c64xx/mach-crag6410.c
> index da5b50981a14..133453562d23 100644
> --- a/arch/arm/mach-s3c64xx/mach-crag6410.c
> +++ b/arch/arm/mach-s3c64xx/mach-crag6410.c
> @@ -57,7 +57,7 @@
>   #include <plat/keypad.h>
>   #include <plat/devs.h>
>   #include <plat/cpu.h>
> -#include <plat/adc.h>
> +#include <linux/soc/samsung/s3c-adc.h>
>   #include <linux/platform_data/i2c-s3c2410.h>
>   #include <plat/pm.h>
>   #include <plat/samsung-time.h>
> diff --git a/arch/arm/mach-s3c64xx/mach-mini6410.c b/arch/arm/mach-s3c64xx/mach-mini6410.c
> index 0dd36ae49e6a..c7140300bd3f 100644
> --- a/arch/arm/mach-s3c64xx/mach-mini6410.c
> +++ b/arch/arm/mach-s3c64xx/mach-mini6410.c
> @@ -27,7 +27,7 @@
>   #include <mach/regs-gpio.h>
>   #include <mach/gpio-samsung.h>
>   
> -#include <plat/adc.h>
> +#include <linux/soc/samsung/s3c-adc.h>
>   #include <plat/cpu.h>
>   #include <plat/devs.h>
>   #include <plat/fb.h>
> diff --git a/arch/arm/mach-s3c64xx/mach-real6410.c b/arch/arm/mach-s3c64xx/mach-real6410.c
> index 0ff88b6859c4..f55097fde94c 100644
> --- a/arch/arm/mach-s3c64xx/mach-real6410.c
> +++ b/arch/arm/mach-s3c64xx/mach-real6410.c
> @@ -29,7 +29,7 @@
>   #include <mach/gpio-samsung.h>
>   #include <mach/irqs.h>
>   
> -#include <plat/adc.h>
> +#include <linux/soc/samsung/s3c-adc.h>
>   #include <plat/cpu.h>
>   #include <plat/devs.h>
>   #include <plat/fb.h>
> diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c
> index 95bdcfe95a53..3042f6cbffd9 100644
> --- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
> +++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
> @@ -60,7 +60,7 @@
>   
>   #include <plat/devs.h>
>   #include <plat/cpu.h>
> -#include <plat/adc.h>
> +#include <linux/soc/samsung/s3c-adc.h>
>   #include <linux/platform_data/touchscreen-s3c2410.h>
>   #include <plat/keypad.h>
>   #include <plat/samsung-time.h>
> diff --git a/arch/arm/plat-samsung/adc.c b/arch/arm/plat-samsung/adc.c
> index ee3d5c989a76..623a9774cc52 100644
> --- a/arch/arm/plat-samsung/adc.c
> +++ b/arch/arm/plat-samsung/adc.c
> @@ -20,7 +20,7 @@
>   #include <linux/regulator/consumer.h>
>   
>   #include <plat/regs-adc.h>
> -#include <plat/adc.h>
> +#include <linux/soc/samsung/s3c-adc.h>
>   
>   /* This driver is designed to control the usage of the ADC block between
>    * the touchscreen and any other drivers that may need to use it, such as
> diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c
> index fd94a35e22f8..ddd90f0bb380 100644
> --- a/arch/arm/plat-samsung/devs.c
> +++ b/arch/arm/plat-samsung/devs.c
> @@ -44,7 +44,7 @@
>   
>   #include <plat/cpu.h>
>   #include <plat/devs.h>
> -#include <plat/adc.h>
> +#include <linux/soc/samsung/s3c-adc.h>
>   #include <linux/platform_data/ata-samsung_cf.h>
>   #include <plat/fb.h>
>   #include <plat/fb-s3c2410.h>
> diff --git a/drivers/hwmon/s3c-hwmon.c b/drivers/hwmon/s3c-hwmon.c
> index b490fe3d2ee8..f2703c5460d0 100644
> --- a/drivers/hwmon/s3c-hwmon.c
> +++ b/drivers/hwmon/s3c-hwmon.c
> @@ -20,7 +20,7 @@
>   #include <linux/hwmon.h>
>   #include <linux/hwmon-sysfs.h>
>   
> -#include <plat/adc.h>
> +#include <linux/soc/samsung/s3c-adc.h>
>   #include <linux/platform_data/hwmon-s3c.h>
>   
>   struct s3c_hwmon_attr {
> diff --git a/drivers/input/touchscreen/s3c2410_ts.c b/drivers/input/touchscreen/s3c2410_ts.c
> index b346e7cafd62..1a5a178ea286 100644
> --- a/drivers/input/touchscreen/s3c2410_ts.c
> +++ b/drivers/input/touchscreen/s3c2410_ts.c
> @@ -21,10 +21,43 @@
>   #include <linux/clk.h>
>   #include <linux/io.h>
>   
> -#include <plat/adc.h>
> -#include <plat/regs-adc.h>
> +#include <linux/soc/samsung/s3c-adc.h>
>   #include <linux/platform_data/touchscreen-s3c2410.h>
>   
> +#define	S3C2410_ADCCON			(0x00)
> +#define	S3C2410_ADCTSC			(0x04)
> +#define	S3C2410_ADCDLY			(0x08)
> +#define	S3C2410_ADCDAT0			(0x0C)
> +#define	S3C2410_ADCDAT1			(0x10)
> +#define	S3C64XX_ADCUPDN			(0x14)
> +#define	S3C2443_ADCMUX			(0x18)
> +#define	S3C64XX_ADCCLRINT		(0x18)
> +#define	S5P_ADCMUX			(0x1C)
> +#define	S3C64XX_ADCCLRINTPNDNUP		(0x20)
> +
> +/* ADCTSC Register Bits */
> +#define S3C2443_ADCTSC_UD_SEN		(1 << 8)
> +#define S3C2410_ADCTSC_YM_SEN		(1<<7)
> +#define S3C2410_ADCTSC_YP_SEN		(1<<6)
> +#define S3C2410_ADCTSC_XM_SEN		(1<<5)
> +#define S3C2410_ADCTSC_XP_SEN		(1<<4)
> +#define S3C2410_ADCTSC_PULL_UP_DISABLE	(1<<3)
> +#define S3C2410_ADCTSC_AUTO_PST		(1<<2)
> +#define S3C2410_ADCTSC_XY_PST(x)	(((x)&0x3)<<0)
> +
> +/* ADCDAT0 Bits */
> +#define S3C2410_ADCDAT0_UPDOWN		(1<<15)
> +#define S3C2410_ADCDAT0_AUTO_PST	(1<<14)
> +#define S3C2410_ADCDAT0_XY_PST		(0x3<<12)
> +#define S3C2410_ADCDAT0_XPDATA_MASK	(0x03FF)
> +
> +/* ADCDAT1 Bits */
> +#define S3C2410_ADCDAT1_UPDOWN		(1<<15)
> +#define S3C2410_ADCDAT1_AUTO_PST	(1<<14)
> +#define S3C2410_ADCDAT1_XY_PST		(0x3<<12)
> +#define S3C2410_ADCDAT1_YPDATA_MASK	(0x03FF)
> +
> +
>   #define TSC_SLEEP  (S3C2410_ADCTSC_PULL_UP_DISABLE | S3C2410_ADCTSC_XY_PST(0))
>   
>   #define INT_DOWN	(0)
> diff --git a/drivers/power/supply/s3c_adc_battery.c b/drivers/power/supply/s3c_adc_battery.c
> index 3d00b35cafc9..60b7f41ab063 100644
> --- a/drivers/power/supply/s3c_adc_battery.c
> +++ b/drivers/power/supply/s3c_adc_battery.c
> @@ -22,7 +22,7 @@
>   #include <linux/init.h>
>   #include <linux/module.h>
>   
> -#include <plat/adc.h>
> +#include <linux/soc/samsung/s3c-adc.h>
>   
>   #define BAT_POLL_INTERVAL		10000 /* ms */
>   #define JITTER_DELAY			500 /* ms */
> diff --git a/arch/arm/plat-samsung/include/plat/adc.h b/include/linux/soc/samsung/s3c-adc.h
> similarity index 100%
> rename from arch/arm/plat-samsung/include/plat/adc.h
> rename to include/linux/soc/samsung/s3c-adc.h
> 


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

* Re: [PATCH 15/36] ARM: s3c: adc: move header to linux/soc/samsung
  2019-10-10 22:20     ` Guenter Roeck
@ 2019-10-10 22:29       ` Dmitry Torokhov
  2019-10-10 22:44         ` Sebastian Reichel
  0 siblings, 1 reply; 22+ messages in thread
From: Dmitry Torokhov @ 2019-10-10 22:29 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Arnd Bergmann, Kukjin Kim, Krzysztof Kozlowski, Jean Delvare,
	Sebastian Reichel, linux-samsung-soc, linux-arm-kernel,
	linus.walleij, linux-kernel, linux-hwmon, linux-input, linux-pm

On Thu, Oct 10, 2019 at 03:20:32PM -0700, Guenter Roeck wrote:
> On 10/10/19 1:29 PM, Arnd Bergmann wrote:
> > There are multiple drivers using the private adc interface.
> > It seems unlikely that they would ever get converted to iio,
> > so make the current state official by making the header file
> > global.
> > 
> > The s3c2410_ts driver needs a couple of register definitions
> > as well.
> > 
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> 
> For hwmon:
> 
> Acked-by: Guenter Roeck <linux@roeck-us.net>

For input:

Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


> 
> > ---
> >   arch/arm/mach-s3c64xx/mach-crag6410.c         |  2 +-
> >   arch/arm/mach-s3c64xx/mach-mini6410.c         |  2 +-
> >   arch/arm/mach-s3c64xx/mach-real6410.c         |  2 +-
> >   arch/arm/mach-s3c64xx/mach-smdk6410.c         |  2 +-
> >   arch/arm/plat-samsung/adc.c                   |  2 +-
> >   arch/arm/plat-samsung/devs.c                  |  2 +-
> >   drivers/hwmon/s3c-hwmon.c                     |  2 +-
> >   drivers/input/touchscreen/s3c2410_ts.c        | 37 ++++++++++++++++++-
> >   drivers/power/supply/s3c_adc_battery.c        |  2 +-
> >   .../linux/soc/samsung/s3c-adc.h               |  0
> >   10 files changed, 43 insertions(+), 10 deletions(-)
> >   rename arch/arm/plat-samsung/include/plat/adc.h => include/linux/soc/samsung/s3c-adc.h (100%)
> > 
> > diff --git a/arch/arm/mach-s3c64xx/mach-crag6410.c b/arch/arm/mach-s3c64xx/mach-crag6410.c
> > index da5b50981a14..133453562d23 100644
> > --- a/arch/arm/mach-s3c64xx/mach-crag6410.c
> > +++ b/arch/arm/mach-s3c64xx/mach-crag6410.c
> > @@ -57,7 +57,7 @@
> >   #include <plat/keypad.h>
> >   #include <plat/devs.h>
> >   #include <plat/cpu.h>
> > -#include <plat/adc.h>
> > +#include <linux/soc/samsung/s3c-adc.h>
> >   #include <linux/platform_data/i2c-s3c2410.h>
> >   #include <plat/pm.h>
> >   #include <plat/samsung-time.h>
> > diff --git a/arch/arm/mach-s3c64xx/mach-mini6410.c b/arch/arm/mach-s3c64xx/mach-mini6410.c
> > index 0dd36ae49e6a..c7140300bd3f 100644
> > --- a/arch/arm/mach-s3c64xx/mach-mini6410.c
> > +++ b/arch/arm/mach-s3c64xx/mach-mini6410.c
> > @@ -27,7 +27,7 @@
> >   #include <mach/regs-gpio.h>
> >   #include <mach/gpio-samsung.h>
> > -#include <plat/adc.h>
> > +#include <linux/soc/samsung/s3c-adc.h>
> >   #include <plat/cpu.h>
> >   #include <plat/devs.h>
> >   #include <plat/fb.h>
> > diff --git a/arch/arm/mach-s3c64xx/mach-real6410.c b/arch/arm/mach-s3c64xx/mach-real6410.c
> > index 0ff88b6859c4..f55097fde94c 100644
> > --- a/arch/arm/mach-s3c64xx/mach-real6410.c
> > +++ b/arch/arm/mach-s3c64xx/mach-real6410.c
> > @@ -29,7 +29,7 @@
> >   #include <mach/gpio-samsung.h>
> >   #include <mach/irqs.h>
> > -#include <plat/adc.h>
> > +#include <linux/soc/samsung/s3c-adc.h>
> >   #include <plat/cpu.h>
> >   #include <plat/devs.h>
> >   #include <plat/fb.h>
> > diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c
> > index 95bdcfe95a53..3042f6cbffd9 100644
> > --- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
> > +++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
> > @@ -60,7 +60,7 @@
> >   #include <plat/devs.h>
> >   #include <plat/cpu.h>
> > -#include <plat/adc.h>
> > +#include <linux/soc/samsung/s3c-adc.h>
> >   #include <linux/platform_data/touchscreen-s3c2410.h>
> >   #include <plat/keypad.h>
> >   #include <plat/samsung-time.h>
> > diff --git a/arch/arm/plat-samsung/adc.c b/arch/arm/plat-samsung/adc.c
> > index ee3d5c989a76..623a9774cc52 100644
> > --- a/arch/arm/plat-samsung/adc.c
> > +++ b/arch/arm/plat-samsung/adc.c
> > @@ -20,7 +20,7 @@
> >   #include <linux/regulator/consumer.h>
> >   #include <plat/regs-adc.h>
> > -#include <plat/adc.h>
> > +#include <linux/soc/samsung/s3c-adc.h>
> >   /* This driver is designed to control the usage of the ADC block between
> >    * the touchscreen and any other drivers that may need to use it, such as
> > diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c
> > index fd94a35e22f8..ddd90f0bb380 100644
> > --- a/arch/arm/plat-samsung/devs.c
> > +++ b/arch/arm/plat-samsung/devs.c
> > @@ -44,7 +44,7 @@
> >   #include <plat/cpu.h>
> >   #include <plat/devs.h>
> > -#include <plat/adc.h>
> > +#include <linux/soc/samsung/s3c-adc.h>
> >   #include <linux/platform_data/ata-samsung_cf.h>
> >   #include <plat/fb.h>
> >   #include <plat/fb-s3c2410.h>
> > diff --git a/drivers/hwmon/s3c-hwmon.c b/drivers/hwmon/s3c-hwmon.c
> > index b490fe3d2ee8..f2703c5460d0 100644
> > --- a/drivers/hwmon/s3c-hwmon.c
> > +++ b/drivers/hwmon/s3c-hwmon.c
> > @@ -20,7 +20,7 @@
> >   #include <linux/hwmon.h>
> >   #include <linux/hwmon-sysfs.h>
> > -#include <plat/adc.h>
> > +#include <linux/soc/samsung/s3c-adc.h>
> >   #include <linux/platform_data/hwmon-s3c.h>
> >   struct s3c_hwmon_attr {
> > diff --git a/drivers/input/touchscreen/s3c2410_ts.c b/drivers/input/touchscreen/s3c2410_ts.c
> > index b346e7cafd62..1a5a178ea286 100644
> > --- a/drivers/input/touchscreen/s3c2410_ts.c
> > +++ b/drivers/input/touchscreen/s3c2410_ts.c
> > @@ -21,10 +21,43 @@
> >   #include <linux/clk.h>
> >   #include <linux/io.h>
> > -#include <plat/adc.h>
> > -#include <plat/regs-adc.h>
> > +#include <linux/soc/samsung/s3c-adc.h>
> >   #include <linux/platform_data/touchscreen-s3c2410.h>
> > +#define	S3C2410_ADCCON			(0x00)
> > +#define	S3C2410_ADCTSC			(0x04)
> > +#define	S3C2410_ADCDLY			(0x08)
> > +#define	S3C2410_ADCDAT0			(0x0C)
> > +#define	S3C2410_ADCDAT1			(0x10)
> > +#define	S3C64XX_ADCUPDN			(0x14)
> > +#define	S3C2443_ADCMUX			(0x18)
> > +#define	S3C64XX_ADCCLRINT		(0x18)
> > +#define	S5P_ADCMUX			(0x1C)
> > +#define	S3C64XX_ADCCLRINTPNDNUP		(0x20)
> > +
> > +/* ADCTSC Register Bits */
> > +#define S3C2443_ADCTSC_UD_SEN		(1 << 8)
> > +#define S3C2410_ADCTSC_YM_SEN		(1<<7)
> > +#define S3C2410_ADCTSC_YP_SEN		(1<<6)
> > +#define S3C2410_ADCTSC_XM_SEN		(1<<5)
> > +#define S3C2410_ADCTSC_XP_SEN		(1<<4)
> > +#define S3C2410_ADCTSC_PULL_UP_DISABLE	(1<<3)
> > +#define S3C2410_ADCTSC_AUTO_PST		(1<<2)
> > +#define S3C2410_ADCTSC_XY_PST(x)	(((x)&0x3)<<0)
> > +
> > +/* ADCDAT0 Bits */
> > +#define S3C2410_ADCDAT0_UPDOWN		(1<<15)
> > +#define S3C2410_ADCDAT0_AUTO_PST	(1<<14)
> > +#define S3C2410_ADCDAT0_XY_PST		(0x3<<12)
> > +#define S3C2410_ADCDAT0_XPDATA_MASK	(0x03FF)
> > +
> > +/* ADCDAT1 Bits */
> > +#define S3C2410_ADCDAT1_UPDOWN		(1<<15)
> > +#define S3C2410_ADCDAT1_AUTO_PST	(1<<14)
> > +#define S3C2410_ADCDAT1_XY_PST		(0x3<<12)
> > +#define S3C2410_ADCDAT1_YPDATA_MASK	(0x03FF)
> > +
> > +
> >   #define TSC_SLEEP  (S3C2410_ADCTSC_PULL_UP_DISABLE | S3C2410_ADCTSC_XY_PST(0))
> >   #define INT_DOWN	(0)
> > diff --git a/drivers/power/supply/s3c_adc_battery.c b/drivers/power/supply/s3c_adc_battery.c
> > index 3d00b35cafc9..60b7f41ab063 100644
> > --- a/drivers/power/supply/s3c_adc_battery.c
> > +++ b/drivers/power/supply/s3c_adc_battery.c
> > @@ -22,7 +22,7 @@
> >   #include <linux/init.h>
> >   #include <linux/module.h>
> > -#include <plat/adc.h>
> > +#include <linux/soc/samsung/s3c-adc.h>
> >   #define BAT_POLL_INTERVAL		10000 /* ms */
> >   #define JITTER_DELAY			500 /* ms */
> > diff --git a/arch/arm/plat-samsung/include/plat/adc.h b/include/linux/soc/samsung/s3c-adc.h
> > similarity index 100%
> > rename from arch/arm/plat-samsung/include/plat/adc.h
> > rename to include/linux/soc/samsung/s3c-adc.h
> > 
> 

-- 
Dmitry

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

* Re: [PATCH 15/36] ARM: s3c: adc: move header to linux/soc/samsung
  2019-10-10 22:29       ` Dmitry Torokhov
@ 2019-10-10 22:44         ` Sebastian Reichel
  0 siblings, 0 replies; 22+ messages in thread
From: Sebastian Reichel @ 2019-10-10 22:44 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Guenter Roeck, Arnd Bergmann, Kukjin Kim, Krzysztof Kozlowski,
	Jean Delvare, linux-samsung-soc, linux-arm-kernel, linus.walleij,
	linux-kernel, linux-hwmon, linux-input, linux-pm

[-- Attachment #1: Type: text/plain, Size: 8055 bytes --]

Hi,

On Thu, Oct 10, 2019 at 03:29:55PM -0700, Dmitry Torokhov wrote:
> On Thu, Oct 10, 2019 at 03:20:32PM -0700, Guenter Roeck wrote:
> > On 10/10/19 1:29 PM, Arnd Bergmann wrote:
> > > There are multiple drivers using the private adc interface.
> > > It seems unlikely that they would ever get converted to iio,
> > > so make the current state official by making the header file
> > > global.
> > > 
> > > The s3c2410_ts driver needs a couple of register definitions
> > > as well.
> > > 
> > > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > 
> > For hwmon:
> > 
> > Acked-by: Guenter Roeck <linux@roeck-us.net>
> 
> For input:
> 
> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

For power-supply:

Acked-by: Sebastian Reichel <sre@kernel.org>

-- Sebastian

> > > ---
> > >   arch/arm/mach-s3c64xx/mach-crag6410.c         |  2 +-
> > >   arch/arm/mach-s3c64xx/mach-mini6410.c         |  2 +-
> > >   arch/arm/mach-s3c64xx/mach-real6410.c         |  2 +-
> > >   arch/arm/mach-s3c64xx/mach-smdk6410.c         |  2 +-
> > >   arch/arm/plat-samsung/adc.c                   |  2 +-
> > >   arch/arm/plat-samsung/devs.c                  |  2 +-
> > >   drivers/hwmon/s3c-hwmon.c                     |  2 +-
> > >   drivers/input/touchscreen/s3c2410_ts.c        | 37 ++++++++++++++++++-
> > >   drivers/power/supply/s3c_adc_battery.c        |  2 +-
> > >   .../linux/soc/samsung/s3c-adc.h               |  0
> > >   10 files changed, 43 insertions(+), 10 deletions(-)
> > >   rename arch/arm/plat-samsung/include/plat/adc.h => include/linux/soc/samsung/s3c-adc.h (100%)
> > > 
> > > diff --git a/arch/arm/mach-s3c64xx/mach-crag6410.c b/arch/arm/mach-s3c64xx/mach-crag6410.c
> > > index da5b50981a14..133453562d23 100644
> > > --- a/arch/arm/mach-s3c64xx/mach-crag6410.c
> > > +++ b/arch/arm/mach-s3c64xx/mach-crag6410.c
> > > @@ -57,7 +57,7 @@
> > >   #include <plat/keypad.h>
> > >   #include <plat/devs.h>
> > >   #include <plat/cpu.h>
> > > -#include <plat/adc.h>
> > > +#include <linux/soc/samsung/s3c-adc.h>
> > >   #include <linux/platform_data/i2c-s3c2410.h>
> > >   #include <plat/pm.h>
> > >   #include <plat/samsung-time.h>
> > > diff --git a/arch/arm/mach-s3c64xx/mach-mini6410.c b/arch/arm/mach-s3c64xx/mach-mini6410.c
> > > index 0dd36ae49e6a..c7140300bd3f 100644
> > > --- a/arch/arm/mach-s3c64xx/mach-mini6410.c
> > > +++ b/arch/arm/mach-s3c64xx/mach-mini6410.c
> > > @@ -27,7 +27,7 @@
> > >   #include <mach/regs-gpio.h>
> > >   #include <mach/gpio-samsung.h>
> > > -#include <plat/adc.h>
> > > +#include <linux/soc/samsung/s3c-adc.h>
> > >   #include <plat/cpu.h>
> > >   #include <plat/devs.h>
> > >   #include <plat/fb.h>
> > > diff --git a/arch/arm/mach-s3c64xx/mach-real6410.c b/arch/arm/mach-s3c64xx/mach-real6410.c
> > > index 0ff88b6859c4..f55097fde94c 100644
> > > --- a/arch/arm/mach-s3c64xx/mach-real6410.c
> > > +++ b/arch/arm/mach-s3c64xx/mach-real6410.c
> > > @@ -29,7 +29,7 @@
> > >   #include <mach/gpio-samsung.h>
> > >   #include <mach/irqs.h>
> > > -#include <plat/adc.h>
> > > +#include <linux/soc/samsung/s3c-adc.h>
> > >   #include <plat/cpu.h>
> > >   #include <plat/devs.h>
> > >   #include <plat/fb.h>
> > > diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c
> > > index 95bdcfe95a53..3042f6cbffd9 100644
> > > --- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
> > > +++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
> > > @@ -60,7 +60,7 @@
> > >   #include <plat/devs.h>
> > >   #include <plat/cpu.h>
> > > -#include <plat/adc.h>
> > > +#include <linux/soc/samsung/s3c-adc.h>
> > >   #include <linux/platform_data/touchscreen-s3c2410.h>
> > >   #include <plat/keypad.h>
> > >   #include <plat/samsung-time.h>
> > > diff --git a/arch/arm/plat-samsung/adc.c b/arch/arm/plat-samsung/adc.c
> > > index ee3d5c989a76..623a9774cc52 100644
> > > --- a/arch/arm/plat-samsung/adc.c
> > > +++ b/arch/arm/plat-samsung/adc.c
> > > @@ -20,7 +20,7 @@
> > >   #include <linux/regulator/consumer.h>
> > >   #include <plat/regs-adc.h>
> > > -#include <plat/adc.h>
> > > +#include <linux/soc/samsung/s3c-adc.h>
> > >   /* This driver is designed to control the usage of the ADC block between
> > >    * the touchscreen and any other drivers that may need to use it, such as
> > > diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c
> > > index fd94a35e22f8..ddd90f0bb380 100644
> > > --- a/arch/arm/plat-samsung/devs.c
> > > +++ b/arch/arm/plat-samsung/devs.c
> > > @@ -44,7 +44,7 @@
> > >   #include <plat/cpu.h>
> > >   #include <plat/devs.h>
> > > -#include <plat/adc.h>
> > > +#include <linux/soc/samsung/s3c-adc.h>
> > >   #include <linux/platform_data/ata-samsung_cf.h>
> > >   #include <plat/fb.h>
> > >   #include <plat/fb-s3c2410.h>
> > > diff --git a/drivers/hwmon/s3c-hwmon.c b/drivers/hwmon/s3c-hwmon.c
> > > index b490fe3d2ee8..f2703c5460d0 100644
> > > --- a/drivers/hwmon/s3c-hwmon.c
> > > +++ b/drivers/hwmon/s3c-hwmon.c
> > > @@ -20,7 +20,7 @@
> > >   #include <linux/hwmon.h>
> > >   #include <linux/hwmon-sysfs.h>
> > > -#include <plat/adc.h>
> > > +#include <linux/soc/samsung/s3c-adc.h>
> > >   #include <linux/platform_data/hwmon-s3c.h>
> > >   struct s3c_hwmon_attr {
> > > diff --git a/drivers/input/touchscreen/s3c2410_ts.c b/drivers/input/touchscreen/s3c2410_ts.c
> > > index b346e7cafd62..1a5a178ea286 100644
> > > --- a/drivers/input/touchscreen/s3c2410_ts.c
> > > +++ b/drivers/input/touchscreen/s3c2410_ts.c
> > > @@ -21,10 +21,43 @@
> > >   #include <linux/clk.h>
> > >   #include <linux/io.h>
> > > -#include <plat/adc.h>
> > > -#include <plat/regs-adc.h>
> > > +#include <linux/soc/samsung/s3c-adc.h>
> > >   #include <linux/platform_data/touchscreen-s3c2410.h>
> > > +#define	S3C2410_ADCCON			(0x00)
> > > +#define	S3C2410_ADCTSC			(0x04)
> > > +#define	S3C2410_ADCDLY			(0x08)
> > > +#define	S3C2410_ADCDAT0			(0x0C)
> > > +#define	S3C2410_ADCDAT1			(0x10)
> > > +#define	S3C64XX_ADCUPDN			(0x14)
> > > +#define	S3C2443_ADCMUX			(0x18)
> > > +#define	S3C64XX_ADCCLRINT		(0x18)
> > > +#define	S5P_ADCMUX			(0x1C)
> > > +#define	S3C64XX_ADCCLRINTPNDNUP		(0x20)
> > > +
> > > +/* ADCTSC Register Bits */
> > > +#define S3C2443_ADCTSC_UD_SEN		(1 << 8)
> > > +#define S3C2410_ADCTSC_YM_SEN		(1<<7)
> > > +#define S3C2410_ADCTSC_YP_SEN		(1<<6)
> > > +#define S3C2410_ADCTSC_XM_SEN		(1<<5)
> > > +#define S3C2410_ADCTSC_XP_SEN		(1<<4)
> > > +#define S3C2410_ADCTSC_PULL_UP_DISABLE	(1<<3)
> > > +#define S3C2410_ADCTSC_AUTO_PST		(1<<2)
> > > +#define S3C2410_ADCTSC_XY_PST(x)	(((x)&0x3)<<0)
> > > +
> > > +/* ADCDAT0 Bits */
> > > +#define S3C2410_ADCDAT0_UPDOWN		(1<<15)
> > > +#define S3C2410_ADCDAT0_AUTO_PST	(1<<14)
> > > +#define S3C2410_ADCDAT0_XY_PST		(0x3<<12)
> > > +#define S3C2410_ADCDAT0_XPDATA_MASK	(0x03FF)
> > > +
> > > +/* ADCDAT1 Bits */
> > > +#define S3C2410_ADCDAT1_UPDOWN		(1<<15)
> > > +#define S3C2410_ADCDAT1_AUTO_PST	(1<<14)
> > > +#define S3C2410_ADCDAT1_XY_PST		(0x3<<12)
> > > +#define S3C2410_ADCDAT1_YPDATA_MASK	(0x03FF)
> > > +
> > > +
> > >   #define TSC_SLEEP  (S3C2410_ADCTSC_PULL_UP_DISABLE | S3C2410_ADCTSC_XY_PST(0))
> > >   #define INT_DOWN	(0)
> > > diff --git a/drivers/power/supply/s3c_adc_battery.c b/drivers/power/supply/s3c_adc_battery.c
> > > index 3d00b35cafc9..60b7f41ab063 100644
> > > --- a/drivers/power/supply/s3c_adc_battery.c
> > > +++ b/drivers/power/supply/s3c_adc_battery.c
> > > @@ -22,7 +22,7 @@
> > >   #include <linux/init.h>
> > >   #include <linux/module.h>
> > > -#include <plat/adc.h>
> > > +#include <linux/soc/samsung/s3c-adc.h>
> > >   #define BAT_POLL_INTERVAL		10000 /* ms */
> > >   #define JITTER_DELAY			500 /* ms */
> > > diff --git a/arch/arm/plat-samsung/include/plat/adc.h b/include/linux/soc/samsung/s3c-adc.h
> > > similarity index 100%
> > > rename from arch/arm/plat-samsung/include/plat/adc.h
> > > rename to include/linux/soc/samsung/s3c-adc.h
> > > 
> > 
> 
> -- 
> Dmitry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH 07/36] ARM: exynos: use private samsung_cpu_id copy
  2019-10-10 20:29   ` [PATCH 07/36] ARM: exynos: use private samsung_cpu_id copy Arnd Bergmann
@ 2019-10-23 10:54     ` Krzysztof Kozlowski
  2019-10-23 12:37       ` Arnd Bergmann
  0 siblings, 1 reply; 22+ messages in thread
From: Krzysztof Kozlowski @ 2019-10-23 10:54 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Kukjin Kim, Bartlomiej Zolnierkiewicz, Daniel Lezcano,
	linux-samsung-soc, linux-arm-kernel, linus.walleij, Tomasz Figa,
	Marek Szyprowski, Pankaj Dubey, linux-kernel, linux-pm

On Thu, Oct 10, 2019 at 10:29:51PM +0200, Arnd Bergmann wrote:
> The only part of plat-samsung that is shared with arch-exynos
> is the CPU identification code.
> 
> Having a separate exynos_cpu_id variable makes the two completely
> independent and is actually a bit less code in total.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  arch/arm/mach-exynos/common.h                |  6 +++---
>  arch/arm/mach-exynos/exynos.c                | 19 +++++++++++++++----
>  arch/arm/mach-exynos/include/mach/map.h      | 18 ------------------
>  arch/arm/mach-exynos/platsmp.c               |  4 +---
>  arch/arm/mach-exynos/pm.c                    |  8 ++++----
>  arch/arm/plat-samsung/cpu.c                  | 17 -----------------
>  arch/arm/plat-samsung/include/plat/cpu.h     |  2 --
>  arch/arm/plat-samsung/include/plat/map-s5p.h |  2 --
>  8 files changed, 23 insertions(+), 53 deletions(-)
>  delete mode 100644 arch/arm/mach-exynos/include/mach/map.h
> 
> diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h
> index 56411bb63d45..adf7db9c0885 100644
> --- a/arch/arm/mach-exynos/common.h
> +++ b/arch/arm/mach-exynos/common.h
> @@ -24,12 +24,12 @@
>  #define EXYNOS5800_SOC_ID	0xE5422000
>  #define EXYNOS5_SOC_MASK	0xFFFFF000
>  
> -extern unsigned long samsung_cpu_id;
> +extern unsigned long exynos_cpu_id;
>  
>  #define IS_SAMSUNG_CPU(name, id, mask)		\
>  static inline int is_samsung_##name(void)	\
>  {						\
> -	return ((samsung_cpu_id & mask) == (id & mask));	\
> +	return ((exynos_cpu_id & mask) == (id & mask));	\
>  }
>  
>  IS_SAMSUNG_CPU(exynos3250, EXYNOS3250_SOC_ID, EXYNOS3_SOC_MASK)
> @@ -147,7 +147,7 @@ extern struct cpuidle_exynos_data cpuidle_coupled_exynos_data;
>  
>  extern void exynos_set_delayed_reset_assertion(bool enable);
>  
> -extern unsigned int samsung_rev(void);
> +extern unsigned int exynos_rev(void);
>  extern void exynos_core_restart(u32 core_id);
>  extern int exynos_set_boot_addr(u32 core_id, unsigned long boot_addr);
>  extern int exynos_get_boot_addr(u32 core_id, unsigned long *boot_addr);
> diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
> index 9aa483366ebc..da9300d655c6 100644
> --- a/arch/arm/mach-exynos/exynos.c
> +++ b/arch/arm/mach-exynos/exynos.c
> @@ -19,11 +19,10 @@
>  #include <asm/mach/arch.h>
>  #include <asm/mach/map.h>
>  
> -#include <mach/map.h>
> -#include <plat/cpu.h>
> -
>  #include "common.h"
>  
> +#define S5P_VA_CHIPID	((void __iomem __force *)0xF8000000)

How about keeping the S3C_VA and S3C_ADDR_BASE macros/defines and using
them? They still appear in arch/arm/include/debug/exynos.S so they could
be integrated into one header, unless you plan to remove it in further
patches.

> +
>  static struct platform_device exynos_cpuidle = {
>  	.name              = "exynos_cpuidle",
>  #ifdef CONFIG_ARM_EXYNOS_CPUIDLE
> @@ -36,6 +35,14 @@ void __iomem *sysram_base_addr __ro_after_init;
>  phys_addr_t sysram_base_phys __ro_after_init;
>  void __iomem *sysram_ns_base_addr __ro_after_init;
>  
> +unsigned long exynos_cpu_id;
> +static unsigned int exynos_cpu_rev;
> +
> +unsigned int exynos_rev(void)
> +{
> +	return exynos_cpu_rev;
> +}
> +
>  void __init exynos_sysram_init(void)
>  {
>  	struct device_node *node;
> @@ -86,7 +93,11 @@ static void __init exynos_init_io(void)
>  	of_scan_flat_dt(exynos_fdt_map_chipid, NULL);
>  
>  	/* detect cpu id and rev. */
> -	s5p_init_cpu(S5P_VA_CHIPID);
> +	exynos_cpu_id = readl_relaxed(S5P_VA_CHIPID);
> +	exynos_cpu_rev = exynos_cpu_id & 0xFF;
> +
> +	pr_info("Samsung CPU ID: 0x%08lx\n", exynos_cpu_id);
> +
>  }
>  
>  /*
> diff --git a/arch/arm/mach-exynos/include/mach/map.h b/arch/arm/mach-exynos/include/mach/map.h
> deleted file mode 100644
> index 22ebe3654633..000000000000
> --- a/arch/arm/mach-exynos/include/mach/map.h
> +++ /dev/null
> @@ -1,18 +0,0 @@
> -/* SPDX-License-Identifier: GPL-2.0 */
> -/*
> - * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd.
> - *		http://www.samsung.com/
> - *
> - * EXYNOS - Memory map definitions
> - */
> -
> -#ifndef __ASM_ARCH_MAP_H
> -#define __ASM_ARCH_MAP_H __FILE__
> -
> -#include <plat/map-base.h>
> -
> -#include <plat/map-s5p.h>
> -
> -#define EXYNOS_PA_CHIPID		0x10000000
> -
> -#endif /* __ASM_ARCH_MAP_H */
> diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c
> index 0cbbae8bf1f8..d7fedbb2eefe 100644
> --- a/arch/arm/mach-exynos/platsmp.c
> +++ b/arch/arm/mach-exynos/platsmp.c
> @@ -22,8 +22,6 @@
>  #include <asm/smp_scu.h>
>  #include <asm/firmware.h>
>  
> -#include <mach/map.h>
> -
>  #include "common.h"
>  
>  extern void exynos4_secondary_startup(void);
> @@ -188,7 +186,7 @@ void exynos_scu_enable(void)
>  
>  static void __iomem *cpu_boot_reg_base(void)
>  {
> -	if (soc_is_exynos4210() && samsung_rev() == EXYNOS4210_REV_1_1)
> +	if (soc_is_exynos4210() && exynos_rev() == EXYNOS4210_REV_1_1)
>  		return pmu_base_addr + S5P_INFORM5;
>  	return sysram_base_addr;
>  }
> diff --git a/arch/arm/mach-exynos/pm.c b/arch/arm/mach-exynos/pm.c
> index 48e7fb38613e..624585641a9c 100644
> --- a/arch/arm/mach-exynos/pm.c
> +++ b/arch/arm/mach-exynos/pm.c
> @@ -26,18 +26,18 @@
>  
>  static inline void __iomem *exynos_boot_vector_addr(void)
>  {
> -	if (samsung_rev() == EXYNOS4210_REV_1_1)
> +	if (exynos_rev() == EXYNOS4210_REV_1_1)
>  		return pmu_base_addr + S5P_INFORM7;
> -	else if (samsung_rev() == EXYNOS4210_REV_1_0)
> +	else if (exynos_rev() == EXYNOS4210_REV_1_0)
>  		return sysram_base_addr + 0x24;
>  	return pmu_base_addr + S5P_INFORM0;
>  }
>  
>  static inline void __iomem *exynos_boot_vector_flag(void)
>  {
> -	if (samsung_rev() == EXYNOS4210_REV_1_1)
> +	if (exynos_rev() == EXYNOS4210_REV_1_1)
>  		return pmu_base_addr + S5P_INFORM6;
> -	else if (samsung_rev() == EXYNOS4210_REV_1_0)
> +	else if (exynos_rev() == EXYNOS4210_REV_1_0)
>  		return sysram_base_addr + 0x20;
>  	return pmu_base_addr + S5P_INFORM1;
>  }
> diff --git a/arch/arm/plat-samsung/cpu.c b/arch/arm/plat-samsung/cpu.c
> index e1ba88ba31d8..8acba21bbf4b 100644
> --- a/arch/arm/plat-samsung/cpu.c
> +++ b/arch/arm/plat-samsung/cpu.c
> @@ -14,13 +14,6 @@
>  #include <plat/cpu.h>
>  
>  unsigned long samsung_cpu_id;
> -static unsigned int samsung_cpu_rev;
> -
> -unsigned int samsung_rev(void)
> -{
> -	return samsung_cpu_rev;
> -}
> -EXPORT_SYMBOL(samsung_rev);
>  
>  void __init s3c64xx_init_cpu(void)
>  {
> @@ -34,15 +27,5 @@ void __init s3c64xx_init_cpu(void)
>  		samsung_cpu_id = readl_relaxed(S3C_VA_SYS + 0xA1C);
>  	}
>  
> -	samsung_cpu_rev = 0;
> -
> -	pr_info("Samsung CPU ID: 0x%08lx\n", samsung_cpu_id);
> -}
> -
> -void __init s5p_init_cpu(const void __iomem *cpuid_addr)
> -{
> -	samsung_cpu_id = readl_relaxed(cpuid_addr);
> -	samsung_cpu_rev = samsung_cpu_id & 0xFF;
> -
>  	pr_info("Samsung CPU ID: 0x%08lx\n", samsung_cpu_id);
>  }
> diff --git a/arch/arm/plat-samsung/include/plat/cpu.h b/arch/arm/plat-samsung/include/plat/cpu.h
> index fadcddbea064..02d7f991d5a3 100644
> --- a/arch/arm/plat-samsung/include/plat/cpu.h
> +++ b/arch/arm/plat-samsung/include/plat/cpu.h
> @@ -111,8 +111,6 @@ extern void s3c24xx_init_io(struct map_desc *mach_desc, int size);
>  extern void s3c64xx_init_cpu(void);
>  extern void s5p_init_cpu(const void __iomem *cpuid_addr);

You can remove it as well.

Best regards,
Krzysztof

>  
> -extern unsigned int samsung_rev(void);
> -
>  extern void s3c24xx_init_uarts(struct s3c2410_uartcfg *cfg, int no);
>  
>  extern void s3c24xx_init_clocks(int xtal);
> diff --git a/arch/arm/plat-samsung/include/plat/map-s5p.h b/arch/arm/plat-samsung/include/plat/map-s5p.h
> index d69a0ca09fb5..3812085f8761 100644
> --- a/arch/arm/plat-samsung/include/plat/map-s5p.h
> +++ b/arch/arm/plat-samsung/include/plat/map-s5p.h
> @@ -9,8 +9,6 @@
>  #ifndef __ASM_PLAT_MAP_S5P_H
>  #define __ASM_PLAT_MAP_S5P_H __FILE__
>  
> -#define S5P_VA_CHIPID		S3C_ADDR(0x02000000)
> -
>  #define VA_VIC(x)		(S3C_VA_IRQ + ((x) * 0x10000))
>  #define VA_VIC0			VA_VIC(0)
>  #define VA_VIC1			VA_VIC(1)
> -- 
> 2.20.0
> 

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

* Re: [PATCH 15/36] ARM: s3c: adc: move header to linux/soc/samsung
  2019-10-10 20:29   ` [PATCH 15/36] ARM: s3c: adc: move header to linux/soc/samsung Arnd Bergmann
  2019-10-10 22:20     ` Guenter Roeck
@ 2019-10-23 12:37     ` Krzysztof Kozlowski
  2019-10-23 13:23       ` Arnd Bergmann
  1 sibling, 1 reply; 22+ messages in thread
From: Krzysztof Kozlowski @ 2019-10-23 12:37 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Kukjin Kim, Jean Delvare, Guenter Roeck, Dmitry Torokhov,
	Sebastian Reichel, linux-samsung-soc, linux-arm-kernel,
	linus.walleij, linux-kernel, linux-hwmon, linux-input, linux-pm

On Thu, Oct 10, 2019 at 10:29:59PM +0200, Arnd Bergmann wrote:
> There are multiple drivers using the private adc interface.
> It seems unlikely that they would ever get converted to iio,
> so make the current state official by making the header file
> global.
> 
> The s3c2410_ts driver needs a couple of register definitions
> as well.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  arch/arm/mach-s3c64xx/mach-crag6410.c         |  2 +-
>  arch/arm/mach-s3c64xx/mach-mini6410.c         |  2 +-
>  arch/arm/mach-s3c64xx/mach-real6410.c         |  2 +-
>  arch/arm/mach-s3c64xx/mach-smdk6410.c         |  2 +-
>  arch/arm/plat-samsung/adc.c                   |  2 +-
>  arch/arm/plat-samsung/devs.c                  |  2 +-
>  drivers/hwmon/s3c-hwmon.c                     |  2 +-
>  drivers/input/touchscreen/s3c2410_ts.c        | 37 ++++++++++++++++++-
>  drivers/power/supply/s3c_adc_battery.c        |  2 +-
>  .../linux/soc/samsung/s3c-adc.h               |  0
>  10 files changed, 43 insertions(+), 10 deletions(-)
>  rename arch/arm/plat-samsung/include/plat/adc.h => include/linux/soc/samsung/s3c-adc.h (100%)
> 
> diff --git a/arch/arm/mach-s3c64xx/mach-crag6410.c b/arch/arm/mach-s3c64xx/mach-crag6410.c
> index da5b50981a14..133453562d23 100644
> --- a/arch/arm/mach-s3c64xx/mach-crag6410.c
> +++ b/arch/arm/mach-s3c64xx/mach-crag6410.c
> @@ -57,7 +57,7 @@
>  #include <plat/keypad.h>
>  #include <plat/devs.h>
>  #include <plat/cpu.h>
> -#include <plat/adc.h>
> +#include <linux/soc/samsung/s3c-adc.h>
>  #include <linux/platform_data/i2c-s3c2410.h>
>  #include <plat/pm.h>
>  #include <plat/samsung-time.h>
> diff --git a/arch/arm/mach-s3c64xx/mach-mini6410.c b/arch/arm/mach-s3c64xx/mach-mini6410.c
> index 0dd36ae49e6a..c7140300bd3f 100644
> --- a/arch/arm/mach-s3c64xx/mach-mini6410.c
> +++ b/arch/arm/mach-s3c64xx/mach-mini6410.c
> @@ -27,7 +27,7 @@
>  #include <mach/regs-gpio.h>
>  #include <mach/gpio-samsung.h>
>  
> -#include <plat/adc.h>
> +#include <linux/soc/samsung/s3c-adc.h>
>  #include <plat/cpu.h>
>  #include <plat/devs.h>
>  #include <plat/fb.h>
> diff --git a/arch/arm/mach-s3c64xx/mach-real6410.c b/arch/arm/mach-s3c64xx/mach-real6410.c
> index 0ff88b6859c4..f55097fde94c 100644
> --- a/arch/arm/mach-s3c64xx/mach-real6410.c
> +++ b/arch/arm/mach-s3c64xx/mach-real6410.c
> @@ -29,7 +29,7 @@
>  #include <mach/gpio-samsung.h>
>  #include <mach/irqs.h>
>  
> -#include <plat/adc.h>
> +#include <linux/soc/samsung/s3c-adc.h>
>  #include <plat/cpu.h>
>  #include <plat/devs.h>
>  #include <plat/fb.h>
> diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c
> index 95bdcfe95a53..3042f6cbffd9 100644
> --- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
> +++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
> @@ -60,7 +60,7 @@
>  
>  #include <plat/devs.h>
>  #include <plat/cpu.h>
> -#include <plat/adc.h>
> +#include <linux/soc/samsung/s3c-adc.h>
>  #include <linux/platform_data/touchscreen-s3c2410.h>
>  #include <plat/keypad.h>
>  #include <plat/samsung-time.h>
> diff --git a/arch/arm/plat-samsung/adc.c b/arch/arm/plat-samsung/adc.c
> index ee3d5c989a76..623a9774cc52 100644
> --- a/arch/arm/plat-samsung/adc.c
> +++ b/arch/arm/plat-samsung/adc.c
> @@ -20,7 +20,7 @@
>  #include <linux/regulator/consumer.h>
>  
>  #include <plat/regs-adc.h>
> -#include <plat/adc.h>
> +#include <linux/soc/samsung/s3c-adc.h>
>  
>  /* This driver is designed to control the usage of the ADC block between
>   * the touchscreen and any other drivers that may need to use it, such as
> diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c
> index fd94a35e22f8..ddd90f0bb380 100644
> --- a/arch/arm/plat-samsung/devs.c
> +++ b/arch/arm/plat-samsung/devs.c
> @@ -44,7 +44,7 @@
>  
>  #include <plat/cpu.h>
>  #include <plat/devs.h>
> -#include <plat/adc.h>
> +#include <linux/soc/samsung/s3c-adc.h>
>  #include <linux/platform_data/ata-samsung_cf.h>
>  #include <plat/fb.h>
>  #include <plat/fb-s3c2410.h>
> diff --git a/drivers/hwmon/s3c-hwmon.c b/drivers/hwmon/s3c-hwmon.c
> index b490fe3d2ee8..f2703c5460d0 100644
> --- a/drivers/hwmon/s3c-hwmon.c
> +++ b/drivers/hwmon/s3c-hwmon.c
> @@ -20,7 +20,7 @@
>  #include <linux/hwmon.h>
>  #include <linux/hwmon-sysfs.h>
>  
> -#include <plat/adc.h>
> +#include <linux/soc/samsung/s3c-adc.h>
>  #include <linux/platform_data/hwmon-s3c.h>
>  
>  struct s3c_hwmon_attr {
> diff --git a/drivers/input/touchscreen/s3c2410_ts.c b/drivers/input/touchscreen/s3c2410_ts.c
> index b346e7cafd62..1a5a178ea286 100644
> --- a/drivers/input/touchscreen/s3c2410_ts.c
> +++ b/drivers/input/touchscreen/s3c2410_ts.c
> @@ -21,10 +21,43 @@
>  #include <linux/clk.h>
>  #include <linux/io.h>
>  
> -#include <plat/adc.h>
> -#include <plat/regs-adc.h>
> +#include <linux/soc/samsung/s3c-adc.h>
>  #include <linux/platform_data/touchscreen-s3c2410.h>
>  
> +#define	S3C2410_ADCCON			(0x00)
> +#define	S3C2410_ADCTSC			(0x04)
> +#define	S3C2410_ADCDLY			(0x08)
> +#define	S3C2410_ADCDAT0			(0x0C)
> +#define	S3C2410_ADCDAT1			(0x10)
> +#define	S3C64XX_ADCUPDN			(0x14)
> +#define	S3C2443_ADCMUX			(0x18)
> +#define	S3C64XX_ADCCLRINT		(0x18)
> +#define	S5P_ADCMUX			(0x1C)
> +#define	S3C64XX_ADCCLRINTPNDNUP		(0x20)
> +
> +/* ADCTSC Register Bits */
> +#define S3C2443_ADCTSC_UD_SEN		(1 << 8)
> +#define S3C2410_ADCTSC_YM_SEN		(1<<7)
> +#define S3C2410_ADCTSC_YP_SEN		(1<<6)
> +#define S3C2410_ADCTSC_XM_SEN		(1<<5)
> +#define S3C2410_ADCTSC_XP_SEN		(1<<4)
> +#define S3C2410_ADCTSC_PULL_UP_DISABLE	(1<<3)
> +#define S3C2410_ADCTSC_AUTO_PST		(1<<2)
> +#define S3C2410_ADCTSC_XY_PST(x)	(((x)&0x3)<<0)
> +
> +/* ADCDAT0 Bits */
> +#define S3C2410_ADCDAT0_UPDOWN		(1<<15)
> +#define S3C2410_ADCDAT0_AUTO_PST	(1<<14)
> +#define S3C2410_ADCDAT0_XY_PST		(0x3<<12)
> +#define S3C2410_ADCDAT0_XPDATA_MASK	(0x03FF)
> +
> +/* ADCDAT1 Bits */
> +#define S3C2410_ADCDAT1_UPDOWN		(1<<15)
> +#define S3C2410_ADCDAT1_AUTO_PST	(1<<14)
> +#define S3C2410_ADCDAT1_XY_PST		(0x3<<12)
> +#define S3C2410_ADCDAT1_YPDATA_MASK	(0x03FF)
> +
> +
>  #define TSC_SLEEP  (S3C2410_ADCTSC_PULL_UP_DISABLE | S3C2410_ADCTSC_XY_PST(0))
>  
>  #define INT_DOWN	(0)
> diff --git a/drivers/power/supply/s3c_adc_battery.c b/drivers/power/supply/s3c_adc_battery.c
> index 3d00b35cafc9..60b7f41ab063 100644
> --- a/drivers/power/supply/s3c_adc_battery.c
> +++ b/drivers/power/supply/s3c_adc_battery.c
> @@ -22,7 +22,7 @@
>  #include <linux/init.h>
>  #include <linux/module.h>
>  
> -#include <plat/adc.h>
> +#include <linux/soc/samsung/s3c-adc.h>
>  
>  #define BAT_POLL_INTERVAL		10000 /* ms */
>  #define JITTER_DELAY			500 /* ms */
> diff --git a/arch/arm/plat-samsung/include/plat/adc.h b/include/linux/soc/samsung/s3c-adc.h
> similarity index 100%
> rename from arch/arm/plat-samsung/include/plat/adc.h
> rename to include/linux/soc/samsung/s3c-adc.h

Can you update the name of header guard? __LINUX_SOC_SAMSUNG_S3C_ADC_H?

Best regards,
Krzysztof


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

* Re: [PATCH 07/36] ARM: exynos: use private samsung_cpu_id copy
  2019-10-23 10:54     ` Krzysztof Kozlowski
@ 2019-10-23 12:37       ` Arnd Bergmann
  0 siblings, 0 replies; 22+ messages in thread
From: Arnd Bergmann @ 2019-10-23 12:37 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: moderated list:ARM/SAMSUNG EXYNOS ARM ARCHITECTURES,
	Bartlomiej Zolnierkiewicz, Pankaj Dubey, Linus Walleij,
	Daniel Lezcano, Tomasz Figa, linux-kernel, Kukjin Kim,
	Linux PM list, Linux ARM, Marek Szyprowski

On Wed, Oct 23, 2019 at 12:56 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
> On Thu, Oct 10, 2019 at 10:29:51PM +0200, Arnd Bergmann wrote:
> > diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c
> > index 9aa483366ebc..da9300d655c6 100644
> > --- a/arch/arm/mach-exynos/exynos.c
> > +++ b/arch/arm/mach-exynos/exynos.c
> >
> > +#define S5P_VA_CHIPID        ((void __iomem __force *)0xF8000000)
>
> How about keeping the S3C_VA and S3C_ADDR_BASE macros/defines and using
> them?

Ok, done now.

> They still appear in arch/arm/include/debug/exynos.S so they could
> be integrated into one header, unless you plan to remove it in further
> patches.

I don't think it actually helps, but it doesn't hurt either:

arch/arm/include/debug/exynos.S cannot #include any mach/*.h header files,
so the definition has to remain duplicated, unless I'm missing something.

Also, the addresses should be completely independent, as long as the virtual
address for the uart does not overlap with the virtual address for the chipid.

One possible cleanup here would be to completely remove the S5P_VA_CHIPID
static map and use ioremap(), but doing that requires that the first call to
soc_is_exynosXXXX() happens after the ioremap.

> > diff --git a/arch/arm/plat-samsung/include/plat/cpu.h b/arch/arm/plat-samsung/include/plat/cpu.h
> > index fadcddbea064..02d7f991d5a3 100644
> > --- a/arch/arm/plat-samsung/include/plat/cpu.h
> > +++ b/arch/arm/plat-samsung/include/plat/cpu.h
> > @@ -111,8 +111,6 @@ extern void s3c24xx_init_io(struct map_desc *mach_desc, int size);
> >  extern void s3c64xx_init_cpu(void);
> >  extern void s5p_init_cpu(const void __iomem *cpuid_addr);
>
> You can remove it as well.

Ok, removed.

        Thanks,

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

* Re: [PATCH 00/36] ARM: samsung platform cleanup
  2019-10-10 20:28 [PATCH 00/36] ARM: samsung platform cleanup Arnd Bergmann
       [not found] ` <20191010203043.1241612-1-arnd@arndb.de>
@ 2019-10-23 13:10 ` Krzysztof Kozlowski
  2019-10-23 13:39   ` Arnd Bergmann
  1 sibling, 1 reply; 22+ messages in thread
From: Krzysztof Kozlowski @ 2019-10-23 13:10 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Kukjin Kim, linux-samsung-soc, linux-arm-kernel, linux-kernel,
	linux-pm, patches, linux-stm32, linux-clk, linux-hwmon,
	linux-input, linux-leds, linux-mmc, linux-pwm, linux-spi,
	linux-serial, linux-usb, dri-devel, linux-fbdev, alsa-devel,
	Lihua Yao, Paweł Chmiel, Lihua Yao, Sergio Prado,
	Sylwester Nawrocki

On Thu, Oct 10, 2019 at 10:28:02PM +0200, Arnd Bergmann wrote:
> I've spent some time looking at the remaining ARMv4/ARMv5 platforms
> that are not part of ARCH_MULTIPLATFORM, and tried to get them closer
> to that. Here is what came out of that for the samsung platforms:
> 
> * Exynos and s5pv210 are made independent of plat-samsung
> * device drivers stop using mach/*.h headers for s3c24xx
>   (and other platforms not in this series)
> * s3c24xx and s3c64xx get merged into mach-s3c, removing
>   the need for plat-samsung (I have other patches for the
>   remaining plat-* directories)
> * mach/io.h gets cleaned up to only be needed for BAST
>   PC104 mode (looking for ideas to proceed)
> * mach/irqs.h remains for now, this still needs to be converted
>   to sparse IRQs.
> 
> Some bits are a little ugly, but overall I think this a big
> improvement.
> 
> The contents are available for testing in
> 
> git://kernel.org:/pub/scm/linux/kernel/git/arnd/playground.git s3c-multiplatform

When sending v2, can you Cc:

Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
Lihua Yao <ylhuajnu@outlook.com>
(or Lihua Yao <ylhuajnu@163.com> if outlook.com bounces)
Sergio Prado <sergio.prado@e-labworks.com>
Sylwester Nawrocki <s.nawrocki@samsung.com>

These are folks which to my knowledge had working S3C and S5P boards
so maybe they could provide testing.

Best regards,
Krzysztof


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

* Re: [PATCH 15/36] ARM: s3c: adc: move header to linux/soc/samsung
  2019-10-23 12:37     ` Krzysztof Kozlowski
@ 2019-10-23 13:23       ` Arnd Bergmann
  0 siblings, 0 replies; 22+ messages in thread
From: Arnd Bergmann @ 2019-10-23 13:23 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Linux ARM, linux-hwmon,
	moderated list:ARM/SAMSUNG EXYNOS ARM ARCHITECTURES,
	Linux PM list, Linus Walleij, Dmitry Torokhov, Sebastian Reichel,
	linux-kernel, Jean Delvare, Kukjin Kim, open list:HID CORE LAYER,
	Guenter Roeck

On Wed, Oct 23, 2019 at 2:41 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:

> > diff --git a/arch/arm/plat-samsung/include/plat/adc.h b/include/linux/soc/samsung/s3c-adc.h
> > similarity index 100%
> > rename from arch/arm/plat-samsung/include/plat/adc.h
> > rename to include/linux/soc/samsung/s3c-adc.h
>
> Can you update the name of header guard? __LINUX_SOC_SAMSUNG_S3C_ADC_H?

Ok, done.

       Arnd

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

* Re: [PATCH 30/36] ARM: s3c: remove cpufreq header dependencies
  2019-10-10 20:30   ` [PATCH 30/36] ARM: s3c: remove cpufreq header dependencies Arnd Bergmann
@ 2019-10-23 13:38     ` Krzysztof Kozlowski
  2019-10-23 13:46       ` Arnd Bergmann
  0 siblings, 1 reply; 22+ messages in thread
From: Krzysztof Kozlowski @ 2019-10-23 13:38 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Kukjin Kim, Rafael J. Wysocki, Viresh Kumar, linux-samsung-soc,
	linux-arm-kernel, linus.walleij, linux-kernel, linux-pm

On Thu, Oct 10, 2019 at 10:30:14PM +0200, Arnd Bergmann wrote:
> The cpufreq drivers are split between the machine directory
> and the drivers/cpufreq directory. In order to share header
> files after we convert s3c to multiplatform, those headers
> have to live in a different global location.
> 
> Move them to linux/soc/samsung/ in lack of a better place.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  arch/arm/mach-s3c24xx/common.c                         |  1 -
>  arch/arm/mach-s3c24xx/cpufreq-utils.c                  |  2 +-
>  arch/arm/mach-s3c24xx/iotiming-s3c2410.c               |  2 +-
>  arch/arm/mach-s3c24xx/iotiming-s3c2412.c               |  2 +-
>  arch/arm/mach-s3c24xx/mach-bast.c                      |  2 +-
>  arch/arm/mach-s3c24xx/mach-osiris-dvs.c                |  2 +-
>  arch/arm/mach-s3c24xx/mach-osiris.c                    |  2 +-
>  arch/arm/mach-s3c24xx/pll-s3c2410.c                    |  4 ++--
>  arch/arm/mach-s3c24xx/pll-s3c2440-12000000.c           |  4 ++--
>  arch/arm/mach-s3c24xx/pll-s3c2440-16934400.c           |  4 ++--
>  arch/arm/mach-s3c24xx/s3c2410.c                        |  1 -
>  arch/arm/mach-s3c24xx/s3c2412.c                        |  1 -
>  arch/arm/mach-s3c24xx/s3c244x.c                        |  2 --
>  arch/arm/mach-s3c64xx/s3c6400.c                        |  1 -
>  arch/arm/mach-s3c64xx/s3c6410.c                        |  2 +-
>  arch/arm/plat-samsung/include/plat/cpu.h               |  9 ---------
>  drivers/cpufreq/s3c2410-cpufreq.c                      |  5 ++---
>  drivers/cpufreq/s3c2412-cpufreq.c                      |  5 ++---
>  drivers/cpufreq/s3c2440-cpufreq.c                      |  5 ++---
>  drivers/cpufreq/s3c24xx-cpufreq-debugfs.c              |  2 +-
>  drivers/cpufreq/s3c24xx-cpufreq.c                      |  5 ++---
>  .../linux/soc/samsung/s3c-cpu-freq.h                   |  0
>  .../linux/soc/samsung/s3c-cpufreq-core.h               |  2 +-
>  include/linux/soc/samsung/s3c-pm.h                     | 10 ++++++++++
>  24 files changed, 33 insertions(+), 42 deletions(-)
>  rename arch/arm/plat-samsung/include/plat/cpu-freq.h => include/linux/soc/samsung/s3c-cpu-freq.h (100%)
>  rename arch/arm/plat-samsung/include/plat/cpu-freq-core.h => include/linux/soc/samsung/s3c-cpufreq-core.h (99%)
> 
> diff --git a/arch/arm/mach-s3c24xx/common.c b/arch/arm/mach-s3c24xx/common.c
> index ebf6bde67816..d16a164df6c4 100644
> --- a/arch/arm/mach-s3c24xx/common.c
> +++ b/arch/arm/mach-s3c24xx/common.c
> @@ -35,7 +35,6 @@
>  
>  #include <plat/cpu.h>
>  #include <plat/devs.h>
> -#include <plat/cpu-freq.h>
>  #include <plat/pwm-core.h>
>  
>  #include "common.h"
> diff --git a/arch/arm/mach-s3c24xx/cpufreq-utils.c b/arch/arm/mach-s3c24xx/cpufreq-utils.c
> index 1a7f38d085dd..43ab714eaa9e 100644
> --- a/arch/arm/mach-s3c24xx/cpufreq-utils.c
> +++ b/arch/arm/mach-s3c24xx/cpufreq-utils.c
> @@ -15,7 +15,7 @@
>  #include <mach/map.h>
>  #include <mach/regs-clock.h>
>  
> -#include <plat/cpu-freq-core.h>
> +#include <linux/soc/samsung/s3c-cpufreq-core.h>
>  
>  #include "regs-mem.h"
>  
> diff --git a/arch/arm/mach-s3c24xx/iotiming-s3c2410.c b/arch/arm/mach-s3c24xx/iotiming-s3c2410.c
> index 9f90aaf70bf3..5b3b16dd0ce8 100644
> --- a/arch/arm/mach-s3c24xx/iotiming-s3c2410.c
> +++ b/arch/arm/mach-s3c24xx/iotiming-s3c2410.c
> @@ -17,7 +17,7 @@
>  #include <mach/map.h>
>  #include <mach/regs-clock.h>
>  
> -#include <plat/cpu-freq-core.h>
> +#include <linux/soc/samsung/s3c-cpufreq-core.h>
>  
>  #include "regs-mem.h"
>  
> diff --git a/arch/arm/mach-s3c24xx/iotiming-s3c2412.c b/arch/arm/mach-s3c24xx/iotiming-s3c2412.c
> index 59356d10fbcf..a22b5611697d 100644
> --- a/arch/arm/mach-s3c24xx/iotiming-s3c2412.c
> +++ b/arch/arm/mach-s3c24xx/iotiming-s3c2412.c
> @@ -24,7 +24,7 @@
>  #include <asm/mach/map.h>
>  
>  #include <plat/cpu.h>
> -#include <plat/cpu-freq-core.h>
> +#include <linux/soc/samsung/s3c-cpufreq-core.h>
>  
>  #include <mach/s3c2412.h>
>  
> diff --git a/arch/arm/mach-s3c24xx/mach-bast.c b/arch/arm/mach-s3c24xx/mach-bast.c
> index cc941b5030ea..b2f2d036bca2 100644
> --- a/arch/arm/mach-s3c24xx/mach-bast.c
> +++ b/arch/arm/mach-s3c24xx/mach-bast.c
> @@ -46,7 +46,7 @@
>  #include <mach/gpio-samsung.h>
>  
>  #include <plat/cpu.h>
> -#include <plat/cpu-freq.h>
> +#include <linux/soc/samsung/s3c-cpu-freq.h>
>  #include <plat/devs.h>
>  #include <plat/gpio-cfg.h>
>  #include <plat/samsung-time.h>
> diff --git a/arch/arm/mach-s3c24xx/mach-osiris-dvs.c b/arch/arm/mach-s3c24xx/mach-osiris-dvs.c
> index 5d819b6ea428..1250520b3bcc 100644
> --- a/arch/arm/mach-s3c24xx/mach-osiris-dvs.c
> +++ b/arch/arm/mach-s3c24xx/mach-osiris-dvs.c
> @@ -14,7 +14,7 @@
>  
>  #include <linux/mfd/tps65010.h>
>  
> -#include <plat/cpu-freq.h>
> +#include <linux/soc/samsung/s3c-cpu-freq.h>
>  #include <mach/gpio-samsung.h>
>  
>  #define OSIRIS_GPIO_DVS	S3C2410_GPB(5)
> diff --git a/arch/arm/mach-s3c24xx/mach-osiris.c b/arch/arm/mach-s3c24xx/mach-osiris.c
> index 262e77bd48de..674164264076 100644
> --- a/arch/arm/mach-s3c24xx/mach-osiris.c
> +++ b/arch/arm/mach-s3c24xx/mach-osiris.c
> @@ -37,7 +37,7 @@
>  #include <linux/mtd/partitions.h>
>  
>  #include <plat/cpu.h>
> -#include <plat/cpu-freq.h>
> +#include <linux/soc/samsung/s3c-cpu-freq.h>
>  #include <plat/devs.h>
>  #include <plat/gpio-cfg.h>
>  #include <plat/samsung-time.h>
> diff --git a/arch/arm/mach-s3c24xx/pll-s3c2410.c b/arch/arm/mach-s3c24xx/pll-s3c2410.c
> index 0561f79ddce8..3fbc99eaa4a2 100644
> --- a/arch/arm/mach-s3c24xx/pll-s3c2410.c
> +++ b/arch/arm/mach-s3c24xx/pll-s3c2410.c
> @@ -15,8 +15,8 @@
>  #include <linux/clk.h>
>  #include <linux/err.h>
>  
> -#include <plat/cpu.h>
> -#include <plat/cpu-freq-core.h>
> +#include <linux/soc/samsung/s3c-cpufreq-core.h>
> +#include <linux/soc/samsung/s3c-pm.h>
>  
>  /* This array should be sorted in ascending order of the frequencies */
>  static struct cpufreq_frequency_table pll_vals_12MHz[] = {
> diff --git a/arch/arm/mach-s3c24xx/pll-s3c2440-12000000.c b/arch/arm/mach-s3c24xx/pll-s3c2440-12000000.c
> index 2ec3a2f9a6a5..fdb8e8c2fe3b 100644
> --- a/arch/arm/mach-s3c24xx/pll-s3c2440-12000000.c
> +++ b/arch/arm/mach-s3c24xx/pll-s3c2440-12000000.c
> @@ -13,8 +13,8 @@
>  #include <linux/clk.h>
>  #include <linux/err.h>
>  
> -#include <plat/cpu.h>
> -#include <plat/cpu-freq-core.h>
> +#include <linux/soc/samsung/s3c-cpufreq-core.h>
> +#include <linux/soc/samsung/s3c-pm.h>
>  
>  /* This array should be sorted in ascending order of the frequencies */
>  static struct cpufreq_frequency_table s3c2440_plls_12[] = {
> diff --git a/arch/arm/mach-s3c24xx/pll-s3c2440-16934400.c b/arch/arm/mach-s3c24xx/pll-s3c2440-16934400.c
> index 4b3d9e36c6bb..438b6fc099a4 100644
> --- a/arch/arm/mach-s3c24xx/pll-s3c2440-16934400.c
> +++ b/arch/arm/mach-s3c24xx/pll-s3c2440-16934400.c
> @@ -13,8 +13,8 @@
>  #include <linux/clk.h>
>  #include <linux/err.h>
>  
> -#include <plat/cpu.h>
> -#include <plat/cpu-freq-core.h>
> +#include <linux/soc/samsung/s3c-cpufreq-core.h>
> +#include <linux/soc/samsung/s3c-pm.h>
>  
>  /* This array should be sorted in ascending order of the frequencies */
>  static struct cpufreq_frequency_table s3c2440_plls_169344[] = {
> diff --git a/arch/arm/mach-s3c24xx/s3c2410.c b/arch/arm/mach-s3c24xx/s3c2410.c
> index 21fd5404bc98..8427c150dd22 100644
> --- a/arch/arm/mach-s3c24xx/s3c2410.c
> +++ b/arch/arm/mach-s3c24xx/s3c2410.c
> @@ -30,7 +30,6 @@
>  #include <asm/irq.h>
>  #include <asm/system_misc.h>
>  
> -#include <plat/cpu-freq.h>
>  
>  #include <mach/regs-clock.h>
>  
> diff --git a/arch/arm/mach-s3c24xx/s3c2412.c b/arch/arm/mach-s3c24xx/s3c2412.c
> index c3fb3e6c0dd8..209f952a6c98 100644
> --- a/arch/arm/mach-s3c24xx/s3c2412.c
> +++ b/arch/arm/mach-s3c24xx/s3c2412.c
> @@ -34,7 +34,6 @@
>  #include <mach/regs-gpio.h>
>  
>  #include <plat/cpu.h>
> -#include <plat/cpu-freq.h>
>  #include <plat/devs.h>
>  #include <plat/pm.h>
>  
> diff --git a/arch/arm/mach-s3c24xx/s3c244x.c b/arch/arm/mach-s3c24xx/s3c244x.c
> index a75f588b9d45..f5bd489bac85 100644
> --- a/arch/arm/mach-s3c24xx/s3c244x.c
> +++ b/arch/arm/mach-s3c24xx/s3c244x.c
> @@ -28,8 +28,6 @@
>  #include <mach/hardware.h>
>  #include <asm/irq.h>
>  
> -#include <plat/cpu-freq.h>
> -
>  #include <mach/regs-clock.h>
>  #include <mach/regs-gpio.h>
>  
> diff --git a/arch/arm/mach-s3c64xx/s3c6400.c b/arch/arm/mach-s3c64xx/s3c6400.c
> index 81233495d548..d18af724c807 100644
> --- a/arch/arm/mach-s3c64xx/s3c6400.c
> +++ b/arch/arm/mach-s3c64xx/s3c6400.c
> @@ -28,7 +28,6 @@
>  
>  #include <asm/irq.h>
>  
> -#include <plat/cpu-freq.h>
>  #include <mach/regs-clock.h>
>  
>  #include <plat/cpu.h>
> diff --git a/arch/arm/mach-s3c64xx/s3c6410.c b/arch/arm/mach-s3c64xx/s3c6410.c
> index 9465a6e0f068..b1d725e55cd2 100644
> --- a/arch/arm/mach-s3c64xx/s3c6410.c
> +++ b/arch/arm/mach-s3c64xx/s3c6410.c
> @@ -29,7 +29,7 @@
>  
>  #include <asm/irq.h>
>  
> -#include <plat/cpu-freq.h>
> +#include <linux/soc/samsung/s3c-pm.h>
>  #include <mach/regs-clock.h>
>  
>  #include <plat/cpu.h>
> diff --git a/arch/arm/plat-samsung/include/plat/cpu.h b/arch/arm/plat-samsung/include/plat/cpu.h
> index 02d7f991d5a3..9dfd58bcc03d 100644
> --- a/arch/arm/plat-samsung/include/plat/cpu.h
> +++ b/arch/arm/plat-samsung/include/plat/cpu.h
> @@ -124,15 +124,6 @@ extern struct syscore_ops s3c2412_pm_syscore_ops;
>  extern struct syscore_ops s3c2416_pm_syscore_ops;
>  extern struct syscore_ops s3c244x_pm_syscore_ops;
>  
> -/* system device subsystems */
> -
> -extern struct bus_type s3c2410_subsys;
> -extern struct bus_type s3c2410a_subsys;
> -extern struct bus_type s3c2412_subsys;
> -extern struct bus_type s3c2416_subsys;
> -extern struct bus_type s3c2440_subsys;
> -extern struct bus_type s3c2442_subsys;
> -extern struct bus_type s3c2443_subsys;
>  extern struct bus_type s3c6410_subsys;
>  
>  #endif
> diff --git a/drivers/cpufreq/s3c2410-cpufreq.c b/drivers/cpufreq/s3c2410-cpufreq.c
> index 5c6cb590b63f..9c2f29cacdd0 100644
> --- a/drivers/cpufreq/s3c2410-cpufreq.c
> +++ b/drivers/cpufreq/s3c2410-cpufreq.c
> @@ -16,13 +16,12 @@
>  #include <linux/clk.h>
>  #include <linux/err.h>
>  #include <linux/io.h>
> +#include <linux/soc/samsung/s3c-cpufreq-core.h>
> +#include <linux/soc/samsung/s3c-pm.h>
>  
>  #include <asm/mach/arch.h>
>  #include <asm/mach/map.h>
>  
> -#include <plat/cpu.h>
> -#include <plat/cpu-freq-core.h>
> -
>  #include <mach/map.h>
>  
>  #define S3C2410_CLKREG(x) ((x) + S3C24XX_VA_CLKPWR)
> diff --git a/drivers/cpufreq/s3c2412-cpufreq.c b/drivers/cpufreq/s3c2412-cpufreq.c
> index d922d0d47c80..38dc9e6db633 100644
> --- a/drivers/cpufreq/s3c2412-cpufreq.c
> +++ b/drivers/cpufreq/s3c2412-cpufreq.c
> @@ -19,15 +19,14 @@
>  #include <linux/clk.h>
>  #include <linux/err.h>
>  #include <linux/io.h>
> +#include <linux/soc/samsung/s3c-cpufreq-core.h>
> +#include <linux/soc/samsung/s3c-pm.h>
>  
>  #include <asm/mach/arch.h>
>  #include <asm/mach/map.h>
>  
>  #include <mach/s3c2412.h>
>  
> -#include <plat/cpu.h>
> -#include <plat/cpu-freq-core.h>
> -
>  #include <mach/map.h>
>  
>  #define S3C2410_CLKREG(x) ((x) + S3C24XX_VA_CLKPWR)
> diff --git a/drivers/cpufreq/s3c2440-cpufreq.c b/drivers/cpufreq/s3c2440-cpufreq.c
> index 5fe7a891fa13..442abdccb9c1 100644
> --- a/drivers/cpufreq/s3c2440-cpufreq.c
> +++ b/drivers/cpufreq/s3c2440-cpufreq.c
> @@ -20,13 +20,12 @@
>  #include <linux/clk.h>
>  #include <linux/err.h>
>  #include <linux/io.h>
> +#include <linux/soc/samsung/s3c-cpufreq-core.h>
> +#include <linux/soc/samsung/s3c-pm.h>
>  
>  #include <asm/mach/arch.h>
>  #include <asm/mach/map.h>
>  
> -#include <plat/cpu.h>
> -#include <plat/cpu-freq-core.h>
> -
>  #include <mach/map.h>
>  
>  #define S3C2410_CLKREG(x) ((x) + S3C24XX_VA_CLKPWR)
> diff --git a/drivers/cpufreq/s3c24xx-cpufreq-debugfs.c b/drivers/cpufreq/s3c24xx-cpufreq-debugfs.c
> index 290e3539d03e..93971dfe7c75 100644
> --- a/drivers/cpufreq/s3c24xx-cpufreq-debugfs.c
> +++ b/drivers/cpufreq/s3c24xx-cpufreq-debugfs.c
> @@ -18,7 +18,7 @@
>  #include <linux/seq_file.h>
>  #include <linux/err.h>
>  
> -#include <plat/cpu-freq-core.h>
> +#include <linux/soc/samsung/s3c-cpufreq-core.h>
>  
>  static struct dentry *dbgfs_root;
>  static struct dentry *dbgfs_file_io;
> diff --git a/drivers/cpufreq/s3c24xx-cpufreq.c b/drivers/cpufreq/s3c24xx-cpufreq.c
> index c786e1197d3c..01b1823ea208 100644
> --- a/drivers/cpufreq/s3c24xx-cpufreq.c
> +++ b/drivers/cpufreq/s3c24xx-cpufreq.c
> @@ -21,13 +21,12 @@
>  #include <linux/device.h>
>  #include <linux/sysfs.h>
>  #include <linux/slab.h>
> +#include <linux/soc/samsung/s3c-cpufreq-core.h>
> +#include <linux/soc/samsung/s3c-pm.h>
>  
>  #include <asm/mach/arch.h>
>  #include <asm/mach/map.h>
>  
> -#include <plat/cpu.h>
> -#include <plat/cpu-freq-core.h>
> -
>  #include <mach/map.h>
>  
>  /* note, cpufreq support deals in kHz, no Hz */
> diff --git a/arch/arm/plat-samsung/include/plat/cpu-freq.h b/include/linux/soc/samsung/s3c-cpu-freq.h
> similarity index 100%
> rename from arch/arm/plat-samsung/include/plat/cpu-freq.h
> rename to include/linux/soc/samsung/s3c-cpu-freq.h
> diff --git a/arch/arm/plat-samsung/include/plat/cpu-freq-core.h b/include/linux/soc/samsung/s3c-cpufreq-core.h
> similarity index 99%
> rename from arch/arm/plat-samsung/include/plat/cpu-freq-core.h
> rename to include/linux/soc/samsung/s3c-cpufreq-core.h
> index 2c7cf2665634..4d22be1031b9 100644

Can you also update the header guard names to match new location?

Best regards,
Krzysztof


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

* Re: [PATCH 00/36] ARM: samsung platform cleanup
  2019-10-23 13:10 ` [PATCH 00/36] ARM: samsung platform cleanup Krzysztof Kozlowski
@ 2019-10-23 13:39   ` Arnd Bergmann
  0 siblings, 0 replies; 22+ messages in thread
From: Arnd Bergmann @ 2019-10-23 13:39 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Linux Fbdev development list, ALSA Development Mailing List,
	dri-devel, Sylwester Nawrocki, linux-clk, linux-leds,
	moderated list:ARM/SAMSUNG EXYNOS ARM ARCHITECTURES, linux-stm32,
	Lihua Yao, Kukjin Kim, linux-serial, open list:HID CORE LAYER,
	Paweł Chmiel, Linux PWM List, Sergio Prado, Linux PM list,
	Lihua Yao, Linux ARM, linux-hwmon, patches, USB list, linux-mmc,
	linux-kernel, linux-spi

On Wed, Oct 23, 2019 at 3:11 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
> On Thu, Oct 10, 2019 at 10:28:02PM +0200, Arnd Bergmann wrote:
> > The contents are available for testing in
> >
> > git://kernel.org:/pub/scm/linux/kernel/git/arnd/playground.git s3c-multiplatform
>
> When sending v2, can you Cc:
>
> Paweł Chmiel <pawel.mikolaj.chmiel@gmail.com>
> Lihua Yao <ylhuajnu@outlook.com>
> (or Lihua Yao <ylhuajnu@163.com> if outlook.com bounces)
> Sergio Prado <sergio.prado@e-labworks.com>
> Sylwester Nawrocki <s.nawrocki@samsung.com>
>
> These are folks which to my knowledge had working S3C and S5P boards
> so maybe they could provide testing.

Ok, will do. I've uploaded the modified version based on your comments to
the above URL for now.

I'll probably give it a little more time before resending, but they
could already
start testing that version.

Thanks a lot for the review!

      Arnd

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

* Re: [PATCH 31/36] ARM: s3c: cpufreq: use global s3c2412_cpufreq_setrefresh
  2019-10-10 20:30   ` [PATCH 31/36] ARM: s3c: cpufreq: use global s3c2412_cpufreq_setrefresh Arnd Bergmann
@ 2019-10-23 13:44     ` Krzysztof Kozlowski
  2019-10-23 13:57       ` Arnd Bergmann
  0 siblings, 1 reply; 22+ messages in thread
From: Krzysztof Kozlowski @ 2019-10-23 13:44 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Kukjin Kim, Rafael J. Wysocki, Viresh Kumar, linux-samsung-soc,
	linux-arm-kernel, linus.walleij, linux-pm, linux-kernel

On Thu, Oct 10, 2019 at 10:30:15PM +0200, Arnd Bergmann wrote:
> There are two identical copies of the s3c2412_cpufreq_setrefresh
> function: a static one in the cpufreq driver and a global
> version in iotiming-s3c2412.c.
> 
> As the function requires the use of a hardcoded register address
> from a header that we want to not be visible to drivers, just
> move the existing global function and add a declaration in
> one of the cpufreq header files.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/cpufreq/s3c2412-cpufreq.c            | 23 --------------------
>  include/linux/soc/samsung/s3c-cpufreq-core.h |  1 +
>  2 files changed, 1 insertion(+), 23 deletions(-)
> 
> diff --git a/drivers/cpufreq/s3c2412-cpufreq.c b/drivers/cpufreq/s3c2412-cpufreq.c
> index 38dc9e6db633..a77c63e92e1a 100644
> --- a/drivers/cpufreq/s3c2412-cpufreq.c
> +++ b/drivers/cpufreq/s3c2412-cpufreq.c
> @@ -25,8 +25,6 @@
>  #include <asm/mach/arch.h>
>  #include <asm/mach/map.h>
>  
> -#include <mach/s3c2412.h>
> -
>  #include <mach/map.h>
>  
>  #define S3C2410_CLKREG(x) ((x) + S3C24XX_VA_CLKPWR)
> @@ -156,27 +154,6 @@ static void s3c2412_cpufreq_setdivs(struct s3c_cpufreq_config *cfg)
>  	clk_set_parent(armclk, cfg->divs.dvs ? hclk : fclk);
>  }
>  
> -static void s3c2412_cpufreq_setrefresh(struct s3c_cpufreq_config *cfg)
> -{
> -	struct s3c_cpufreq_board *board = cfg->board;
> -	unsigned long refresh;
> -
> -	s3c_freq_dbg("%s: refresh %u ns, hclk %lu\n", __func__,
> -		     board->refresh, cfg->freq.hclk);
> -
> -	/* Reduce both the refresh time (in ns) and the frequency (in MHz)
> -	 * by 10 each to ensure that we do not overflow 32 bit numbers. This
> -	 * should work for HCLK up to 133MHz and refresh period up to 30usec.
> -	 */
> -
> -	refresh = (board->refresh / 10);
> -	refresh *= (cfg->freq.hclk / 100);
> -	refresh /= (1 * 1000 * 1000);	/* 10^6 */
> -
> -	s3c_freq_dbg("%s: setting refresh 0x%08lx\n", __func__, refresh);
> -	__raw_writel(refresh, S3C2412_REFRESH);
> -}
> -
>  /* set the default cpu frequency information, based on an 200MHz part
>   * as we have no other way of detecting the speed rating in software.
>   */
> diff --git a/include/linux/soc/samsung/s3c-cpufreq-core.h b/include/linux/soc/samsung/s3c-cpufreq-core.h
> index 4d22be1031b9..eca942559014 100644
> --- a/include/linux/soc/samsung/s3c-cpufreq-core.h
> +++ b/include/linux/soc/samsung/s3c-cpufreq-core.h
> @@ -246,6 +246,7 @@ extern int s3c2412_iotiming_calc(struct s3c_cpufreq_config *cfg,
>  
>  extern void s3c2412_iotiming_set(struct s3c_cpufreq_config *cfg,
>  				 struct s3c_iotimings *iot);
> +extern void s3c2412_cpufreq_setrefresh(struct s3c_cpufreq_config *cfg);

I think that it does not cover the !CONFIG_S3C2412_IOTIMING case.
Either you need to provide also the empty stub or add default=y to
S3C2412_IOTIMING. Otherwise cpufreq driver might end up without this.

Best regards,
Krzysztof

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

* Re: [PATCH 30/36] ARM: s3c: remove cpufreq header dependencies
  2019-10-23 13:38     ` Krzysztof Kozlowski
@ 2019-10-23 13:46       ` Arnd Bergmann
  0 siblings, 0 replies; 22+ messages in thread
From: Arnd Bergmann @ 2019-10-23 13:46 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: moderated list:ARM/SAMSUNG EXYNOS ARM ARCHITECTURES,
	Linux PM list, Viresh Kumar, Linus Walleij, Rafael J. Wysocki,
	linux-kernel, Kukjin Kim, Linux ARM

On Wed, Oct 23, 2019 at 3:38 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
> On Thu, Oct 10, 2019 at 10:30:14PM +0200, Arnd Bergmann wrote:
> > diff --git a/arch/arm/plat-samsung/include/plat/cpu-freq.h b/include/linux/soc/samsung/s3c-cpu-freq.h
> > similarity index 100%
> > rename from arch/arm/plat-samsung/include/plat/cpu-freq.h
> > rename to include/linux/soc/samsung/s3c-cpu-freq.h
> > diff --git a/arch/arm/plat-samsung/include/plat/cpu-freq-core.h b/include/linux/soc/samsung/s3c-cpufreq-core.h
> > similarity index 99%
> > rename from arch/arm/plat-samsung/include/plat/cpu-freq-core.h
> > rename to include/linux/soc/samsung/s3c-cpufreq-core.h
> > index 2c7cf2665634..4d22be1031b9 100644
>
> Can you also update the header guard names to match new location?

Neither of those files had header guards, added them now.

        Arnd

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

* Re: [PATCH 33/36] ARM: s3c: move low-level clk reg access into platform code
  2019-10-10 20:30   ` [PATCH 33/36] ARM: s3c: move low-level clk reg access into platform code Arnd Bergmann
@ 2019-10-23 13:49     ` Krzysztof Kozlowski
  2019-10-23 13:54       ` Arnd Bergmann
  0 siblings, 1 reply; 22+ messages in thread
From: Krzysztof Kozlowski @ 2019-10-23 13:49 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Kukjin Kim, Rafael J. Wysocki, Viresh Kumar, linux-samsung-soc,
	linux-arm-kernel, linus.walleij, linux-kernel, linux-pm

On Thu, Oct 10, 2019 at 10:30:17PM +0200, Arnd Bergmann wrote:
> Rather than have the cpufreq drivers touch include the
> common headers to get the constants, add a small indirection.
> This is still not the proper way that would do this through
> the common clk API, but it lets us kill off the header file
> usage.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  arch/arm/mach-s3c24xx/Makefile               |  2 +-
>  arch/arm/mach-s3c24xx/cpufreq-utils.c        | 32 ++++++++++++++++++++
>  drivers/cpufreq/s3c2410-cpufreq.c            |  8 +----
>  drivers/cpufreq/s3c2412-cpufreq.c            | 10 ++----
>  drivers/cpufreq/s3c2440-cpufreq.c            | 16 +++-------
>  drivers/cpufreq/s3c24xx-cpufreq.c            | 11 ++-----
>  include/linux/soc/samsung/s3c-cpufreq-core.h |  7 +++++
>  7 files changed, 51 insertions(+), 35 deletions(-)
> 
> diff --git a/arch/arm/mach-s3c24xx/Makefile b/arch/arm/mach-s3c24xx/Makefile
> index 695573df00b1..195a4cb23ecb 100644
> --- a/arch/arm/mach-s3c24xx/Makefile
> +++ b/arch/arm/mach-s3c24xx/Makefile
> @@ -38,7 +38,7 @@ obj-$(CONFIG_PM_SLEEP)		+= irq-pm.o sleep.o
>  
>  # common code
>  
> -obj-$(CONFIG_S3C2410_CPUFREQ_UTILS) += cpufreq-utils.o
> +obj-$(CONFIG_ARM_S3C24XX_CPUFREQ) += cpufreq-utils.o

Drop also here S3C2410_CPUFREQ_UTILS entirely.

Best regards,
Krzysztof


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

* Re: [PATCH 33/36] ARM: s3c: move low-level clk reg access into platform code
  2019-10-23 13:49     ` Krzysztof Kozlowski
@ 2019-10-23 13:54       ` Arnd Bergmann
  0 siblings, 0 replies; 22+ messages in thread
From: Arnd Bergmann @ 2019-10-23 13:54 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: moderated list:ARM/SAMSUNG EXYNOS ARM ARCHITECTURES,
	Linux PM list, Viresh Kumar, Linus Walleij, Rafael J. Wysocki,
	linux-kernel, Kukjin Kim, Linux ARM

On Wed, Oct 23, 2019 at 3:50 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:

> >  # common code
> >
> > -obj-$(CONFIG_S3C2410_CPUFREQ_UTILS) += cpufreq-utils.o
> > +obj-$(CONFIG_ARM_S3C24XX_CPUFREQ) += cpufreq-utils.o
>
> Drop also here S3C2410_CPUFREQ_UTILS entirely.
>

Ok, done.

      Arnd

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

* Re: [PATCH 31/36] ARM: s3c: cpufreq: use global s3c2412_cpufreq_setrefresh
  2019-10-23 13:44     ` Krzysztof Kozlowski
@ 2019-10-23 13:57       ` Arnd Bergmann
  0 siblings, 0 replies; 22+ messages in thread
From: Arnd Bergmann @ 2019-10-23 13:57 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: moderated list:ARM/SAMSUNG EXYNOS ARM ARCHITECTURES,
	Linux PM list, Viresh Kumar, Linus Walleij, Rafael J. Wysocki,
	linux-kernel, Kukjin Kim, Linux ARM

On Wed, Oct 23, 2019 at 3:44 PM Krzysztof Kozlowski <krzk@kernel.org> wrote:
> On Thu, Oct 10, 2019 at 10:30:15PM +0200, Arnd Bergmann wrote:

> > @@ -246,6 +246,7 @@ extern int s3c2412_iotiming_calc(struct s3c_cpufreq_config *cfg,
> >
> >  extern void s3c2412_iotiming_set(struct s3c_cpufreq_config *cfg,
> >                                struct s3c_iotimings *iot);
> > +extern void s3c2412_cpufreq_setrefresh(struct s3c_cpufreq_config *cfg);
>
> I think that it does not cover the !CONFIG_S3C2412_IOTIMING case.
> Either you need to provide also the empty stub or add default=y to
> S3C2412_IOTIMING. Otherwise cpufreq driver might end up without this.

S3C2412_IOTIMING is not currently optional, it always gets selected
by ARM_S3C2412_CPUFREQ, unlike S3C2410_IOTIMING which is
only selected by specific boards for reasons I don't understand.

        Arnd

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

end of thread, other threads:[~2019-10-23 13:58 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-10 20:28 [PATCH 00/36] ARM: samsung platform cleanup Arnd Bergmann
     [not found] ` <20191010203043.1241612-1-arnd@arndb.de>
2019-10-10 20:29   ` [PATCH 07/36] ARM: exynos: use private samsung_cpu_id copy Arnd Bergmann
2019-10-23 10:54     ` Krzysztof Kozlowski
2019-10-23 12:37       ` Arnd Bergmann
2019-10-10 20:29   ` [PATCH 15/36] ARM: s3c: adc: move header to linux/soc/samsung Arnd Bergmann
2019-10-10 22:20     ` Guenter Roeck
2019-10-10 22:29       ` Dmitry Torokhov
2019-10-10 22:44         ` Sebastian Reichel
2019-10-23 12:37     ` Krzysztof Kozlowski
2019-10-23 13:23       ` Arnd Bergmann
2019-10-10 20:30   ` [PATCH 29/36] ARM: s3c: cpufreq: split out registers Arnd Bergmann
2019-10-10 20:30   ` [PATCH 30/36] ARM: s3c: remove cpufreq header dependencies Arnd Bergmann
2019-10-23 13:38     ` Krzysztof Kozlowski
2019-10-23 13:46       ` Arnd Bergmann
2019-10-10 20:30   ` [PATCH 31/36] ARM: s3c: cpufreq: use global s3c2412_cpufreq_setrefresh Arnd Bergmann
2019-10-23 13:44     ` Krzysztof Kozlowski
2019-10-23 13:57       ` Arnd Bergmann
2019-10-10 20:30   ` [PATCH 33/36] ARM: s3c: move low-level clk reg access into platform code Arnd Bergmann
2019-10-23 13:49     ` Krzysztof Kozlowski
2019-10-23 13:54       ` Arnd Bergmann
2019-10-23 13:10 ` [PATCH 00/36] ARM: samsung platform cleanup Krzysztof Kozlowski
2019-10-23 13:39   ` Arnd Bergmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).