From patchwork Thu Oct 10 20:29:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 175847 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp2797419ill; Thu, 10 Oct 2019 13:31:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqyqwZtAPzcb42hPG4l/wgImEvKikRFQ8mC7+ZrkKdX0lBUDBlAZnuswwe3B+9m5jt2kDg3U X-Received: by 2002:a17:906:6a15:: with SMTP id o21mr9947865ejr.79.1570739462607; Thu, 10 Oct 2019 13:31:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570739462; cv=none; d=google.com; s=arc-20160816; b=Zz/mmLTbqdwb0Hx/igcRgxgv/lG5gZL4EYXMVY8Jqy4Z9NKbNvYNOjPAxgb6hGvn6a kfR8l+20FmcuKTD7yR0nzztawlDkuLW3KvxovwUtTXIyUzg2d4oQr/T07AFAtBzCHeQQ LQYDEnqvdHkzbgav+gS4IdJaxT6Bz/VWuiP2dYoP4RNaAYT9B0BVqs7xWCr39vtGSUs1 liog7RzHeetFvbinj0timYGc6hhJzecNuugNtotNPt6zWJn4w2CBhXavuiVVZ8vbYVXx zOvy75fmap6ECI2c3CnqkvwM3oC0OwFGPxNvHh4xmN72TEjC18oG22x7gVD1QdFPvg2J vAHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=b8JRaSplep8F7kAXHZ9UnXhGbXlF5N/xbRStPBZSM/U=; b=k0wqZm1+QPrdx4ESoIf1M3OwxHbrrX/SXKUknMca/8t1312JekUctBI1X2j2V9/N2y xHx0Oyq4k8F3qW7WePGiZ6ZGjcVBxNNCt5fWQroKVCBSEFgk/gvl6qY00bEq8HM75iLo JL8EJVB/yOAfIrEbUhd6FRfVskYv4P5dWNTtEMK/0fOeGGSM/RFX37KTHifCnB49tR3N bMbkK5/5oWciW23zEnnJ4F++LEkdnOUKEop/sOteCd/OksrNA3TeXm+EKv0d3+3SXS9/ X8o7iU45lCX685t/kdpM9IvU75Ao4f6ol8qLZmz8qg6b6gTYTrw18dXFIagdyFGuweU2 +rsQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s19si3930360ejd.277.2019.10.10.13.31.01; Thu, 10 Oct 2019 13:31:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727364AbfJJUa6 (ORCPT + 21 others); Thu, 10 Oct 2019 16:30:58 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:40223 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726900AbfJJUa5 (ORCPT ); Thu, 10 Oct 2019 16:30:57 -0400 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1M76jv-1iA7xr2etz-008WlZ; Thu, 10 Oct 2019 22:30:44 +0200 From: Arnd Bergmann To: Kukjin Kim , Krzysztof Kozlowski , Sylwester Nawrocki , Tomasz Figa , Chanwoo Choi Cc: linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linus.walleij@linaro.org, Arnd Bergmann , Michael Turquette , Stephen Boyd , linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org Subject: [PATCH 01/36] ARM: samsung: make S3C24XX_MISCCR access indirect Date: Thu, 10 Oct 2019 22:29:45 +0200 Message-Id: <20191010203043.1241612-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20191010202802.1132272-1-arnd@arndb.de> References: <20191010202802.1132272-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:ePLzvj7/CcvBZWd9/hVzvTOtmqd1jBEPawLsZLAlTOvjHU9Blp0 tvxX+UeVAWK0nrC7dGI+hFjF8ptcLrjrkZNrN1/uNRe+uaNHpuu2BxrAFpK9lILdg4Kj5GH JUyKX7A09rEBq4diiC18Z0WoqEb+HshWV0vBBd3lWJmlI9+0Kf3EIUQ1g4JogJyATj7uv+x eMo6Lt9LmrEqY9ZyRGCZA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:p+vtab0Sm4g=:GZ7JjxHd28lp/BUZHy55/p b9I5JvBFzQsD16r9zrfKLjJ5zalwgRAiq/aD/2IFvOdvFT72F5T/lS/DlazeTamoLZsSS/X04 mKee0zxPCOxG1iYddhlMCoHPUsmBSRePPJIvvWvLhieiH9YW0+BlgMGVG/6Wr+IceowcHuRxZ yQHylOXnOnpDglBkIRt6/qpzw39wUuLc1zI6hrFH420KpQzYVrB5lJsaE/ojDI9RnzIky8U9G 4fvej/0S799sglaZhKk1G0PSEKgYy8GJSBwrO1/urLdKdj/hxgOUaesBjta4gi7AFk3XNzxnK c6evzMifq7jGzWo48d+THy66ClEQuqbFZhxZEoQQLoYNka0K5pdwhgdMVevI4Zs4v5Pg04LlK X0MvJQ5fy8ogANXieli/NIJH15cHvdR4YuAT2hSdW+wCjNbJNQzO1CVSkPpxRQvxgXwQvNpaU TuOz6XyrB8bqiOdKiIWgi94Uc4Ts07dgo8znCybeGKJgKpJ75gfhCCrSR+xKs8DbJyopza9um Hv6aI1VN1XK1MJ06/ESbj+wrKSh9THAhq2P098AbLclaTHFYy4enQZQ9T5Te0tl+q+6/DueLe 8CY4X3pswccFQeZtOtRqOLZ/AekCpg0LiFMi6TBAZYP1yz2lkYTmigk1LOKDqPApclK+8PoQ3 87kIeHnio6OFfq5FCtr/hN4bwvr3ttcBvyd1tJdYKGk99bLPLRWK8cRwAmdbVCYlnNbslk9kw 8u4vrXdL8NT3UWlX90wxJSbcUoKF9+lTxFan3Cuv4EVvPVlUsnYW/ckcLtE/FrNPVbHEORV+7 3yoOX40qgdQvdqA4yek9OrFe07/3c1B0m5RpVzCb6JjARIHKrdj/tB7SbtKinMz6keJyuwGMl nMMhZ3QF99zmHauGWf8A== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The clk driver uses both a function call into an exported platform file and a direct register access to a hardcoded virtual address for accessing the MISCCR register, both become are a problem for a multiplatform kernel because of the header file dependency. Make this an indirect function call through platform data instead. Signed-off-by: Arnd Bergmann --- arch/arm/mach-s3c24xx/common.c | 3 +++ drivers/clk/samsung/clk-s3c2410-dclk.c | 10 ++++------ 2 files changed, 7 insertions(+), 6 deletions(-) -- 2.20.0 diff --git a/arch/arm/mach-s3c24xx/common.c b/arch/arm/mach-s3c24xx/common.c index 3dc029c2d2cb..ebf6bde67816 100644 --- a/arch/arm/mach-s3c24xx/common.c +++ b/arch/arm/mach-s3c24xx/common.c @@ -667,5 +667,8 @@ struct platform_device s3c2410_device_dclk = { .id = 0, .num_resources = ARRAY_SIZE(s3c2410_dclk_resource), .resource = s3c2410_dclk_resource, + .dev = { + .platform_data = s3c2410_modify_misccr, + }, }; #endif diff --git a/drivers/clk/samsung/clk-s3c2410-dclk.c b/drivers/clk/samsung/clk-s3c2410-dclk.c index 1281672cb00e..fbcec0252c45 100644 --- a/drivers/clk/samsung/clk-s3c2410-dclk.c +++ b/drivers/clk/samsung/clk-s3c2410-dclk.c @@ -14,10 +14,6 @@ #include #include "clk.h" -/* legacy access to misccr, until dt conversion is finished */ -#include -#include - #define MUX_DCLK0 0 #define MUX_DCLK1 1 #define DIV_DCLK0 2 @@ -52,6 +48,7 @@ struct s3c24xx_clkout { struct clk_hw hw; u32 mask; u8 shift; + unsigned int (*modify_misccr)(unsigned int clr, unsigned int chg); }; #define to_s3c24xx_clkout(_hw) container_of(_hw, struct s3c24xx_clkout, hw) @@ -62,7 +59,7 @@ static u8 s3c24xx_clkout_get_parent(struct clk_hw *hw) int num_parents = clk_hw_get_num_parents(hw); u32 val; - val = readl_relaxed(S3C24XX_MISCCR) >> clkout->shift; + val = clkout->modify_misccr(0, 0) >> clkout->shift; val >>= clkout->shift; val &= clkout->mask; @@ -76,7 +73,7 @@ static int s3c24xx_clkout_set_parent(struct clk_hw *hw, u8 index) { struct s3c24xx_clkout *clkout = to_s3c24xx_clkout(hw); - s3c2410_modify_misccr((clkout->mask << clkout->shift), + clkout->modify_misccr((clkout->mask << clkout->shift), (index << clkout->shift)); return 0; @@ -110,6 +107,7 @@ static struct clk_hw *s3c24xx_register_clkout(struct device *dev, clkout->shift = shift; clkout->mask = mask; clkout->hw.init = &init; + clkout->modify_misccr = dev->platform_data; ret = clk_hw_register(dev, &clkout->hw); if (ret) From patchwork Thu Oct 10 20:30:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 175864 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp2810481ill; Thu, 10 Oct 2019 13:44:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqxg1VwtuafpoXAHVfOycPOLXku9wQuYEx+JtdSOAbOQbU0Iw2kU2gVf2EzgXSjnvzPEdYrB X-Received: by 2002:a17:906:f42:: with SMTP id h2mr10098894ejj.39.1570740299795; Thu, 10 Oct 2019 13:44:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570740299; cv=none; d=google.com; s=arc-20160816; b=kdLmfl/cS+49sbg/bSaY5JnqezIRlbdzvpwagvFtXJkuPbl8bfjXKsoU+5/J0LmqKY TwFRV+ZLG/O2b0mDTtbV2uO/nv0+KxEFiphTaXhhAql1VDROMF8gUuGmIkxO+btmI2i4 jN418fpejhcnrT9+9U5AAQjCB5daCx84P1F2M9jhg2p0Tz4x2OLNeHwwOAYNHUfeHsv/ 8P0N+d19vvQQkYDrfO4Fomwl5zhUXU9Aa4T7a/4RPBGsQL8SKgGJyldsz4oaLB7Euihf pM3OOMyU3goX2BwM3A27OD3zmkN05V58gkjJoHgF0+PjSxhaDQKc2N3rwcwa5gb8hU5E AhPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=l0+dOGOEX7sHXfUbHKVmKl+9X+b1kfhrlgEZR++LNYo=; b=eezVk+zl9hhzhjIDP/Us2Gp9xQU6c9L7TxDNWDwpiURPprNq3HIhDwSGgt3v4e/Coo B1E1ZybFVdjkzDyAwCWe+Xsg8Gh8UW3pt7WYU6sSGGnAT1wTxuJu/01oWWvFZ7yeC+cN stzuvPk0w+p7xkdkEH2GczFiLiEq6TXSTEzk4hb1LreGp2sVQtqpMdlBH4ys5qJWKwyV 5oxemdkqZpLMNjWrQA6DV6x/OLkE3bCpz7B0GV3II9g8e8V5NacM8MG0mqzBJe0w2r/w hTzeg7f0daBG0cUfE4LD6TeGEZuDpTDl8j54drI2tCuX1WMiFzQITv8CsKkeHrpdbf82 uuAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p28si3919381ejn.88.2019.10.10.13.44.59; Thu, 10 Oct 2019 13:44:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727329AbfJJUo4 (ORCPT + 21 others); Thu, 10 Oct 2019 16:44:56 -0400 Received: from mout.kundenserver.de ([212.227.126.133]:56031 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726584AbfJJUoy (ORCPT ); Thu, 10 Oct 2019 16:44:54 -0400 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1Mth79-1hws9N0RtH-00v9BF; Thu, 10 Oct 2019 22:44:02 +0200 From: Arnd Bergmann To: Kukjin Kim , Krzysztof Kozlowski , Sangbeom Kim , Sylwester Nawrocki , Liam Girdwood , Mark Brown Cc: linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linus.walleij@linaro.org, Arnd Bergmann , Jaroslav Kysela , Takashi Iwai , Ulf Hansson , linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Subject: [PATCH 19/36] ARM: s3c: rx1950: turn into platform driver Date: Thu, 10 Oct 2019 22:30:03 +0200 Message-Id: <20191010203043.1241612-19-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20191010203043.1241612-1-arnd@arndb.de> References: <20191010202802.1132272-1-arnd@arndb.de> <20191010203043.1241612-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:wfNbW16IH/8q0rLeY8IHyXf66LWIWC8U3pThkVQcSDrkHT31+9v vSxG8oSXg+CP7yr/A/jTn4vRfKsNKGDB58f5hbPDeSbi5tQFy8/rxaJ4N0q5Ao2RUOW8n2+ 3wifuIaYS+qoAW8vLs1Il0nTgvTWpHRB+vHi0pS5wN5bCNJA7pZX6OPbCylScrja8E45VCv 7dzBwEvwMlK5gs3JSLAwA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:ILRXTWnhcB0=:dRAmk3oj1xyGKWAyP6W5pO +luDe78DLJdlKnkY66ohF9u+xItRim55TUBkC9+whJGE51aCh3+hVKj0nB1ZwMugTPJl3s8lj jFbaR6RhlfDgfYYm302LGcl2l8yhPqP26XpB343ZyuiIKBjM72WJ3jh+rij/VsLu3UOey0SfP 9fk1ALHICmY//RWOqQ25ypM52eXD4bUz3QhR5ugDZwMswGWexJs5LwNZy6s+Jsr02L8MQCYSv NcxsR3W/LFTx41U2g4UXT1HVLFmz6SUn1ywigup8+Hmc039sa9yyKHM5LyNv6xhmVg7/MPbt0 aLFpiKltf0EeI4+AQKLWV3nYdOv7/xp0oFn6BTvOIMzVbXn1CmLweoI6pWdMaMUNIRjQmNSft PSZlAMME0FCN7GiCAsWMwfX50FFgyG2EqPZ6FSLQfxlgUKJBzkms4JtpcZSslos54uILvhNoX Fu+pssdbfj0EPlK2udsNZfxYpKbq0ALaVht0aAnS9YFpUqcnS9HZymWN3RpmEWw6UYNl041gy tCMttOB8ZY/YvgN349VbrY5jlktb7TjZ2FMoqlXqppPGAL0hmZh7p8jIGxzRyWwie+rsKbdux qCV3usmIB5IlWaxTGDaVNydNKiR/T/7EBkJyXbA6Xuvs9aJrFXAWedRF9h43/3DoIXB34doDI AFa7l9hwJDVQ0ATfHogkZJBXfAEc15QEddIjt/LMCNKTbr8xTIibld/fBl8D6EG1RkTCU8cG0 iWolX3DGh7NjJWw0XwN/mU9g5Rw0/pSXzp0GO1k2cvl+5LFFSTlsSvQFTSC/6ZYIfLFOUMo1q AVcDENybVASfwb+I7NPpxah1QVFB8csB9FycNVTN9wvuQkgZz8wYDELxDy5SyaG98aTBJ+fUc 7buRF937lbAWyt64ZNPQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Avoid machine specific headers by using a gpio lookup table combined with a platform_driver for this board. Signed-off-by: Arnd Bergmann --- arch/arm/mach-s3c24xx/mach-rx1950.c | 16 +++++++ sound/soc/samsung/rx1950_uda1380.c | 72 +++++++++-------------------- 2 files changed, 39 insertions(+), 49 deletions(-) -- 2.20.0 diff --git a/arch/arm/mach-s3c24xx/mach-rx1950.c b/arch/arm/mach-s3c24xx/mach-rx1950.c index 29f9b345a531..9f3b0f18cd36 100644 --- a/arch/arm/mach-s3c24xx/mach-rx1950.c +++ b/arch/arm/mach-s3c24xx/mach-rx1950.c @@ -724,6 +724,20 @@ static struct i2c_board_info rx1950_i2c_devices[] = { }, }; +static struct gpiod_lookup_table rx1950_audio_gpio_table = { + .dev_id = "rx1950-audio", + .table = { + GPIO_LOOKUP("GPIOG", 12, "hp-gpio", GPIO_ACTIVE_HIGH), + GPIO_LOOKUP("GPIOA", 1, "speaker-power", GPIO_ACTIVE_HIGH), + { }, + }, +}; + +static struct platform_device rx1950_audio = { + .name = "rx1950-audio", + .id = -1, +}; + static struct platform_device *rx1950_devices[] __initdata = { &s3c2410_device_dclk, &s3c_device_lcd, @@ -742,6 +756,7 @@ static struct platform_device *rx1950_devices[] __initdata = { &power_supply, &rx1950_battery, &rx1950_leds, + &rx1950_audio, }; static void __init rx1950_map_io(void) @@ -809,6 +824,7 @@ static void __init rx1950_init_machine(void) gpio_direction_output(S3C2410_GPJ(6), 0); pwm_add_table(rx1950_pwm_lookup, ARRAY_SIZE(rx1950_pwm_lookup)); + gpiod_add_lookup_table(&rx1950_audio_gpio_table); platform_add_devices(rx1950_devices, ARRAY_SIZE(rx1950_devices)); i2c_register_board_info(0, rx1950_i2c_devices, diff --git a/sound/soc/samsung/rx1950_uda1380.c b/sound/soc/samsung/rx1950_uda1380.c index 4b247e91ae5b..cf96eaaf6b4e 100644 --- a/sound/soc/samsung/rx1950_uda1380.c +++ b/sound/soc/samsung/rx1950_uda1380.c @@ -12,16 +12,13 @@ // Vasily Khoruzhick #include -#include +#include #include #include #include -#include #include "regs-iis.h" -#include - #include "s3c24xx-i2s.h" static int rx1950_uda1380_init(struct snd_soc_pcm_runtime *rtd); @@ -58,7 +55,6 @@ static struct snd_soc_jack_pin hp_jack_pins[] = { static struct snd_soc_jack_gpio hp_jack_gpios[] = { [0] = { - .gpio = S3C2410_GPG(12), .name = "hp-gpio", .report = SND_JACK_HEADPHONE, .invert = 1, @@ -123,8 +119,6 @@ static struct snd_soc_card rx1950_asoc = { .num_dapm_routes = ARRAY_SIZE(audio_map), }; -static struct platform_device *s3c24xx_snd_device; - static int rx1950_startup(struct snd_pcm_substream *substream) { struct snd_pcm_runtime *runtime = substream->runtime; @@ -134,13 +128,15 @@ static int rx1950_startup(struct snd_pcm_substream *substream) &hw_rates); } +struct gpio_desc *gpiod_speaker_power; + static int rx1950_spk_power(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event) { if (SND_SOC_DAPM_EVENT_ON(event)) - gpio_set_value(S3C2410_GPA(1), 1); + gpiod_set_value(gpiod_speaker_power, 1); else - gpio_set_value(S3C2410_GPA(1), 0); + gpiod_set_value(gpiod_speaker_power, 0); return 0; } @@ -214,57 +210,35 @@ static int rx1950_uda1380_init(struct snd_soc_pcm_runtime *rtd) return 0; } -static int __init rx1950_init(void) +static int rx1950_probe(struct platform_device *pdev) { - int ret; - - if (!machine_is_rx1950()) - return -ENODEV; + struct device *dev = &pdev->dev; /* configure some gpios */ - ret = gpio_request(S3C2410_GPA(1), "speaker-power"); - if (ret) - goto err_gpio; - - ret = gpio_direction_output(S3C2410_GPA(1), 0); - if (ret) - goto err_gpio_conf; - - s3c24xx_snd_device = platform_device_alloc("soc-audio", -1); - if (!s3c24xx_snd_device) { - ret = -ENOMEM; - goto err_plat_alloc; - } - - platform_set_drvdata(s3c24xx_snd_device, &rx1950_asoc); - ret = platform_device_add(s3c24xx_snd_device); - - if (ret) { - platform_device_put(s3c24xx_snd_device); - goto err_plat_add; + gpiod_speaker_power = devm_gpiod_get(dev, "speaker-power", GPIOD_OUT_LOW); + if (IS_ERR(gpiod_speaker_power)) { + dev_err(dev, "cannot get gpio\n"); + return PTR_ERR(gpiod_speaker_power); } - return 0; - -err_plat_add: -err_plat_alloc: -err_gpio_conf: - gpio_free(S3C2410_GPA(1)); + hp_jack_gpios[0].gpiod_dev = dev; + rx1950_asoc.dev = dev; -err_gpio: - return ret; + return devm_snd_soc_register_card(dev, &rx1950_asoc); } -static void __exit rx1950_exit(void) -{ - platform_device_unregister(s3c24xx_snd_device); - gpio_free(S3C2410_GPA(1)); -} +struct platform_driver rx1950_audio = { + .driver = { + .name = "rx1950-audio", + .pm = &snd_soc_pm_ops, + }, + .probe = rx1950_probe, +}; -module_init(rx1950_init); -module_exit(rx1950_exit); +module_platform_driver(rx1950_audio); /* Module information */ MODULE_AUTHOR("Vasily Khoruzhick"); MODULE_DESCRIPTION("ALSA SoC RX1950"); MODULE_LICENSE("GPL"); +MODULE_ALIAS("platform:rx1950-audio"); From patchwork Thu Oct 10 20:30:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 175876 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp2818596ill; Thu, 10 Oct 2019 13:53:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqy9Dwr8ahRm+mqpGWlcrUA8j5IxjztPWzYAoc+5slvqVqpHKvPADGIlwGoIndsk/RUgVhPx X-Received: by 2002:a05:6402:21c7:: with SMTP id bi7mr10197542edb.205.1570740821569; Thu, 10 Oct 2019 13:53:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570740821; cv=none; d=google.com; s=arc-20160816; b=nyYaCeFaOSHhbd2fLEX0yrBUJpKZhjdD5OnELiLNM43ftQ1/MsdU/BJQzVJyoLaI9E TXs2upNCetPJmb9JblKaHCswJ1upkWXNUxEFAateEGhgABhnfzyUlxVPbDyfgSmeszvG +Mc/v0wlh0vUI3+Kjg3XNcUgxJivcXajpFldrikULVD3w510Y8PWyGqMh2iTLOl/WHtW m29VJfcKr39Cz5r0cgnqMHD7w4JQuPwlEpEA95oyauvZWxptPMAZaj0BYh+dNsSqqlmL j2orZPKHbwftEUwxVXuRNrdsFzvvWEkLcHYIU/Qq0mwMV2U2Ly7uRHAs2qiULvhT5Ujo wjwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=67/udNJwRwQRNyT8wKHop63L5jWqp9KzzsdU8EzeyeE=; b=YEwG2hjl6WKpkM8yZ/qqFXrs09Bc+9/iL6XOsZGZEiMRdlzLfZs4/nzJPwzudbwW/N hl6jF2TWNqfyXe/ANjr8rpL9hUhPMw2ovVnqkce7E8TmuYzj9zraOhk3M4Z3aL+R122K RqH1X87ojnNFTUsWIRoh/N5viHa8d2n4QL9P2KC69Sofq1RNf73HWrF5xUhpzbwKqhHk gwkVh3nuAg4Bqll6TF3ea6ha0XJCNvGullCzs8OR+TCFu7VtkaN5arU4/p1W9w3bpLJC AfcZCGFmpdbn0MUHD27CDxUkazycGMzmIQ8vNEjWU76RE324bj3b36jeXQAhlCWNm3Kk 8l9A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h3si3864185ejt.380.2019.10.10.13.53.41; Thu, 10 Oct 2019 13:53:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727352AbfJJUxk (ORCPT + 21 others); Thu, 10 Oct 2019 16:53:40 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:60613 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726533AbfJJUxk (ORCPT ); Thu, 10 Oct 2019 16:53:40 -0400 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.129]) with ESMTPA (Nemesis) id 1MuF4v-1hxQE62fgD-00uawx; Thu, 10 Oct 2019 22:53:27 +0200 From: Arnd Bergmann To: Kukjin Kim , Krzysztof Kozlowski , "Rafael J. Wysocki" , Viresh Kumar Cc: linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linus.walleij@linaro.org, Arnd Bergmann , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: [PATCH 30/36] ARM: s3c: remove cpufreq header dependencies Date: Thu, 10 Oct 2019 22:30:14 +0200 Message-Id: <20191010203043.1241612-30-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20191010203043.1241612-1-arnd@arndb.de> References: <20191010202802.1132272-1-arnd@arndb.de> <20191010203043.1241612-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:98/U/9Tg91m0pejTjnITf7+YWn6BWRd8o2a+Td7NYU+oEG92Ft1 VSfw8iJk1JjWMMxkm8EgB734As2J83fuIo0sx/eQMOCIl0zIGVVB6HnNK/++qjinW6rYZFN 3FB7RKsK6HzKOoS8WRFEzcEWS4DohwvEgub0U0RVxapi+QH4LRBHFTUs+wPFRUJl6zDH2ec vNRiq/5/Rb9Eo4X7p9MoA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:fFxOFfWKPEc=:7c1EU7qAizRHjuMaMCVrCL IGdteAY/idpBGRRNm5eQJ3hwbJ49IRIxLthkYp1GfEHVjAWHPTd6xbxJztW1bJDOwweJvWpss RIUXy6oqaO72b+4RYTx1HezyY7aZ3BTGnQUVZajbZLFtzxcRlO1wC+04E7n0AM7iv9x2HFbsD b8slUJsbdPy6ua+SeLtptEKrJzQROPeL6YFZk2POhfIB5lIBxDY2sxyuwbHmtfxDzZL78QKUB nCNnr/AsZeE8KQKbrx1KKD2nlzD93Gh2nMRCbDUrL+4zUC/roOWixNIFEgeX9oGjoH6qMgkx9 KUFuRfDtahzK/mUN7juw2W9f0KDdpyGimvQlgbJmtR5WfzBF0GhSgFV5/lvK7Ayot3b58gWSm Y7xBdAElCoBXs48MfJ8Ff1uKugaW72Xx1wXpAChV5keOaJ/Nx3JIIyAcrEEHc5/v71kqMJEWP x8IHGCwBRg7gRs4CHzP+EAfY3a7f6p2/QoYmxv8S04iVJFeaR2wlkgOLCiyq23OcXfpbk13CV 4VipgKBy+cRt+30X64T+No/Pn+hCI5f4NMLJrLhkRhfaSINfGonNfynnUQPxcpdLRGO6NkmCS qndLfhZIeWo/jwCiIt81cVyNtjwpPYmcxNVPUhO+luZUVyhpecA3tPtJWHb+kv9rVlzXvV2JK uoRPJo5oLpAaommmZEeZTSQQBUTvXyqPmUoz8Mhr62wQH6rQKQEruJxJy0HjnVtOJxksQhOns lSmxA+XD1+FDeRKz92DewhFEmFAZg948P1VVuKVL1ShBZrrK1Gzj0Fl2cI0kicTDdbZ587WAW SYmsA06FFNXqcDMuA2BzAmPU+TCbcv2pZM4jTLoREmKPMOBsJ+dpQlW7Hb276u/lru0sEZZUO LO5E8n0G+3wGCCHE0BJA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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%) -- 2.20.0 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 #include -#include #include #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 #include -#include +#include #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 #include -#include +#include #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 #include -#include +#include #include 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 #include -#include +#include #include #include #include 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 -#include +#include #include #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 #include -#include +#include #include #include #include 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 #include -#include -#include +#include +#include /* 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 #include -#include -#include +#include +#include /* 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 #include -#include -#include +#include +#include /* 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 #include -#include #include 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 #include -#include #include #include 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 #include -#include - #include #include 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 -#include #include #include 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 -#include +#include #include #include 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 #include #include +#include +#include #include #include -#include -#include - #include #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 #include #include +#include +#include #include #include #include -#include -#include - #include #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 #include #include +#include +#include #include #include -#include -#include - #include #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 #include -#include +#include 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 #include #include +#include +#include #include #include -#include -#include - #include /* 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 +#include 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