Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1277535 > unrolled thread

[PATCH 00/10] ARM: s3c64xx multiplatform

Started byArnd Bergmann <arnd@arndb.de>
First post2015-11-25 17:10 +0100
Last post2015-11-25 17:40 +0100
Articles 14 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 00/10] ARM: s3c64xx multiplatform Arnd Bergmann <arnd@arndb.de> - 2015-11-25 17:10 +0100
    [PATCH 03/10] gpio: samsung: move gpio-samsung driver back to platform code Arnd Bergmann <arnd@arndb.de> - 2015-11-25 17:10 +0100
      Re: [PATCH 03/10] gpio: samsung: move gpio-samsung driver back to  platform code Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2015-12-01 01:40 +0100
        Re: [PATCH 03/10] gpio: samsung: move gpio-samsung driver back to platform code Arnd Bergmann <arnd@arndb.de> - 2015-12-01 16:40 +0100
    [PATCH 02/10] ASoC: samsung/smartq: use dynamic registration Arnd Bergmann <arnd@arndb.de> - 2015-11-25 17:10 +0100
      Re: [PATCH 02/10] ASoC: samsung/smartq: use dynamic registration Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2015-12-01 01:30 +0100
        Re: [PATCH 02/10] ASoC: samsung/smartq: use dynamic registration Arnd Bergmann <arnd@arndb.de> - 2015-12-01 16:20 +0100
    [PATCH 08/10] ARM: s3c64xx: use common debug-ll implementation Arnd Bergmann <arnd@arndb.de> - 2015-11-25 17:10 +0100
    [PATCH 10/10] ARM: s3c64xx: allow building without board support Arnd Bergmann <arnd@arndb.de> - 2015-11-25 17:20 +0100
    [PATCH 07/10] ARM: s3c64xx: use new adc/touchscreen driver Arnd Bergmann <arnd@arndb.de> - 2015-11-25 17:20 +0100
    [PATCH 01/10] Input: s3c2410_ts: fix S3C_ADC dependency Arnd Bergmann <arnd@arndb.de> - 2015-11-25 17:20 +0100
      Re: [PATCH 01/10] Input: s3c2410_ts: fix S3C_ADC dependency Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2015-12-01 00:50 +0100
    Re: [PATCH 00/10] ARM: s3c64xx multiplatform Mark Brown <broonie@kernel.org> - 2015-11-25 17:40 +0100
      Re: [PATCH 00/10] ARM: s3c64xx multiplatform Arnd Bergmann <arnd@arndb.de> - 2015-11-25 17:40 +0100

#1277535 — [PATCH 00/10] ARM: s3c64xx multiplatform

FromArnd Bergmann <arnd@arndb.de>
Date2015-11-25 17:10 +0100
Subject[PATCH 00/10] ARM: s3c64xx multiplatform
Message-ID<qyKNQ-9k-13@gated-at.bofh.it>
I've posted the series before and we got a few people to test it
the last time, though I think the touchscreen portion is still
untested.

I'd really like to get this merged for 4.5 and would put it into
a next/multiplatform branch unless there are any objections
or concerns.

Arnd Bergmann (10):
  Input: s3c2410_ts: fix S3C_ADC dependency
  ASoC: samsung/smartq: use dynamic registration
  gpio: samsung: move gpio-samsung driver back to platform code
  ARM: s3c64xx: prepare initcalls for multiplatform
  ARM: s3c64xx: enable sparse IRQ support
  iio: exynos-adc: add experimental touchscreen support
  ARM: s3c64xx: use new adc/touchscreen driver
  ARM: s3c64xx: use common debug-ll implementation
  ARM: s3c64xx: multiplatform support
  ARM: s3c64xx: allow building without board support

 .../devicetree/bindings/arm/samsung/exynos-adc.txt |   3 +
 arch/arm/Kconfig                                   |  26 ---
 arch/arm/Kconfig.debug                             |  19 +-
 arch/arm/configs/multi_v7_defconfig                |   3 +
 arch/arm/configs/s3c6400_defconfig                 |   2 +
 arch/arm/mach-s3c64xx/Kconfig                      |  31 ++-
 arch/arm/mach-s3c64xx/Makefile                     |  24 ++-
 arch/arm/mach-s3c64xx/common.c                     |   5 +-
 arch/arm/mach-s3c64xx/cpuidle.c                    |   5 +-
 arch/arm/mach-s3c64xx/dev-uart.c                   |   1 +
 arch/arm/mach-s3c64xx/include/mach/debug-macro.S   |  38 ----
 arch/arm/mach-s3c64xx/include/mach/gpio-samsung.h  |   3 +
 arch/arm/mach-s3c64xx/include/mach/irqs.h          |  20 +-
 arch/arm/mach-s3c64xx/include/mach/pm-core.h       |   1 +
 arch/arm/mach-s3c64xx/irq-pm.c                     |   2 +-
 arch/arm/mach-s3c64xx/mach-anw6410.c               |   3 +-
 arch/arm/mach-s3c64xx/mach-crag6410-module.c       |   6 +
 arch/arm/mach-s3c64xx/mach-crag6410.c              |   2 +
 arch/arm/mach-s3c64xx/mach-hmt.c                   |   2 +
 arch/arm/mach-s3c64xx/mach-mini6410.c              |   5 +-
 arch/arm/mach-s3c64xx/mach-ncp.c                   |   2 +
 arch/arm/mach-s3c64xx/mach-real6410.c              |   6 +-
 arch/arm/mach-s3c64xx/mach-smartq.c                |  16 +-
 arch/arm/mach-s3c64xx/mach-smartq5.c               |   2 +
 arch/arm/mach-s3c64xx/mach-smartq7.c               |   2 +
 arch/arm/mach-s3c64xx/mach-smdk6400.c              |   3 +-
 arch/arm/mach-s3c64xx/mach-smdk6410.c              |   6 +-
 arch/arm/mach-s3c64xx/pl080.c                      |   4 +
 arch/arm/mach-s3c64xx/pm.c                         |   4 +
 arch/arm/mach-s3c64xx/s3c6400.c                    |   2 +-
 arch/arm/mach-s3c64xx/s3c6410.c                    |   2 +-
 arch/arm/plat-samsung/Kconfig                      |   5 +-
 arch/arm/plat-samsung/Makefile                     |   5 +-
 arch/arm/plat-samsung/devs.c                       |  22 +-
 .../gpio => arch/arm/plat-samsung}/gpio-samsung.c  |  12 +-
 arch/arm/plat-samsung/init.c                       |   5 +
 arch/arm/plat-samsung/pm.c                         |   4 -
 drivers/gpio/Kconfig                               |   7 -
 drivers/gpio/Makefile                              |   1 -
 drivers/iio/adc/exynos_adc.c                       | 224 ++++++++++++++++++++-
 drivers/input/touchscreen/Kconfig                  |   2 +-
 include/linux/platform_data/touchscreen-s3c2410.h  |   1 +
 sound/soc/samsung/smartq_wm8987.c                  |  77 +++----
 43 files changed, 410 insertions(+), 205 deletions(-)
 delete mode 100644 arch/arm/mach-s3c64xx/include/mach/debug-macro.S
 rename {drivers/gpio => arch/arm/plat-samsung}/gpio-samsung.c (99%)

-- 
2.1.0.rc2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1277537 — [PATCH 03/10] gpio: samsung: move gpio-samsung driver back to platform code

FromArnd Bergmann <arnd@arndb.de>
Date2015-11-25 17:10 +0100
Subject[PATCH 03/10] gpio: samsung: move gpio-samsung driver back to platform code
Message-ID<qyKNS-9k-55@gated-at.bofh.it>
In reply to#1277535
The gpio-samsung driver is special in the sense that it
interacts directly in multiple ways with the legacy platform
code for the s3c24xx and s3c64xx platforms. In contrast,
all devicetree based machines for Samsung, including the
ones on those two SoC families use a different driver.

