From patchwork Wed May 26 12:47:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 448607 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08F0FC47082 for ; Wed, 26 May 2021 12:49:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DFBD0613F4 for ; Wed, 26 May 2021 12:49:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234279AbhEZMug (ORCPT ); Wed, 26 May 2021 08:50:36 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56859 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234820AbhEZMs5 (ORCPT ); Wed, 26 May 2021 08:48:57 -0400 Received: from mail-ua1-f70.google.com ([209.85.222.70]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1llswX-0000vJ-8T for linux-samsung-soc@vger.kernel.org; Wed, 26 May 2021 12:47:25 +0000 Received: by mail-ua1-f70.google.com with SMTP id o7-20020ab01e870000b029020d37e3e144so731947uak.1 for ; Wed, 26 May 2021 05:47:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lxlGt7UdLo9WhBrHrUnAMYLEvzBvX/vS3VzoKn9EqgQ=; b=RJw/5AmebhP9qF0Lw0Ny6xhDL58JhDzKOkGICtQOcbP18ROuiFiIIfwP5bVznZLDgY TkBfEyZbK5MMIqrXCprPyctOV6/zM3XfRHSyVbEQjm0IQ0622FlujXrSr3REr0gSD312 uBn/KRFbaJ0zVbFsQDeexXnDnkNyklTWt4RpI641e3nq75kVNNlilGUTcLR97dHFmaao DzqgwZt+DkcUxrtybXFW8Qv+yb9gFZmIMrk93SYtkjqlA40PBUEED+qUKUWTznWEArQn ThbRUN5zdUdmbe3g5LAlN+8xkz/TzMzhK/Eb2TtRIH5Qo0UlfX912cn/cggIQcfnLXww zdKw== X-Gm-Message-State: AOAM530mfk/ptB5S4zficC72wazMmzXmcme+rpnXvGief1yc1+0O9CCh GaU8LeAR9i9gI5JfEl9ABZnxEQZFIr/h+byX8kZC7/FzTdn43XhIOqFYETRaa0TFYsmjlSxK3zb JaU+M+Aqk65lN9XUHkbHbMs2Canpxh/06Tbv/koeSZKop75JA X-Received: by 2002:a05:6122:c91:: with SMTP id ba17mr27607454vkb.8.1622033244395; Wed, 26 May 2021 05:47:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyeHUz3scp7cdtBDvx3wZhYQgy/hPyyOLqDEXP9LcACOUFA0w4nitE9VfR17c6NvL1vm1QT3w== X-Received: by 2002:a05:6122:c91:: with SMTP id ba17mr27607437vkb.8.1622033244233; Wed, 26 May 2021 05:47:24 -0700 (PDT) Received: from localhost.localdomain ([45.237.48.3]) by smtp.gmail.com with ESMTPSA id c126sm875817vkh.47.2021.05.26.05.47.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 05:47:23 -0700 (PDT) From: Krzysztof Kozlowski To: Lee Jones , Support Opensource , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Tony Lindgren , linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-omap@vger.kernel.org, patches@opensource.cirrus.com Subject: [RESEND PATCH v2 02/13] mfd: max8998: Simplify getting of_device_id match data Date: Wed, 26 May 2021 08:47:00 -0400 Message-Id: <20210526124711.33223-3-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210526124711.33223-1-krzysztof.kozlowski@canonical.com> References: <20210526124711.33223-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Use of_device_get_match_data() to make the code slightly smaller. There is also no need to wrap it in a check for CONFIG_OF, because dev.of_node will be set only with OF support. Signed-off-by: Krzysztof Kozlowski --- Changes since v1: 1. Remove check for CONFIG_OF --- drivers/mfd/max8998.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/mfd/max8998.c b/drivers/mfd/max8998.c index 785f8e9841b7..0eb15e611b67 100644 --- a/drivers/mfd/max8998.c +++ b/drivers/mfd/max8998.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -155,11 +156,8 @@ static struct max8998_platform_data *max8998_i2c_parse_dt_pdata( static inline unsigned long max8998_i2c_get_driver_data(struct i2c_client *i2c, const struct i2c_device_id *id) { - if (IS_ENABLED(CONFIG_OF) && i2c->dev.of_node) { - const struct of_device_id *match; - match = of_match_node(max8998_dt_match, i2c->dev.of_node); - return (unsigned long)match->data; - } + if (i2c->dev.of_node) + return (unsigned long)of_device_get_match_data(&i2c->dev); return id->driver_data; } From patchwork Wed May 26 12:47:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 448603 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43FD1C47088 for ; Wed, 26 May 2021 12:51:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2BD3A6124B for ; Wed, 26 May 2021 12:51:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234908AbhEZMwe (ORCPT ); Wed, 26 May 2021 08:52:34 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56877 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234875AbhEZMtO (ORCPT ); Wed, 26 May 2021 08:49:14 -0400 Received: from mail-vs1-f71.google.com ([209.85.217.71]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1llswk-0000xA-FS for linux-samsung-soc@vger.kernel.org; Wed, 26 May 2021 12:47:38 +0000 Received: by mail-vs1-f71.google.com with SMTP id n26-20020a67d61a0000b029023651d629a4so197016vsj.0 for ; Wed, 26 May 2021 05:47:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=VIi0UDETJWMz8r22ACVNYPInzss+jr7PKRHzj4F9CjI=; b=DilMK6XVf487rBfpSDrmMr0we4UwATAQCkr9vNlgCSFJx6R6C4G9nYbC17WTTiwrn3 0mU+sOjNi/3iOMtlCi0krKvvqfySYagH0hoqWRKIDY7LfzCjejofl06MXHKqVfUdYobm w9UWKqKBeNUDiH8qmShG9Ee7Scc+JWuOQpLj7M5Lf9JDFCGtmHDlwOxmpLofpYGgKLis BvEmEjv9CE4szPntZw08ilG2SmFcIsyt19M0y7utL9lr8Li1epfm/kgnAQ8/lXhgvfg+ myIv/UVbEO8flHMLlmRZKPiTf6Ss93FMRCaFVSuKY3KYjhbaEQIk8YYA9SndZqFecGkS c9eQ== X-Gm-Message-State: AOAM530hFD4LOAG5vdRrwA/I8Z3dULVstrJ5jHLt3XLwC+EbwcUoIhwG JGSe2XEQ2DQ5ngZoH2fA8X0f4aDCX7j2Wvu5fgoj49zKVfmKa4t5aaiJ/oLV0S18JIUNhd2CwDS ew/JQhSA6tXes+SRYZgINdQ61qEvL+CSMEDjkMmvhKeV96jmZ X-Received: by 2002:a05:6102:321b:: with SMTP id r27mr29696991vsf.13.1622033257578; Wed, 26 May 2021 05:47:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVJ0GkIwUjj/SnT+ky43SozLjtVHQDTyQ4X8v8jZZwJZjmUrTyX1krLd+798CTd0BMRkeRUQ== X-Received: by 2002:a05:6102:321b:: with SMTP id r27mr29696940vsf.13.1622033257072; Wed, 26 May 2021 05:47:37 -0700 (PDT) Received: from localhost.localdomain ([45.237.48.3]) by smtp.gmail.com with ESMTPSA id c126sm875817vkh.47.2021.05.26.05.47.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 05:47:36 -0700 (PDT) From: Krzysztof Kozlowski To: Lee Jones , Support Opensource , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Tony Lindgren , linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-omap@vger.kernel.org, patches@opensource.cirrus.com Cc: Adam Thomson Subject: [RESEND PATCH v2 04/13] mfd: da9062: Simplify getting of_device_id match data Date: Wed, 26 May 2021 08:47:02 -0400 Message-Id: <20210526124711.33223-5-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210526124711.33223-1-krzysztof.kozlowski@canonical.com> References: <20210526124711.33223-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Use of_device_get_match_data() to make the code slightly smaller. Signed-off-by: Krzysztof Kozlowski Acked-by: Adam Thomson --- Changes since v1: 1. Add Ack 2. Correct subject prefix --- drivers/mfd/da9062-core.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/mfd/da9062-core.c b/drivers/mfd/da9062-core.c index 8d913375152d..01f8e10dfa55 100644 --- a/drivers/mfd/da9062-core.c +++ b/drivers/mfd/da9062-core.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -622,7 +623,6 @@ static int da9062_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { struct da9062 *chip; - const struct of_device_id *match; unsigned int irq_base; const struct mfd_cell *cell; const struct regmap_irq_chip *irq_chip; @@ -635,15 +635,10 @@ static int da9062_i2c_probe(struct i2c_client *i2c, if (!chip) return -ENOMEM; - if (i2c->dev.of_node) { - match = of_match_node(da9062_dt_ids, i2c->dev.of_node); - if (!match) - return -EINVAL; - - chip->chip_type = (uintptr_t)match->data; - } else { + if (i2c->dev.of_node) + chip->chip_type = (uintptr_t)of_device_get_match_data(&i2c->dev); + else chip->chip_type = id->driver_data; - } i2c_set_clientdata(i2c, chip); chip->dev = &i2c->dev; From patchwork Wed May 26 12:47:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 448602 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A52CC47088 for ; Wed, 26 May 2021 12:51:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 62647613DC for ; Wed, 26 May 2021 12:51:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234873AbhEZMwk (ORCPT ); Wed, 26 May 2021 08:52:40 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56891 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234880AbhEZMtO (ORCPT ); Wed, 26 May 2021 08:49:14 -0400 Received: from mail-vs1-f72.google.com ([209.85.217.72]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1llswl-0000xm-Vv for linux-samsung-soc@vger.kernel.org; Wed, 26 May 2021 12:47:40 +0000 Received: by mail-vs1-f72.google.com with SMTP id h27-20020a67cb9b0000b0290235f3536140so193509vsl.12 for ; Wed, 26 May 2021 05:47:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gi5LKjjP0bjXDjYj7Ix3Hw0qKjf6CelOHRk1zXBWnaI=; b=JcVxVrZpCJzb2MWSFxRHwUbyJPbo30MCrNv2/Er7uNNOeOOVSsAiO1QZEgqvhYUEcH HaILKeFVRSdpw5oLu5HbIEmkVhFwC9BAPNxoT4c9McHJtOLc1k9IVbBsdZ9RkoVJvMq6 9cbvMdfk7kTrFzSQoMimwPeo0HO748mglitsdIg96fbnyAYEkLHNn6LaxenopkyeS9/5 eIqrCd0UHx4a6Ysc5tu3q9OmyX/EcU+ECzaQCshd7YGEnQ5mavLcXNhOEJvvGlOVfgbE fzpkoYm8+z+JoyamzCfHq6ltsy78LNYKM4sGExC4uI4kxqFIs3cyWniBgS8bucXoGf8r cLNw== X-Gm-Message-State: AOAM530ZjgoVbIDKP97B6HxzQeUjaCN8q+2r2TcmYD6GP+CpHNYDWCqn MfyDBr3G7wvgS7LB2GdiKIgfrathizCNh3PB7p17HhbxGekrRrNCFcLOCmFs/O4JGYYNpFe/FUY R/ZkMzY1lqtjABDcDM3TLGT+IeJuSEO4PMDdtU8KbHLWnfwao X-Received: by 2002:a67:1087:: with SMTP id 129mr29581340vsq.42.1622033258714; Wed, 26 May 2021 05:47:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCM8BjysU8Rx+YcwLvtbPPjwicIzKBwQd2iZE/2FBz/KnmsXQzCZ4DPoAcGK75nk/My7ZDuA== X-Received: by 2002:a67:1087:: with SMTP id 129mr29581327vsq.42.1622033258573; Wed, 26 May 2021 05:47:38 -0700 (PDT) Received: from localhost.localdomain ([45.237.48.3]) by smtp.gmail.com with ESMTPSA id c126sm875817vkh.47.2021.05.26.05.47.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 05:47:38 -0700 (PDT) From: Krzysztof Kozlowski To: Lee Jones , Support Opensource , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Tony Lindgren , linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-omap@vger.kernel.org, patches@opensource.cirrus.com Subject: [RESEND PATCH v2 05/13] mfd: sec: Simplify getting of_device_id match data Date: Wed, 26 May 2021 08:47:03 -0400 Message-Id: <20210526124711.33223-6-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210526124711.33223-1-krzysztof.kozlowski@canonical.com> References: <20210526124711.33223-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Use of_device_get_match_data() to make the code slightly smaller. There is also no need to wrap it in a check for CONFIG_OF, because dev.of_node will be set only with OF support. Signed-off-by: Krzysztof Kozlowski --- Changes since v1: 1. Remove check for CONFIG_OF as suggested by Marek --- drivers/mfd/sec-core.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c index 8d55992da19e..15dd4c579937 100644 --- a/drivers/mfd/sec-core.c +++ b/drivers/mfd/sec-core.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -323,14 +324,9 @@ sec_pmic_i2c_parse_dt_pdata(struct device *dev) static inline unsigned long sec_i2c_get_driver_data(struct i2c_client *i2c, const struct i2c_device_id *id) { -#ifdef CONFIG_OF - if (i2c->dev.of_node) { - const struct of_device_id *match; + if (i2c->dev.of_node) + return (unsigned long)of_device_get_match_data(&i2c->dev); - match = of_match_node(sec_dt_match, i2c->dev.of_node); - return (unsigned long)match->data; - } -#endif return id->driver_data; } From patchwork Wed May 26 12:47:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 448606 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9610BC47082 for ; Wed, 26 May 2021 12:50:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7407B613DC for ; Wed, 26 May 2021 12:50:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234316AbhEZMv4 (ORCPT ); Wed, 26 May 2021 08:51:56 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56924 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234908AbhEZMt0 (ORCPT ); Wed, 26 May 2021 08:49:26 -0400 Received: from mail-ua1-f71.google.com ([209.85.222.71]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1llsx0-00010h-4B for linux-samsung-soc@vger.kernel.org; Wed, 26 May 2021 12:47:54 +0000 Received: by mail-ua1-f71.google.com with SMTP id d30-20020ab007de0000b029020e2f98646dso720582uaf.5 for ; Wed, 26 May 2021 05:47:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WStmZXvsQ5h7CfTVIuVnQjnA8EJCCjMgEO+OrcP4v9c=; b=kVSrgTp7DjjaveFSxtycRTBw40E0UE85HAoM54hvGWQoPxtGmct7wqYEBhFWUvTh9V BSkjdivHaNQoORtW7sDgVHYp5dtpoN4wRS6+StMchO4+qtCnweEZxfKe27sSEEPleG6x aQ+02uSOKJWTIWMdb4OOD/skXBw8ek2v52gNryfpmx5gTG9kaU3IowB8Wk20JeEQL4TI YLDym3TSDMHQ/qn8iqZcWqipbfOOOyMCZI88g6mYYKGglydL0siMr24JfRmibLu3JKpu CZYtgSLBa/kz/4QUW+UbFAD9Z2jn6V6tzR+9EcIlvt9UkxaTjgzg0RaCTetEXkovbr5l blWg== X-Gm-Message-State: AOAM530daQnOcDIV7i14aEo1e0ljmODCxYQST+DZmKjQRp3J442kckdj tDkDgUOE2r9+ZLrHs59v6JncWeErZorU8hl+Ax6h0GaW1OwdqUFWwm6AATewmElZxPXDJKJX8lK c1BSIuJmSi774CIzSM6KAf+EdVtMza6LVkIzjmKu3v5Fz8Voq X-Received: by 2002:a67:db03:: with SMTP id z3mr26669043vsj.29.1622033270703; Wed, 26 May 2021 05:47:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzmmhpFUj6CK7bZ7dbqf7I816J0q4PtRcTDGOcM5jZDaT5rNIXCiaQhLvUio7RFOl1bks20HQ== X-Received: by 2002:a67:db03:: with SMTP id z3mr26668691vsj.29.1622033263826; Wed, 26 May 2021 05:47:43 -0700 (PDT) Received: from localhost.localdomain ([45.237.48.3]) by smtp.gmail.com with ESMTPSA id c126sm875817vkh.47.2021.05.26.05.47.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 05:47:43 -0700 (PDT) From: Krzysztof Kozlowski To: Lee Jones , Support Opensource , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Tony Lindgren , linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-omap@vger.kernel.org, patches@opensource.cirrus.com Cc: Marek Szyprowski Subject: [RESEND PATCH v2 08/13] mfd: sec: Drop support for board files and require devicetree Date: Wed, 26 May 2021 08:47:06 -0400 Message-Id: <20210526124711.33223-9-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210526124711.33223-1-krzysztof.kozlowski@canonical.com> References: <20210526124711.33223-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org The Samsung PMIC drivers since long time are used only on devicetree platforms (Samsung Exynos) and there are no users with board files. Drop the support for board files entirely and depend on OF for matching. Suggested-by: Marek Szyprowski Signed-off-by: Krzysztof Kozlowski --- drivers/mfd/Kconfig | 1 + drivers/mfd/sec-core.c | 59 +++++++++++------------------------------- 2 files changed, 16 insertions(+), 44 deletions(-) diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 5232bc0db8c0..219c09e15452 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -1145,6 +1145,7 @@ config MFD_RN5T618 config MFD_SEC_CORE tristate "Samsung Electronics PMIC Series Support" depends on I2C=y + depends on OF || COMPILE_TEST select MFD_CORE select REGMAP_I2C select REGMAP_IRQ diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c index 15dd4c579937..c61c1fc62165 100644 --- a/drivers/mfd/sec-core.c +++ b/drivers/mfd/sec-core.c @@ -94,7 +94,6 @@ static const struct mfd_cell s2mpu02_devs[] = { { .name = "s2mpu02-regulator", }, }; -#ifdef CONFIG_OF static const struct of_device_id sec_dt_match[] = { { .compatible = "samsung,s5m8767-pmic", @@ -122,7 +121,6 @@ static const struct of_device_id sec_dt_match[] = { }, }; MODULE_DEVICE_TABLE(of, sec_dt_match); -#endif static bool s2mpa01_volatile(struct device *dev, unsigned int reg) { @@ -282,7 +280,6 @@ static void sec_pmic_configure(struct sec_pmic_dev *sec_pmic) } } -#ifdef CONFIG_OF /* * Only the common platform data elements for s5m8767 are parsed here from the * device tree. Other sub-modules of s5m8767 such as pmic, rtc , charger and @@ -313,28 +310,12 @@ sec_pmic_i2c_parse_dt_pdata(struct device *dev) "samsung,s2mps11-wrstbi-ground"); return pd; } -#else -static struct sec_platform_data * -sec_pmic_i2c_parse_dt_pdata(struct device *dev) -{ - return NULL; -} -#endif - -static inline unsigned long sec_i2c_get_driver_data(struct i2c_client *i2c, - const struct i2c_device_id *id) -{ - if (i2c->dev.of_node) - return (unsigned long)of_device_get_match_data(&i2c->dev); - - return id->driver_data; -} static int sec_pmic_probe(struct i2c_client *i2c, const struct i2c_device_id *id) { - struct sec_platform_data *pdata = dev_get_platdata(&i2c->dev); const struct regmap_config *regmap; + struct sec_platform_data *pdata; const struct mfd_cell *sec_devs; struct sec_pmic_dev *sec_pmic; unsigned long device_type; @@ -349,22 +330,19 @@ static int sec_pmic_probe(struct i2c_client *i2c, sec_pmic->dev = &i2c->dev; sec_pmic->i2c = i2c; sec_pmic->irq = i2c->irq; - device_type = sec_i2c_get_driver_data(i2c, id); - - if (sec_pmic->dev->of_node) { - pdata = sec_pmic_i2c_parse_dt_pdata(sec_pmic->dev); - if (IS_ERR(pdata)) { - ret = PTR_ERR(pdata); - return ret; - } - pdata->device_type = device_type; - } - if (pdata) { - sec_pmic->device_type = pdata->device_type; - sec_pmic->irq_base = pdata->irq_base; - sec_pmic->wakeup = pdata->wakeup; - sec_pmic->pdata = pdata; + device_type = (unsigned long)of_device_get_match_data(sec_pmic->dev); + + pdata = sec_pmic_i2c_parse_dt_pdata(sec_pmic->dev); + if (IS_ERR(pdata)) { + ret = PTR_ERR(pdata); + return ret; } + pdata->device_type = device_type; + + sec_pmic->device_type = pdata->device_type; + sec_pmic->irq_base = pdata->irq_base; + sec_pmic->wakeup = pdata->wakeup; + sec_pmic->pdata = pdata; switch (sec_pmic->device_type) { case S2MPA01: @@ -404,7 +382,7 @@ static int sec_pmic_probe(struct i2c_client *i2c, return ret; } - if (pdata && pdata->cfg_pmic_irq) + if (pdata->cfg_pmic_irq) pdata->cfg_pmic_irq(); sec_irq_init(sec_pmic); @@ -529,21 +507,14 @@ static int sec_pmic_resume(struct device *dev) static SIMPLE_DEV_PM_OPS(sec_pmic_pm_ops, sec_pmic_suspend, sec_pmic_resume); -static const struct i2c_device_id sec_pmic_id[] = { - { "sec_pmic", 0 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, sec_pmic_id); - static struct i2c_driver sec_pmic_driver = { .driver = { .name = "sec_pmic", .pm = &sec_pmic_pm_ops, - .of_match_table = of_match_ptr(sec_dt_match), + .of_match_table = sec_dt_match, }, .probe = sec_pmic_probe, .shutdown = sec_pmic_shutdown, - .id_table = sec_pmic_id, }; module_i2c_driver(sec_pmic_driver); From patchwork Wed May 26 12:47:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 448604 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84C6DC4708A for ; Wed, 26 May 2021 12:50:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 67D63613E6 for ; Wed, 26 May 2021 12:50:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234329AbhEZMwQ (ORCPT ); Wed, 26 May 2021 08:52:16 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56947 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234936AbhEZMte (ORCPT ); Wed, 26 May 2021 08:49:34 -0400 Received: from mail-ua1-f69.google.com ([209.85.222.69]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1llsx7-00012r-C2 for linux-samsung-soc@vger.kernel.org; Wed, 26 May 2021 12:48:01 +0000 Received: by mail-ua1-f69.google.com with SMTP id j17-20020ab018510000b029020db76022bbso705363uag.12 for ; Wed, 26 May 2021 05:48:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uIc+hPbkXVAFmDCofUL+b5FDgJB7wunjYixiHaMZC84=; b=QOcd4V1NKhz9mKNNE+FuDlnL3hdyPZJ+otOdX1FpBU++CuSrnneYPCtm+84alIpSyN onnkJYdw8PmBdnf1d6Xanv2E1c+bcUOlIUU+c7M/aL8Cu+NP+tCYO2lr0VGFdjo0tx8f 5KbF7McOR7Z3asBXgCf+JlJkfZWnBcYV5p/590PigW8yLVLdXxMLd8htVBIhlKkFFGRy oKTm8nMDms1vMigdGBFhkN5AeVmvsmILIvwq6jXZ5hsmXYEUh9TklB7krj6FM+Akau4W WnGP1kapccKLfA6iA/YAq5/N7hDKQHsrhjoGTKuJ2SjmTqRsjUsjKWjCbaq7hwwUC9cy g5MA== X-Gm-Message-State: AOAM532aHbUQtU7TsyQWLw5TZuZLGB8kHwPMthEYCNafMponOojv4EyF TZxI6nknBvi6+2tpqZl6eqz410r/k+dec9iOU2VKIqbJI2BUsebNSvMf4Bjyj/h0lO+hpwyukVG un/EsbrV5fI25jNMLZ6qU4yqbZnkgJOWa3OqVIlEV8nKrugqi X-Received: by 2002:a05:6102:34d:: with SMTP id e13mr31166291vsa.31.1622033278872; Wed, 26 May 2021 05:47:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLUl9+FuXiCkKXpZ3BpbPb9nKcQP/WZDUuFCDhCOI3YfGCRJALALHfGFE0HuWGuTN1VN/SVQ== X-Received: by 2002:a05:6102:34d:: with SMTP id e13mr31166241vsa.31.1622033278318; Wed, 26 May 2021 05:47:58 -0700 (PDT) Received: from localhost.localdomain ([45.237.48.3]) by smtp.gmail.com with ESMTPSA id c126sm875817vkh.47.2021.05.26.05.47.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 05:47:57 -0700 (PDT) From: Krzysztof Kozlowski To: Lee Jones , Support Opensource , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Tony Lindgren , linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-omap@vger.kernel.org, patches@opensource.cirrus.com Subject: [RESEND PATCH v2 11/13] mfd: sec: Remove unused irq_base in platform data Date: Wed, 26 May 2021 08:47:09 -0400 Message-Id: <20210526124711.33223-12-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210526124711.33223-1-krzysztof.kozlowski@canonical.com> References: <20210526124711.33223-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org The 'irq_base' field of platform data structure is not assigned, therefore its default value of 0 has no impact and can be safely dropped. Signed-off-by: Krzysztof Kozlowski --- drivers/mfd/sec-core.c | 1 - drivers/mfd/sec-irq.c | 4 +--- include/linux/mfd/samsung/core.h | 3 --- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/mfd/sec-core.c b/drivers/mfd/sec-core.c index 4c4db3171ce6..a9d4fbc51997 100644 --- a/drivers/mfd/sec-core.c +++ b/drivers/mfd/sec-core.c @@ -337,7 +337,6 @@ static int sec_pmic_probe(struct i2c_client *i2c, } sec_pmic->device_type = (unsigned long)of_device_get_match_data(sec_pmic->dev); - sec_pmic->irq_base = pdata->irq_base; sec_pmic->wakeup = pdata->wakeup; sec_pmic->pdata = pdata; diff --git a/drivers/mfd/sec-irq.c b/drivers/mfd/sec-irq.c index a98c5d165039..e473c2fb42d5 100644 --- a/drivers/mfd/sec-irq.c +++ b/drivers/mfd/sec-irq.c @@ -444,7 +444,6 @@ int sec_irq_init(struct sec_pmic_dev *sec_pmic) if (!sec_pmic->irq) { dev_warn(sec_pmic->dev, "No interrupt specified, no interrupts\n"); - sec_pmic->irq_base = 0; return 0; } @@ -482,8 +481,7 @@ int sec_irq_init(struct sec_pmic_dev *sec_pmic) ret = devm_regmap_add_irq_chip(sec_pmic->dev, sec_pmic->regmap_pmic, sec_pmic->irq, IRQF_TRIGGER_FALLING | IRQF_ONESHOT, - sec_pmic->irq_base, sec_irq_chip, - &sec_pmic->irq_data); + 0, sec_irq_chip, &sec_pmic->irq_data); if (ret != 0) { dev_err(sec_pmic->dev, "Failed to register IRQ chip: %d\n", ret); return ret; diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h index bfde1b7c6303..9864f13b7814 100644 --- a/include/linux/mfd/samsung/core.h +++ b/include/linux/mfd/samsung/core.h @@ -67,7 +67,6 @@ struct sec_pmic_dev { struct i2c_client *i2c; unsigned long device_type; - int irq_base; int irq; struct regmap_irq_chip_data *irq_data; @@ -83,8 +82,6 @@ struct sec_platform_data { struct sec_opmode_data *opmode; int num_regulators; - int irq_base; - bool wakeup; bool buck_voltage_lock; From patchwork Wed May 26 12:47:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 448605 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4A36C47088 for ; Wed, 26 May 2021 12:50:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B46606113D for ; Wed, 26 May 2021 12:50:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233613AbhEZMwM (ORCPT ); Wed, 26 May 2021 08:52:12 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:56968 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234951AbhEZMth (ORCPT ); Wed, 26 May 2021 08:49:37 -0400 Received: from mail-vs1-f69.google.com ([209.85.217.69]) by youngberry.canonical.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1llsxB-00014i-MR for linux-samsung-soc@vger.kernel.org; Wed, 26 May 2021 12:48:05 +0000 Received: by mail-vs1-f69.google.com with SMTP id g13-20020a0561020ccdb029023fe9ce9042so197759vst.3 for ; Wed, 26 May 2021 05:48:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0G840/6Lxcb0Mf0VQ/EHwzTpuJEk0LuU0gTLTIwmZhs=; b=Ln9PZ+0FUxEsnixKvxSFj7vSHgYVvc+urEmABprVN+lGddvcZ6AqWqHajQjSQnRK9U sS80IVxw9CTlwtCgH4ByStoYABh3D94IHr/7io7b6oor6YVEkSkTImW+vwprMXa5mwML w6vZ350m21O8RyaXGRZLF+Z2sQz9UVfsn9waAkdfgeqIvX7MFkUbFUsktxsXjjcVGqmK uvIGlDXODxpUpAeepOqv2boNfy9Vu6uemqb9oYwVYqYRkWsK04edn24YXCJ8RZUH0xKW /e4RIZXOjCEx0FA9t6Z6q+4wvdB7tCyFZnLNi+mlzhOnl4IpO5ntaFEGOcXXpqcESloA dBfQ== X-Gm-Message-State: AOAM530FSPSf4WFzLSQSc7VCE1M5e2gJgVuxvhciQRav9/mbToiWsYew Tr0LoFz4UIt+UexiLzqJl0Bx8cbRcxNC+LNJnA85m31XhGynr7LKubVQRN/86Ho9hRIwKD14SP+ bmsI7Rn7gh29Wz03vPfTLNtZlH75+yNCyF6f7smtoRpVl6jI9 X-Received: by 2002:a67:ec4f:: with SMTP id z15mr29705038vso.27.1622033284477; Wed, 26 May 2021 05:48:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCoTnt6t9OzH8wpF2Ii6dBrFO6A3IuSsgipAxOrGMJk8cgaaL0/Ep+nV8/pkm14FWQbrzLzQ== X-Received: by 2002:a67:ec4f:: with SMTP id z15mr29705029vso.27.1622033284342; Wed, 26 May 2021 05:48:04 -0700 (PDT) Received: from localhost.localdomain ([45.237.48.3]) by smtp.gmail.com with ESMTPSA id c126sm875817vkh.47.2021.05.26.05.48.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 May 2021 05:48:03 -0700 (PDT) From: Krzysztof Kozlowski To: Lee Jones , Support Opensource , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Tony Lindgren , linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-omap@vger.kernel.org, patches@opensource.cirrus.com Subject: [RESEND PATCH v2 13/13] mfd: sec: Remove unused platform data members Date: Wed, 26 May 2021 08:47:11 -0400 Message-Id: <20210526124711.33223-14-krzysztof.kozlowski@canonical.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210526124711.33223-1-krzysztof.kozlowski@canonical.com> References: <20210526124711.33223-1-krzysztof.kozlowski@canonical.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org The Samsung PMIC drivers for early chipsets like S5M8767 stored quite a lot in platform data (struct sec_platform_data). The s5m8767 regulator driver currently references only some of its fields. Newer regulator drivers (e.g. s2mps11) use even less platform data fields. Clean up the structure to reduce memory footprint and source code size. Signed-off-by: Krzysztof Kozlowski --- include/linux/mfd/samsung/core.h | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/include/linux/mfd/samsung/core.h b/include/linux/mfd/samsung/core.h index b0d049a56d16..f92fe090473d 100644 --- a/include/linux/mfd/samsung/core.h +++ b/include/linux/mfd/samsung/core.h @@ -80,8 +80,6 @@ struct sec_platform_data { struct sec_opmode_data *opmode; int num_regulators; - bool buck_voltage_lock; - int buck_gpios[3]; int buck_ds[3]; unsigned int buck2_voltage[8]; @@ -91,35 +89,12 @@ struct sec_platform_data { unsigned int buck4_voltage[8]; bool buck4_gpiodvs; - int buck_set1; - int buck_set2; - int buck_set3; - int buck2_enable; - int buck3_enable; - int buck4_enable; int buck_default_idx; - int buck2_default_idx; - int buck3_default_idx; - int buck4_default_idx; - int buck_ramp_delay; - int buck2_ramp_delay; - int buck34_ramp_delay; - int buck5_ramp_delay; - int buck16_ramp_delay; - int buck7810_ramp_delay; - int buck9_ramp_delay; - int buck24_ramp_delay; - int buck3_ramp_delay; - int buck7_ramp_delay; - int buck8910_ramp_delay; - - bool buck1_ramp_enable; bool buck2_ramp_enable; bool buck3_ramp_enable; bool buck4_ramp_enable; - bool buck6_ramp_enable; int buck2_init; int buck3_init;