The header files that define the interface between the platform
code and the gpio driver are not visible when building a
kernel for ARCH_MULTIPLATFORM, which prevents us from
turning on this option for s3c64xx.

To work around this, we now move the driver back into platform
code, from where it was originally moved to as part of commit
1b39d5f2cc5c28 ("gpio/samsung: gpio-samsung.c to support
Samsung GPIOs").

The long-term plan for this driver would be to remove it
entirely, after all Samsung machines have been converted
over to boot from DT, but there is currently no timeline
for when that might happen.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/plat-samsung/Kconfig                          | 3 +++
 arch/arm/plat-samsung/Makefile                         | 2 ++
 {drivers/gpio => arch/arm/plat-samsung}/gpio-samsung.c | 0
 drivers/gpio/Kconfig                                   | 7 -------
 drivers/gpio/Makefile                                  | 1 -
 5 files changed, 5 insertions(+), 8 deletions(-)
 rename {drivers/gpio => arch/arm/plat-samsung}/gpio-samsung.c (100%)

diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
index 57729b915003..83697414bfa0 100644
--- a/arch/arm/plat-samsung/Kconfig
+++ b/arch/arm/plat-samsung/Kconfig
@@ -294,6 +294,9 @@ config SAMSUNG_WDT_RESET
 	  Compile support for system restart by triggering watchdog reset.
 	  Used on SoCs that do not provide dedicated reset control.
 
+config GPIO_SAMSUNG
+	def_bool SAMSUNG_ATAGS
+
 config DEBUG_S3C_UART
 	depends on PLAT_SAMSUNG
 	int
diff --git a/arch/arm/plat-samsung/Makefile b/arch/arm/plat-samsung/Makefile
index 8c911760f55f..aeb19e3288b9 100644
--- a/arch/arm/plat-samsung/Makefile
+++ b/arch/arm/plat-samsung/Makefile
@@ -21,6 +21,8 @@ obj-$(CONFIG_SAMSUNG_ATAGS)	+= platformdata.o
 obj-$(CONFIG_SAMSUNG_ATAGS)	+= devs.o
 obj-$(CONFIG_SAMSUNG_ATAGS)	+= dev-uart.o
 
+obj-$(CONFIG_GPIO_SAMSUNG)     += gpio-samsung.o
+
 # PM support
 
 obj-$(CONFIG_PM_SLEEP)		+= pm-common.o
diff --git a/drivers/gpio/gpio-samsung.c b/arch/arm/plat-samsung/gpio-samsung.c
similarity index 100%
rename from drivers/gpio/gpio-samsung.c
rename to arch/arm/plat-samsung/gpio-samsung.c
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index b18bea08ff25..5e4e9f5c8a64 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -344,13 +344,6 @@ config GPIO_RCAR
 	help
 	  Say yes here to support GPIO on Renesas R-Car SoCs.
 
-config GPIO_SAMSUNG
-	bool
-	depends on PLAT_SAMSUNG
-	help
-	  Legacy GPIO support. Use only for platforms without support for
-	  pinctrl.
-
 config GPIO_SPEAR_SPICS
 	bool "ST SPEAr13xx SPI Chip Select as GPIO support"
 	depends on PLAT_SPEAR
diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
index 986dbd838cea..8555e947372e 100644
--- a/drivers/gpio/Makefile
+++ b/drivers/gpio/Makefile
@@ -79,7 +79,6 @@ obj-$(CONFIG_GPIO_PXA)		+= gpio-pxa.o
 obj-$(CONFIG_GPIO_RC5T583)	+= gpio-rc5t583.o
 obj-$(CONFIG_GPIO_RDC321X)	+= gpio-rdc321x.o
 obj-$(CONFIG_GPIO_RCAR)		+= gpio-rcar.o
-obj-$(CONFIG_GPIO_SAMSUNG)	+= gpio-samsung.o
 obj-$(CONFIG_ARCH_SA1100)	+= gpio-sa1100.o
 obj-$(CONFIG_GPIO_SCH)		+= gpio-sch.o
 obj-$(CONFIG_GPIO_SCH311X)	+= gpio-sch311x.o
-- 
2.1.0.rc2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1280428 — Re: [PATCH 03/10] gpio: samsung: move gpio-samsung driver back to platform code

FromKrzysztof Kozlowski <k.kozlowski@samsung.com>
Date2015-12-01 01:40 +0100
SubjectRe: [PATCH 03/10] gpio: samsung: move gpio-samsung driver back to platform code
Message-ID<qAH97-2nP-3@gated-at.bofh.it>
In reply to#1277537
On 26.11.2015 01:06, Arnd Bergmann wrote:
> The gpio-samsung driver is special in the sense that it
> interacts directly in multiple ways with the legacy platform
> code for the s3c24xx and s3c64xx platforms. In contrast,
> all devicetree based machines for Samsung, including the
> ones on those two SoC families use a different driver.
> 
> The header files that define the interface between the platform
> code and the gpio driver are not visible when building a
> kernel for ARCH_MULTIPLATFORM, which prevents us from
> turning on this option for s3c64xx.
> 
> To work around this, we now move the driver back into platform
> code, from where it was originally moved to as part of commit
> 1b39d5f2cc5c28 ("gpio/samsung: gpio-samsung.c to support
> Samsung GPIOs").
> 
> The long-term plan for this driver would be to remove it
> entirely, after all Samsung machines have been converted
> over to boot from DT, but there is currently no timeline
> for when that might happen.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  arch/arm/plat-samsung/Kconfig                          | 3 +++
>  arch/arm/plat-samsung/Makefile                         | 2 ++
>  {drivers/gpio => arch/arm/plat-samsung}/gpio-samsung.c | 0
>  drivers/gpio/Kconfig                                   | 7 -------
>  drivers/gpio/Makefile                                  | 1 -
>  5 files changed, 5 insertions(+), 8 deletions(-)
>  rename {drivers/gpio => arch/arm/plat-samsung}/gpio-samsung.c (100%)
> 
> diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
> index 57729b915003..83697414bfa0 100644
> --- a/arch/arm/plat-samsung/Kconfig
> +++ b/arch/arm/plat-samsung/Kconfig
> @@ -294,6 +294,9 @@ config SAMSUNG_WDT_RESET
>  	  Compile support for system restart by triggering watchdog reset.
>  	  Used on SoCs that do not provide dedicated reset control.
>  
> +config GPIO_SAMSUNG
> +	def_bool SAMSUNG_ATAGS
> +

I think this should be put inside "if SAMSUNG_ATAGS" section, just
before SAMSUNG_PM_GPIO (with default=y?). It makes more consistent with
rest of the options depending on ATAGS.

Rest seems fine:
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

Best regards,
Krzysztof

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1280971 — Re: [PATCH 03/10] gpio: samsung: move gpio-samsung driver back to platform code

FromArnd Bergmann <arnd@arndb.de>
Date2015-12-01 16:40 +0100
SubjectRe: [PATCH 03/10] gpio: samsung: move gpio-samsung driver back to platform code
Message-ID<qAVc7-30Q-31@gated-at.bofh.it>
In reply to#1280428
On Tuesday 01 December 2015 09:34:18 Krzysztof Kozlowski wrote:
> On 26.11.2015 01:06, Arnd Bergmann wrote:
> > diff --git a/arch/arm/plat-samsung/Kconfig b/arch/arm/plat-samsung/Kconfig
> > index 57729b915003..83697414bfa0 100644
> > --- a/arch/arm/plat-samsung/Kconfig
> > +++ b/arch/arm/plat-samsung/Kconfig
> > @@ -294,6 +294,9 @@ config SAMSUNG_WDT_RESET
> >         Compile support for system restart by triggering watchdog reset.
> >         Used on SoCs that do not provide dedicated reset control.
> >  
> > +config GPIO_SAMSUNG
> > +     def_bool SAMSUNG_ATAGS
> > +
> 
> I think this should be put inside "if SAMSUNG_ATAGS" section, just
> before SAMSUNG_PM_GPIO (with default=y?). It makes more consistent with
> rest of the options depending on ATAGS.

Good idea, changed that now.

> Rest seems fine:
> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

Thanks,

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1277538 — [PATCH 02/10] ASoC: samsung/smartq: use dynamic registration

FromArnd Bergmann <arnd@arndb.de>
Date2015-11-25 17:10 +0100
Subject[PATCH 02/10] ASoC: samsung/smartq: use dynamic registration
Message-ID<qyKNS-9k-57@gated-at.bofh.it>
In reply to#1277535
As a prerequisite for moving s3c64xx into multiplatform configurations,
we need to change the smartq audio driver to stop using hardcoded
gpio numbers from the header file, and instead pass the gpio data
through platform_data.

In order to do that, we also move the code to use module_platform_driver
and register the platform device using platform_device_register_simple
and register the gpios through the gpiod API.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Mark Brown <broonie@kernel.org>
---
 arch/arm/mach-s3c64xx/mach-smartq.c | 13 +++++++
 sound/soc/samsung/smartq_wm8987.c   | 77 +++++++++++++------------------------
 2 files changed, 40 insertions(+), 50 deletions(-)

diff --git a/arch/arm/mach-s3c64xx/mach-smartq.c b/arch/arm/mach-s3c64xx/mach-smartq.c
index acdfb5fac40f..96784e7f894a 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq.c
@@ -12,6 +12,7 @@
 #include <linux/delay.h>
 #include <linux/fb.h>
 #include <linux/gpio.h>
+#include <linux/gpio/machine.h>
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/pwm.h>
@@ -383,6 +384,15 @@ void __init smartq_map_io(void)
 	smartq_lcd_mode_set();
 }
 
+static struct gpiod_lookup_table smartq_audio_gpios = {
+	.dev_id = "smartq-audio",
+	.table = {
+		GPIO_LOOKUP("GPL", 12, "headphone detect", 0),
+		GPIO_LOOKUP("GPK", 12, "amplifiers shutdown", 0),
+		{ },
+	},
+};
+
 void __init smartq_machine_init(void)
 {
 	s3c_i2c0_set_platdata(NULL);
@@ -402,4 +412,7 @@ void __init smartq_machine_init(void)
 
 	pwm_add_table(smartq_pwm_lookup, ARRAY_SIZE(smartq_pwm_lookup));
 	platform_add_devices(smartq_devices, ARRAY_SIZE(smartq_devices));
+
+	gpiod_add_lookup_table(&smartq_audio_gpios);
+	platform_device_register_simple("smartq-audio", -1, NULL, 0);
 }
diff --git a/sound/soc/samsung/smartq_wm8987.c b/sound/soc/samsung/smartq_wm8987.c
index a0fe37fbed9f..c6769b16eb19 100644
--- a/sound/soc/samsung/smartq_wm8987.c
+++ b/sound/soc/samsung/smartq_wm8987.c
@@ -13,15 +13,12 @@
  *
  */
 
-#include <linux/gpio.h>
+#include <linux/gpio/consumer.h>
 #include <linux/module.h>
 
 #include <sound/soc.h>
 #include <sound/jack.h>
 
-#include <mach/gpio-samsung.h>
-#include <asm/mach-types.h>
-
 #include "i2s.h"
 #include "../codecs/wm8750.h"
 
@@ -96,7 +93,7 @@ static struct snd_soc_jack_pin smartq_jack_pins[] = {
 
 static struct snd_soc_jack_gpio smartq_jack_gpios[] = {
 	{
-		.gpio		= S3C64XX_GPL(12),
+		.gpio		= -1,
 		.name		= "headphone detect",
 		.report		= SND_JACK_HEADPHONE,
 		.debounce_time	= 200,
@@ -113,7 +110,9 @@ static int smartq_speaker_event(struct snd_soc_dapm_widget *w,
 				struct snd_kcontrol *k,
 				int event)
 {
-	gpio_set_value(S3C64XX_GPK(12), SND_SOC_DAPM_EVENT_OFF(event));
+	struct gpio_desc *gpio = snd_soc_card_get_drvdata(&snd_soc_smartq);
+
+	gpiod_set_value(gpio, SND_SOC_DAPM_EVENT_OFF(event));
 
 	return 0;
 }
@@ -199,62 +198,40 @@ static struct snd_soc_card snd_soc_smartq = {
 	.num_controls = ARRAY_SIZE(wm8987_smartq_controls),
 };
 
-static struct platform_device *smartq_snd_device;
-
-static int __init smartq_init(void)
+static int smartq_probe(struct platform_device *pdev)
 {
+	struct gpio_desc *gpio;
 	int ret;
 
-	if (!machine_is_smartq7() && !machine_is_smartq5()) {
-		pr_info("Only SmartQ is supported by this ASoC driver\n");
-		return -ENODEV;
-	}
-
-	smartq_snd_device = platform_device_alloc("soc-audio", -1);
-	if (!smartq_snd_device)
-		return -ENOMEM;
-
-	platform_set_drvdata(smartq_snd_device, &snd_soc_smartq);
-
-	ret = platform_device_add(smartq_snd_device);
-	if (ret) {
-		platform_device_put(smartq_snd_device);
-		return ret;
-	}
+	platform_set_drvdata(pdev, &snd_soc_smartq);
 
 	/* Initialise GPIOs used by amplifiers */
-	ret = gpio_request(S3C64XX_GPK(12), "amplifiers shutdown");
-	if (ret) {
-		dev_err(&smartq_snd_device->dev, "Failed to register GPK12\n");
-		goto err_unregister_device;
+	gpio = devm_gpiod_get(&pdev->dev, "amplifiers shutdown",
+			      GPIOD_OUT_HIGH);
+	if (IS_ERR(gpio)) {
+		dev_err(&pdev->dev, "Failed to register GPK12\n");
+		ret = PTR_ERR(gpio);
+		goto out;
 	}
+	snd_soc_card_set_drvdata(&snd_soc_smartq, gpio);
 
-	/* Disable amplifiers */
-	ret = gpio_direction_output(S3C64XX_GPK(12), 1);
-	if (ret) {
-		dev_err(&smartq_snd_device->dev, "Failed to configure GPK12\n");
-		goto err_free_gpio_amp_shut;
-	}
-
-	return 0;
-
-err_free_gpio_amp_shut:
-	gpio_free(S3C64XX_GPK(12));
-err_unregister_device:
-	platform_device_unregister(smartq_snd_device);
+	ret = devm_snd_soc_register_card(&pdev->dev, &snd_soc_smartq);
+	if (ret)
+		dev_err(&pdev->dev, "Failed to register card\n");
 
+out:
 	return ret;
 }
 
-static void __exit smartq_exit(void)
-{
-	gpio_free(S3C64XX_GPK(12));
-
-	platform_device_unregister(smartq_snd_device);
-}
+static struct platform_driver smartq_driver = {
+	.driver = {
+		.name = "smartq-audio",
+		.owner = THIS_MODULE,
+	},
+	.probe = smartq_probe,
+};
 
-module_init(smartq_init);
-module_exit(smartq_exit);
+module_platform_driver(smartq_driver);
 
 /* Module information */
 MODULE_AUTHOR("Maurus Cuelenaere <mcuelenaere@gmail.com>");
-- 
2.1.0.rc2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1280426 — Re: [PATCH 02/10] ASoC: samsung/smartq: use dynamic registration

FromKrzysztof Kozlowski <k.kozlowski@samsung.com>
Date2015-12-01 01:30 +0100
SubjectRe: [PATCH 02/10] ASoC: samsung/smartq: use dynamic registration
Message-ID<qAGZs-2kK-11@gated-at.bofh.it>
In reply to#1277538
On 26.11.2015 01:06, Arnd Bergmann wrote:
> As a prerequisite for moving s3c64xx into multiplatform configurations,
> we need to change the smartq audio driver to stop using hardcoded
> gpio numbers from the header file, and instead pass the gpio data
> through platform_data.
> 
> In order to do that, we also move the code to use module_platform_driver
> and register the platform device using platform_device_register_simple
> and register the gpios through the gpiod API.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Acked-by: Mark Brown <broonie@kernel.org>
> ---
>  arch/arm/mach-s3c64xx/mach-smartq.c | 13 +++++++
>  sound/soc/samsung/smartq_wm8987.c   | 77 +++++++++++++------------------------
>  2 files changed, 40 insertions(+), 50 deletions(-)
> 
> diff --git a/arch/arm/mach-s3c64xx/mach-smartq.c b/arch/arm/mach-s3c64xx/mach-smartq.c
> index acdfb5fac40f..96784e7f894a 100644
> --- a/arch/arm/mach-s3c64xx/mach-smartq.c
> +++ b/arch/arm/mach-s3c64xx/mach-smartq.c
> @@ -12,6 +12,7 @@
>  #include <linux/delay.h>
>  #include <linux/fb.h>
>  #include <linux/gpio.h>
> +#include <linux/gpio/machine.h>
>  #include <linux/init.h>
>  #include <linux/platform_device.h>
>  #include <linux/pwm.h>
> @@ -383,6 +384,15 @@ void __init smartq_map_io(void)
>  	smartq_lcd_mode_set();
>  }
>  
> +static struct gpiod_lookup_table smartq_audio_gpios = {
> +	.dev_id = "smartq-audio",
> +	.table = {
> +		GPIO_LOOKUP("GPL", 12, "headphone detect", 0),
> +		GPIO_LOOKUP("GPK", 12, "amplifiers shutdown", 0),
> +		{ },
> +	},
> +};
> +
>  void __init smartq_machine_init(void)
>  {
>  	s3c_i2c0_set_platdata(NULL);
> @@ -402,4 +412,7 @@ void __init smartq_machine_init(void)
>  
>  	pwm_add_table(smartq_pwm_lookup, ARRAY_SIZE(smartq_pwm_lookup));
>  	platform_add_devices(smartq_devices, ARRAY_SIZE(smartq_devices));
> +
> +	gpiod_add_lookup_table(&smartq_audio_gpios);
> +	platform_device_register_simple("smartq-audio", -1, NULL, 0);
>  }
> diff --git a/sound/soc/samsung/smartq_wm8987.c b/sound/soc/samsung/smartq_wm8987.c
> index a0fe37fbed9f..c6769b16eb19 100644
> --- a/sound/soc/samsung/smartq_wm8987.c
> +++ b/sound/soc/samsung/smartq_wm8987.c
> @@ -13,15 +13,12 @@
>   *
>   */
>  
> -#include <linux/gpio.h>
> +#include <linux/gpio/consumer.h>
>  #include <linux/module.h>
>  
>  #include <sound/soc.h>
>  #include <sound/jack.h>
>  
> -#include <mach/gpio-samsung.h>
> -#include <asm/mach-types.h>
> -
>  #include "i2s.h"
>  #include "../codecs/wm8750.h"
>  
> @@ -96,7 +93,7 @@ static struct snd_soc_jack_pin smartq_jack_pins[] = {
>  
>  static struct snd_soc_jack_gpio smartq_jack_gpios[] = {
>  	{
> -		.gpio		= S3C64XX_GPL(12),
> +		.gpio		= -1,
>  		.name		= "headphone detect",
>  		.report		= SND_JACK_HEADPHONE,
>  		.debounce_time	= 200,
> @@ -113,7 +110,9 @@ static int smartq_speaker_event(struct snd_soc_dapm_widget *w,
>  				struct snd_kcontrol *k,
>  				int event)
>  {
> -	gpio_set_value(S3C64XX_GPK(12), SND_SOC_DAPM_EVENT_OFF(event));
> +	struct gpio_desc *gpio = snd_soc_card_get_drvdata(&snd_soc_smartq);
> +
> +	gpiod_set_value(gpio, SND_SOC_DAPM_EVENT_OFF(event));
>  
>  	return 0;
>  }
> @@ -199,62 +198,40 @@ static struct snd_soc_card snd_soc_smartq = {
>  	.num_controls = ARRAY_SIZE(wm8987_smartq_controls),
>  };
>  
> -static struct platform_device *smartq_snd_device;
> -
> -static int __init smartq_init(void)
> +static int smartq_probe(struct platform_device *pdev)
>  {
> +	struct gpio_desc *gpio;
>  	int ret;
>  
> -	if (!machine_is_smartq7() && !machine_is_smartq5()) {
> -		pr_info("Only SmartQ is supported by this ASoC driver\n");
> -		return -ENODEV;
> -	}
> -
> -	smartq_snd_device = platform_device_alloc("soc-audio", -1);
> -	if (!smartq_snd_device)
> -		return -ENOMEM;
> -
> -	platform_set_drvdata(smartq_snd_device, &snd_soc_smartq);
> -
> -	ret = platform_device_add(smartq_snd_device);
> -	if (ret) {
> -		platform_device_put(smartq_snd_device);
> -		return ret;
> -	}
> +	platform_set_drvdata(pdev, &snd_soc_smartq);
>  
>  	/* Initialise GPIOs used by amplifiers */
> -	ret = gpio_request(S3C64XX_GPK(12), "amplifiers shutdown");
> -	if (ret) {
> -		dev_err(&smartq_snd_device->dev, "Failed to register GPK12\n");
> -		goto err_unregister_device;
> +	gpio = devm_gpiod_get(&pdev->dev, "amplifiers shutdown",
> +			      GPIOD_OUT_HIGH);
> +	if (IS_ERR(gpio)) {
> +		dev_err(&pdev->dev, "Failed to register GPK12\n");
> +		ret = PTR_ERR(gpio);
> +		goto out;
>  	}
> +	snd_soc_card_set_drvdata(&snd_soc_smartq, gpio);
>  
> -	/* Disable amplifiers */
> -	ret = gpio_direction_output(S3C64XX_GPK(12), 1);
> -	if (ret) {
> -		dev_err(&smartq_snd_device->dev, "Failed to configure GPK12\n");
> -		goto err_free_gpio_amp_shut;
> -	}
> -
> -	return 0;
> -
> -err_free_gpio_amp_shut:
> -	gpio_free(S3C64XX_GPK(12));
> -err_unregister_device:
> -	platform_device_unregister(smartq_snd_device);
> +	ret = devm_snd_soc_register_card(&pdev->dev, &snd_soc_smartq);
> +	if (ret)
> +		dev_err(&pdev->dev, "Failed to register card\n");
>  
> +out:
>  	return ret;
>  }
>  
> -static void __exit smartq_exit(void)
> -{
> -	gpio_free(S3C64XX_GPK(12));
> -
> -	platform_device_unregister(smartq_snd_device);
> -}
> +static struct platform_driver smartq_driver = {
> +	.driver = {
> +		.name = "smartq-audio",
> +		.owner = THIS_MODULE,

The owner should not be needed (coccicheck should also complain). Rest
looks good, so:

Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

Best regards,
Krzysztof

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1280949 — Re: [PATCH 02/10] ASoC: samsung/smartq: use dynamic registration

FromArnd Bergmann <arnd@arndb.de>
Date2015-12-01 16:20 +0100
SubjectRe: [PATCH 02/10] ASoC: samsung/smartq: use dynamic registration
Message-ID<qAUSK-2T0-33@gated-at.bofh.it>
In reply to#1280426
On Tuesday 01 December 2015 09:24:24 Krzysztof Kozlowski wrote:
> > +static struct platform_driver smartq_driver = {
> > +     .driver = {
> > +             .name = "smartq-audio",
> > +             .owner = THIS_MODULE,
> 
> The owner should not be needed (coccicheck should also complain). Rest
> looks good, so:

Good catch, fixed now!
 
> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

thanks,

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1277541 — [PATCH 08/10] ARM: s3c64xx: use common debug-ll implementation

FromArnd Bergmann <arnd@arndb.de>
Date2015-11-25 17:10 +0100
Subject[PATCH 08/10] ARM: s3c64xx: use common debug-ll implementation
Message-ID<qyKNS-9k-69@gated-at.bofh.it>
In reply to#1277535
The uart on s3c64xx is essentially the same as on s3c24xx,
so we can share a single assembler file. However, the addresses
are different, and we need to add the respective Kconfig magic
to get the right addresses.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/Kconfig.debug                           | 19 +++++++++++-
 arch/arm/mach-s3c64xx/include/mach/debug-macro.S | 38 ------------------------
 2 files changed, 18 insertions(+), 39 deletions(-)
 delete mode 100644 arch/arm/mach-s3c64xx/include/mach/debug-macro.S

diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
index 259c0ca9c99a..17ca2b5f8be7 100644
--- a/arch/arm/Kconfig.debug
+++ b/arch/arm/Kconfig.debug
@@ -857,6 +857,7 @@ choice
 		depends on PLAT_SAMSUNG
 		select DEBUG_EXYNOS_UART if ARCH_EXYNOS
 		select DEBUG_S3C24XX_UART if ARCH_S3C24XX
+		select DEBUG_S3C64XX_UART if ARCH_S3C64XX
 		select DEBUG_S5PV210_UART if ARCH_S5PV210
 		bool "Use Samsung S3C UART 0 for low-level debug"
 		help
@@ -868,6 +869,7 @@ choice
 		depends on PLAT_SAMSUNG
 		select DEBUG_EXYNOS_UART if ARCH_EXYNOS
 		select DEBUG_S3C24XX_UART if ARCH_S3C24XX
+		select DEBUG_S3C64XX_UART if ARCH_S3C64XX
 		select DEBUG_S5PV210_UART if ARCH_S5PV210
 		bool "Use Samsung S3C UART 1 for low-level debug"
 		help
@@ -879,6 +881,7 @@ choice
 		depends on PLAT_SAMSUNG
 		select DEBUG_EXYNOS_UART if ARCH_EXYNOS
 		select DEBUG_S3C24XX_UART if ARCH_S3C24XX
+		select DEBUG_S3C64XX_UART if ARCH_S3C64XX
 		select DEBUG_S5PV210_UART if ARCH_S5PV210
 		bool "Use Samsung S3C UART 2 for low-level debug"
 		help
@@ -889,6 +892,7 @@ choice
 	config DEBUG_S3C_UART3
 		depends on PLAT_SAMSUNG && (ARCH_EXYNOS || ARCH_S5PV210)
 		select DEBUG_EXYNOS_UART if ARCH_EXYNOS
+		select DEBUG_S3C64XX_UART if ARCH_S3C64XX
 		select DEBUG_S5PV210_UART if ARCH_S5PV210
 		bool "Use Samsung S3C UART 3 for low-level debug"
 		help
@@ -1253,6 +1257,9 @@ config DEBUG_S3C2410_UART
 config DEBUG_S3C24XX_UART
 	bool
 
+config DEBUG_S3C64XX_UART
+	bool
+
 config DEBUG_S5PV210_UART
 	bool
 
@@ -1338,7 +1345,7 @@ config DEBUG_LL_INCLUDE
 	default "debug/renesas-scif.S" if DEBUG_RMOBILE_SCIFA0
 	default "debug/renesas-scif.S" if DEBUG_RMOBILE_SCIFA1
 	default "debug/renesas-scif.S" if DEBUG_RMOBILE_SCIFA4
-	default "debug/s3c24xx.S" if DEBUG_S3C24XX_UART
+	default "debug/s3c24xx.S" if DEBUG_S3C24XX_UART || DEBUG_S3C64XX_UART
 	default "debug/s5pv210.S" if DEBUG_S5PV210_UART
 	default "debug/sirf.S" if DEBUG_SIRFSOC_UART
 	default "debug/sti.S" if DEBUG_STI_UART
@@ -1416,6 +1423,10 @@ config DEBUG_UART_PHYS
 				DEBUG_S3C2410_UART2)
 	default 0x78000000 if DEBUG_CNS3XXX
 	default 0x7c0003f8 if FOOTBRIDGE
+	default 0x7f005000 if DEBUG_S3C64XX_UART && DEBUG_S3C_UART0
+	default 0x7f005400 if DEBUG_S3C64XX_UART && DEBUG_S3C_UART1
+	default 0x7f005800 if DEBUG_S3C64XX_UART && DEBUG_S3C_UART2
+	default 0x7f005c00 if DEBUG_S3C64XX_UART && DEBUG_S3C_UART3
 	default 0x80010000 if DEBUG_ASM9260_UART
 	default 0x80070000 if DEBUG_IMX23_UART
 	default 0x80074000 if DEBUG_IMX28_UART
@@ -1474,6 +1485,7 @@ config DEBUG_UART_PHYS
 		DEBUG_RCAR_GEN2_SCIF0 || DEBUG_RCAR_GEN2_SCIF2 || \
 		DEBUG_RMOBILE_SCIFA0 || DEBUG_RMOBILE_SCIFA1 || \
 		DEBUG_RMOBILE_SCIFA4 || DEBUG_S3C24XX_UART || \
+		DEBUG_S3C64XX_UART || \
 		DEBUG_UART_BCM63XX || DEBUG_ASM9260_UART || \
 		DEBUG_SIRFSOC_UART || DEBUG_DIGICOLOR_UA0 || \
 		DEBUG_AT91_UART
@@ -1499,8 +1511,12 @@ config DEBUG_UART_VIRT
 	default 0xf4090000 if ARCH_LPC32XX
 	default 0xf4200000 if ARCH_GEMINI
 	default 0xf7000000 if DEBUG_SUN9I_UART0
+	default 0xf7000000 if DEBUG_S3C64XX_UART && DEBUG_S3C_UART0
 	default 0xf7000000 if DEBUG_S3C24XX_UART && (DEBUG_S3C_UART0 || \
 				DEBUG_S3C2410_UART0)
+	default 0xf7000400 if DEBUG_S3C64XX_UART && DEBUG_S3C_UART1
+	default 0xf7000800 if DEBUG_S3C64XX_UART && DEBUG_S3C_UART2
+	default 0xf7000c00 if DEBUG_S3C64XX_UART && DEBUG_S3C_UART3
 	default 0xf7004000 if DEBUG_S3C24XX_UART && (DEBUG_S3C_UART1 || \
 				DEBUG_S3C2410_UART1)
 	default 0xf7008000 if DEBUG_S3C24XX_UART && (DEBUG_S3C_UART2 || \
@@ -1566,6 +1582,7 @@ config DEBUG_UART_VIRT
 		DEBUG_UART_8250 || DEBUG_UART_PL01X || DEBUG_MESON_UARTAO || \
 		DEBUG_NETX_UART || \
 		DEBUG_QCOM_UARTDM || DEBUG_S3C24XX_UART || \
+		DEBUG_S3C64XX_UART || \
 		DEBUG_UART_BCM63XX || DEBUG_ASM9260_UART || \
 		DEBUG_SIRFSOC_UART || DEBUG_DIGICOLOR_UA0
 
diff --git a/arch/arm/mach-s3c64xx/include/mach/debug-macro.S b/arch/arm/mach-s3c64xx/include/mach/debug-macro.S
deleted file mode 100644
index c9b95325b672..000000000000
--- a/arch/arm/mach-s3c64xx/include/mach/debug-macro.S
+++ /dev/null
@@ -1,38 +0,0 @@
-/* arch/arm/mach-s3c6400/include/mach/debug-macro.S
- *
- * Copyright 2008 Openmoko, Inc.
- * Copyright 2008 Simtec Electronics
- *	http://armlinux.simtec.co.uk/
- *	Ben Dooks <ben@simtec.co.uk>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
-*/
-
-/* pull in the relevant register and map files. */
-
-#include <linux/serial_s3c.h>
-#include <mach/map.h>
-
-	/* note, for the boot process to work we have to keep the UART
-	 * virtual address aligned to an 1MiB boundary for the L1
-	 * mapping the head code makes. We keep the UART virtual address
-	 * aligned and add in the offset when we load the value here.
-	 */
-
-	.macro addruart, rp, rv, tmp
-		ldr	\rp, = S3C_PA_UART
-		ldr	\rv, = (S3C_VA_UART + S3C_PA_UART & 0xfffff)
-#if CONFIG_DEBUG_S3C_UART != 0
-		add	\rp, \rp, #(0x400 * CONFIG_DEBUG_S3C_UART)
-		add	\rv, \rv, #(0x400 * CONFIG_DEBUG_S3C_UART)
-#endif
-	.endm
-
-/* include the reset of the code which will do the work, we're only
- * compiling for a single cpu processor type so the default of s3c2440
- * will be fine with us.
- */
-
-#include <debug/samsung.S>
-- 
2.1.0.rc2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1277544 — [PATCH 10/10] ARM: s3c64xx: allow building without board support

FromArnd Bergmann <arnd@arndb.de>
Date2015-11-25 17:20 +0100
Subject[PATCH 10/10] ARM: s3c64xx: allow building without board support
Message-ID<qyKXw-cZ-1@gated-at.bofh.it>
In reply to#1277535
Most of the code for the s3c64xx platform is only used when booting
with ATAGS based board files, but not when using device-tree.

This tries to identify all the s3c64xx specific code that is
unneeded when CONFIG_ATAGS is not set, so we can build a smaller
DT-only kernel if configured that way.

All board support is still left intact but now depends on the
CONFIG_ATAGS symbol that users may intentionally disable.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-s3c64xx/Kconfig                     | 19 ++++++++++++++-----
 arch/arm/mach-s3c64xx/Makefile                    | 21 ++++++++++++---------
 arch/arm/mach-s3c64xx/include/mach/gpio-samsung.h |  3 +++
 arch/arm/plat-samsung/pm.c                        |  4 ----
 4 files changed, 29 insertions(+), 18 deletions(-)

diff --git a/arch/arm/mach-s3c64xx/Kconfig b/arch/arm/mach-s3c64xx/Kconfig
index caf71a99389e..7c0c420c3016 100644
--- a/arch/arm/mach-s3c64xx/Kconfig
+++ b/arch/arm/mach-s3c64xx/Kconfig
@@ -7,18 +7,17 @@ menuconfig ARCH_S3C64XX
 	select ARCH_REQUIRE_GPIOLIB
 	select ARM_AMBA
 	select ARM_VIC
-	select ATAGS
 	select CLKSRC_SAMSUNG_PWM
 	select COMMON_CLK_SAMSUNG
-	select GPIO_SAMSUNG
+	select GPIO_SAMSUNG if ATAGS
 	select HAVE_S3C2410_I2C if I2C
 	select HAVE_S3C2410_WATCHDOG if WATCHDOG
 	select HAVE_TCM
 	select PLAT_SAMSUNG
 	select PM_GENERIC_DOMAINS if PM
-	select S3C_DEV_NAND
-	select S3C_GPIO_TRACK
-	select SAMSUNG_ATAGS
+	select S3C_DEV_NAND if ATAGS
+	select S3C_GPIO_TRACK if ATAGS
+	select SAMSUNG_ATAGS if ATAGS
 	select SAMSUNG_WAKEMASK if PM
 	select SAMSUNG_WDT_RESET
 	help
@@ -111,6 +110,7 @@ config S3C64XX_SETUP_USB_PHY
 
 config MACH_SMDK6400
        bool "SMDK6400"
+	depends on ATAGS
 	select CPU_S3C6400
 	select S3C64XX_SETUP_SDHCI
 	select S3C_DEV_HSMMC1
@@ -121,6 +121,7 @@ config MACH_SMDK6400
 
 config MACH_ANW6410
 	bool "A&W6410"
+	depends on ATAGS
 	select CPU_S3C6410
 	select S3C64XX_SETUP_FB_24BPP
 	select S3C_DEV_FB
@@ -129,6 +130,7 @@ config MACH_ANW6410
 
 config MACH_MINI6410
 	bool "MINI6410"
+	depends on ATAGS
 	select CPU_S3C6410
 	select S3C64XX_SETUP_FB_24BPP
 	select S3C64XX_SETUP_SDHCI
@@ -144,6 +146,7 @@ config MACH_MINI6410
 
 config MACH_REAL6410
 	bool "REAL6410"
+	depends on ATAGS
 	select CPU_S3C6410
 	select S3C64XX_SETUP_FB_24BPP
 	select S3C64XX_SETUP_SDHCI
@@ -159,6 +162,7 @@ config MACH_REAL6410
 
 config MACH_SMDK6410
 	bool "SMDK6410"
+	depends on ATAGS
 	select CPU_S3C6410
 	select HAVE_S3C2410_WATCHDOG if WATCHDOG
 	select S3C64XX_SETUP_FB_24BPP
@@ -246,6 +250,7 @@ config SMDK6410_WM1192_EV1
 
 config MACH_NCP
 	bool "NCP"
+	depends on ATAGS
 	select CPU_S3C6410
 	select S3C64XX_SETUP_I2C1
 	select S3C_DEV_HSMMC1
@@ -255,6 +260,7 @@ config MACH_NCP
 
 config MACH_HMT
 	bool "Airgoo HMT"
+	depends on ATAGS
 	select CPU_S3C6410
 	select S3C64XX_SETUP_FB_24BPP
 	select S3C_DEV_FB
@@ -286,18 +292,21 @@ config MACH_SMARTQ
 
 config MACH_SMARTQ5
 	bool "SmartQ 5"
+	depends on ATAGS
 	select MACH_SMARTQ
 	help
 	    Machine support for the SmartQ 5
 
 config MACH_SMARTQ7
 	bool "SmartQ 7"
+	depends on ATAGS
 	select MACH_SMARTQ
 	help
 	    Machine support for the SmartQ 7
 
 config MACH_WLF_CRAGG_6410
 	bool "Wolfson Cragganmore 6410"
+	depends on ATAGS
 	depends on I2C=y
 	select CPU_S3C6410
 	select LEDS_GPIO_REGISTER
diff --git a/arch/arm/mach-s3c64xx/Makefile b/arch/arm/mach-s3c64xx/Makefile
index 04cdcd40e23c..256cd5b40c60 100644
--- a/arch/arm/mach-s3c64xx/Makefile
+++ b/arch/arm/mach-s3c64xx/Makefile
@@ -8,20 +8,21 @@
 ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include -I$(srctree)/arch/arm/plat-samsung/include
 asflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include -I$(srctree)/arch/arm/plat-samsung/include
 
-# Core
+# PM
 
-obj-y				+= common.o
+obj-$(CONFIG_PM)		+= pm.o
+obj-$(CONFIG_PM_SLEEP)		+= sleep.o
+obj-$(CONFIG_CPU_IDLE)		+= cpuidle.o
 
-# Core support
+ifdef CONFIG_SAMSUNG_ATAGS
 
-obj-$(CONFIG_CPU_S3C6400)	+= s3c6400.o
-obj-$(CONFIG_CPU_S3C6410)	+= s3c6410.o
+obj-$(CONFIG_PM_SLEEP)          += irq-pm.o
 
-# PM
+# Core
 
-obj-$(CONFIG_PM)		+= pm.o
-obj-$(CONFIG_PM_SLEEP)		+= irq-pm.o sleep.o
-obj-$(CONFIG_CPU_IDLE)		+= cpuidle.o
+obj-y				+= common.o
+obj-$(CONFIG_CPU_S3C6400)	+= s3c6400.o
+obj-$(CONFIG_CPU_S3C6410)	+= s3c6410.o
 
 # DMA support
 
@@ -58,4 +59,6 @@ obj-$(CONFIG_MACH_SMARTQ7)		+= mach-smartq7.o
 obj-$(CONFIG_MACH_SMDK6400)		+= mach-smdk6400.o
 obj-$(CONFIG_MACH_SMDK6410)		+= mach-smdk6410.o
 obj-$(CONFIG_MACH_WLF_CRAGG_6410)	+= mach-crag6410.o mach-crag6410-module.o
+endif
+
 obj-$(CONFIG_MACH_S3C64XX_DT)		+= mach-s3c64xx-dt.o
diff --git a/arch/arm/mach-s3c64xx/include/mach/gpio-samsung.h b/arch/arm/mach-s3c64xx/include/mach/gpio-samsung.h
index 9c81fac3b2d5..1d3636512e33 100644
--- a/arch/arm/mach-s3c64xx/include/mach/gpio-samsung.h
+++ b/arch/arm/mach-s3c64xx/include/mach/gpio-samsung.h
@@ -14,6 +14,8 @@
 #ifndef GPIO_SAMSUNG_S3C64XX_H
 #define GPIO_SAMSUNG_S3C64XX_H
 
+#ifdef CONFIG_GPIO_SAMSUNG
+
 /* GPIO bank sizes */
 #define S3C64XX_GPIO_A_NR	(8)
 #define S3C64XX_GPIO_B_NR	(7)
@@ -90,5 +92,6 @@ enum s3c_gpio_number {
 /* define the number of gpios we need to the one after the GPQ() range */
 #define GPIO_BOARD_START (S3C64XX_GPQ(S3C64XX_GPIO_Q_NR) + 1)
 
+#endif /* GPIO_SAMSUNG */
 #endif /* GPIO_SAMSUNG_S3C64XX_H */
 
diff --git a/arch/arm/plat-samsung/pm.c b/arch/arm/plat-samsung/pm.c
index 82777c649774..d7803b434732 100644
--- a/arch/arm/plat-samsung/pm.c
+++ b/arch/arm/plat-samsung/pm.c
@@ -23,14 +23,10 @@
 #include <asm/cacheflush.h>
 #include <asm/suspend.h>
 
-#ifdef CONFIG_SAMSUNG_ATAGS
 #include <mach/map.h>
-#ifndef CONFIG_ARCH_EXYNOS
 #include <mach/regs-clock.h>
 #include <mach/regs-irq.h>
-#endif
 #include <mach/irqs.h>
-#endif
 
 #include <asm/irq.h>
 
-- 
2.1.0.rc2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1277549 — [PATCH 07/10] ARM: s3c64xx: use new adc/touchscreen driver

FromArnd Bergmann <arnd@arndb.de>
Date2015-11-25 17:20 +0100
Subject[PATCH 07/10] ARM: s3c64xx: use new adc/touchscreen driver
Message-ID<qyKXx-cZ-21@gated-at.bofh.it>
In reply to#1277535
The old ADC and touchscreen drivers are not compatible with
multiplatform support, but we can use the exynos-adc driver
as a replacement.

This changes the common device creation functions for s3c64xx
(but not s3c24xx for now) to use the new driver. To do this,
we have to pass the interrupt resources in the opposite order
and pass the platform data in the adc device node.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/arm/mach-s3c64xx/mach-mini6410.c             |  3 +--
 arch/arm/mach-s3c64xx/mach-real6410.c             |  3 +--
 arch/arm/mach-s3c64xx/mach-smartq.c               |  3 +--
 arch/arm/mach-s3c64xx/mach-smdk6410.c             |  3 +--
 arch/arm/plat-samsung/devs.c                      | 22 +++++-----------------
 include/linux/platform_data/touchscreen-s3c2410.h |  1 +
 6 files changed, 10 insertions(+), 25 deletions(-)

diff --git a/arch/arm/mach-s3c64xx/mach-mini6410.c b/arch/arm/mach-s3c64xx/mach-mini6410.c
index 3ce5842ed51b..ae999fb3fe6d 100644
--- a/arch/arm/mach-s3c64xx/mach-mini6410.c
+++ b/arch/arm/mach-s3c64xx/mach-mini6410.c
@@ -234,7 +234,6 @@ static struct platform_device *mini6410_devices[] __initdata = {
 	&s3c_device_fb,
 	&mini6410_lcd_powerdev,
 	&s3c_device_adc,
-	&s3c_device_ts,
 };
 
 static void __init mini6410_map_io(void)
@@ -333,7 +332,7 @@ static void __init mini6410_machine_init(void)
 	s3c_nand_set_platdata(&mini6410_nand_info);
 	s3c_fb_set_platdata(&mini6410_lcd_pdata[features.lcd_index]);
 	s3c_sdhci1_set_platdata(&mini6410_hsmmc1_pdata);
-	s3c24xx_ts_set_platdata(NULL);
+	s3c64xx_ts_set_platdata(NULL);
 
 	/* configure nCS1 width to 16 bits */
 
diff --git a/arch/arm/mach-s3c64xx/mach-real6410.c b/arch/arm/mach-s3c64xx/mach-real6410.c
index ca6548a1ed3b..4e240ffa7ac7 100644
--- a/arch/arm/mach-s3c64xx/mach-real6410.c
+++ b/arch/arm/mach-s3c64xx/mach-real6410.c
@@ -203,7 +203,6 @@ static struct platform_device *real6410_devices[] __initdata = {
 	&s3c_device_fb,
 	&s3c_device_nand,
 	&s3c_device_adc,
-	&s3c_device_ts,
 	&s3c_device_ohci,
 };
 
@@ -302,7 +301,7 @@ static void __init real6410_machine_init(void)
 
 	s3c_fb_set_platdata(&real6410_lcd_pdata[features.lcd_index]);
 	s3c_nand_set_platdata(&real6410_nand_info);
-	s3c24xx_ts_set_platdata(NULL);
+	s3c64xx_ts_set_platdata(NULL);
 
 	/* configure nCS1 width to 16 bits */
 
diff --git a/arch/arm/mach-s3c64xx/mach-smartq.c b/arch/arm/mach-s3c64xx/mach-smartq.c
index 96784e7f894a..936a63fc68d5 100644
--- a/arch/arm/mach-s3c64xx/mach-smartq.c
+++ b/arch/arm/mach-s3c64xx/mach-smartq.c
@@ -253,7 +253,6 @@ static struct platform_device *smartq_devices[] __initdata = {
 	&s3c_device_ohci,
 	&s3c_device_rtc,
 	&samsung_device_pwm,
-	&s3c_device_ts,
 	&s3c_device_usb_hsotg,
 	&s3c64xx_device_iis0,
 	&smartq_backlight_device,
@@ -400,7 +399,7 @@ void __init smartq_machine_init(void)
 	s3c_hwmon_set_platdata(&smartq_hwmon_pdata);
 	s3c_sdhci1_set_platdata(&smartq_internal_hsmmc_pdata);
 	s3c_sdhci2_set_platdata(&smartq_internal_hsmmc_pdata);
-	s3c24xx_ts_set_platdata(&smartq_touchscreen_pdata);
+	s3c64xx_ts_set_platdata(&smartq_touchscreen_pdata);
 
 	i2c_register_board_info(0, smartq_i2c_devs,
 				ARRAY_SIZE(smartq_i2c_devs));
diff --git a/arch/arm/mach-s3c64xx/mach-smdk6410.c b/arch/arm/mach-s3c64xx/mach-smdk6410.c
index 34d31bd48954..8a894ee3ee76 100644
--- a/arch/arm/mach-s3c64xx/mach-smdk6410.c
+++ b/arch/arm/mach-s3c64xx/mach-smdk6410.c
@@ -290,7 +290,6 @@ static struct platform_device *smdk6410_devices[] __initdata = {
 	&s3c_device_adc,
 	&s3c_device_cfcon,
 	&s3c_device_rtc,
-	&s3c_device_ts,
 	&s3c_device_wdt,
 };
 
@@ -669,7 +668,7 @@ static void __init smdk6410_machine_init(void)
 
 	samsung_keypad_set_platdata(&smdk6410_keypad_data);
 
-	s3c24xx_ts_set_platdata(NULL);
+	s3c64xx_ts_set_platdata(NULL);
 
 	/* configure nCS1 width to 16 bits */
 
diff --git a/arch/arm/plat-samsung/devs.c b/arch/arm/plat-samsung/devs.c
index f39938fa9ef6..b53d4ff3befb 100644
--- a/arch/arm/plat-samsung/devs.c
+++ b/arch/arm/plat-samsung/devs.c
@@ -119,12 +119,12 @@ struct platform_device s3c_device_adc = {
 #if defined(CONFIG_SAMSUNG_DEV_ADC)
 static struct resource s3c_adc_resource[] = {
 	[0] = DEFINE_RES_MEM(SAMSUNG_PA_ADC, SZ_256),
-	[1] = DEFINE_RES_IRQ(IRQ_TC),
-	[2] = DEFINE_RES_IRQ(IRQ_ADC),
+	[1] = DEFINE_RES_IRQ(IRQ_ADC),
+	[2] = DEFINE_RES_IRQ(IRQ_TC),
 };
 
 struct platform_device s3c_device_adc = {
-	.name		= "samsung-adc",
+	.name		= "exynos-adc",
 	.id		= -1,
 	.num_resources	= ARRAY_SIZE(s3c_adc_resource),
 	.resource	= s3c_adc_resource,
@@ -956,31 +956,19 @@ void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *hard_s3c2410ts_
 #endif /* CONFIG_PLAT_S3C24XX */
 
 #ifdef CONFIG_SAMSUNG_DEV_TS
-static struct resource s3c_ts_resource[] = {
-	[0] = DEFINE_RES_MEM(SAMSUNG_PA_ADC, SZ_256),
-	[1] = DEFINE_RES_IRQ(IRQ_TC),
-};
-
 static struct s3c2410_ts_mach_info default_ts_data __initdata = {
 	.delay			= 10000,
 	.presc			= 49,
 	.oversampling_shift	= 2,
 };
 
-struct platform_device s3c_device_ts = {
-	.name		= "s3c64xx-ts",
-	.id		= -1,
-	.num_resources	= ARRAY_SIZE(s3c_ts_resource),
-	.resource	= s3c_ts_resource,
-};
-
-void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *pd)
+void __init s3c64xx_ts_set_platdata(struct s3c2410_ts_mach_info *pd)
 {
 	if (!pd)
 		pd = &default_ts_data;
 
 	s3c_set_platdata(pd, sizeof(struct s3c2410_ts_mach_info),
-			 &s3c_device_ts);
+			 &s3c_device_adc);
 }
 #endif /* CONFIG_SAMSUNG_DEV_TS */
 
diff --git a/include/linux/platform_data/touchscreen-s3c2410.h b/include/linux/platform_data/touchscreen-s3c2410.h
index 58dc7c5ae63b..71eccaa9835d 100644
--- a/include/linux/platform_data/touchscreen-s3c2410.h
+++ b/include/linux/platform_data/touchscreen-s3c2410.h
@@ -17,6 +17,7 @@ struct s3c2410_ts_mach_info {
 };
 
 extern void s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *);
+extern void s3c64xx_ts_set_platdata(struct s3c2410_ts_mach_info *);
 
 /* defined by architecture to configure gpio */
 extern void s3c24xx_ts_cfg_gpio(struct platform_device *dev);
-- 
2.1.0.rc2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1277550 — [PATCH 01/10] Input: s3c2410_ts: fix S3C_ADC dependency

FromArnd Bergmann <arnd@arndb.de>
Date2015-11-25 17:20 +0100
Subject[PATCH 01/10] Input: s3c2410_ts: fix S3C_ADC dependency
Message-ID<qyKXx-cZ-23@gated-at.bofh.it>
In reply to#1277535
S3C_ADC is only available on machines that don't do ARCH_MULTIPLATFORM,
so changing the 'select' into 'depends on' here helps us move to
ARCH_MULTIPLATFORM without introducing regressions.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/input/touchscreen/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig
index ae33da7ab51f..ae35edcd6a34 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -365,7 +365,7 @@ config TOUCHSCREEN_IPROC
 config TOUCHSCREEN_S3C2410
 	tristate "Samsung S3C2410/generic touchscreen input driver"
 	depends on ARCH_S3C24XX || SAMSUNG_DEV_TS
-	select S3C_ADC
+	depends on S3C_ADC
 	help
 	  Say Y here if you have the s3c2410 touchscreen.
 
-- 
2.1.0.rc2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1280405 — Re: [PATCH 01/10] Input: s3c2410_ts: fix S3C_ADC dependency

FromKrzysztof Kozlowski <k.kozlowski@samsung.com>
Date2015-12-01 00:50 +0100
SubjectRe: [PATCH 01/10] Input: s3c2410_ts: fix S3C_ADC dependency
Message-ID<qAGmK-1Ri-11@gated-at.bofh.it>
In reply to#1277550
On 26.11.2015 01:06, Arnd Bergmann wrote:
> S3C_ADC is only available on machines that don't do ARCH_MULTIPLATFORM,
> so changing the 'select' into 'depends on' here helps us move to
> ARCH_MULTIPLATFORM without introducing regressions.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
>  drivers/input/touchscreen/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>

Best regards,
Krzysztof

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1277573

FromMark Brown <broonie@kernel.org>
Date2015-11-25 17:40 +0100
Message-ID<qyLgR-jU-13@gated-at.bofh.it>
In reply to#1277535

[Multipart message — attachments visible in raw view] — view raw

On Wed, Nov 25, 2015 at 05:06:45PM +0100, Arnd Bergmann wrote:
> I've posted the series before and we got a few people to test it
> the last time, though I think the touchscreen portion is still
> untested.
> 
> I'd really like to get this merged for 4.5 and would put it into
> a next/multiplatform branch unless there are any objections
> or concerns.

Is this a series with interdependencies or just a set of separate fixes?

[toc] | [prev] | [next] | [standalone]


#1277583

FromArnd Bergmann <arnd@arndb.de>
Date2015-11-25 17:40 +0100
Message-ID<qyLgS-jU-31@gated-at.bofh.it>
In reply to#1277573
On Wednesday 25 November 2015 16:31:14 Mark Brown wrote:
> On Wed, Nov 25, 2015 at 05:06:45PM +0100, Arnd Bergmann wrote:
> > I've posted the series before and we got a few people to test it
> > the last time, though I think the touchscreen portion is still
> > untested.
> > 
> > I'd really like to get this merged for 4.5 and would put it into
> > a next/multiplatform branch unless there are any objections
> > or concerns.
> 
> Is this a series with interdependencies or just a set of separate fixes?
> 

Patch 9/10 depends on the first eight patches, the last one depends on
that.

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web