From patchwork Thu Jan 26 09:29:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 92497 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp96144qgi; Thu, 26 Jan 2017 01:30:07 -0800 (PST) X-Received: by 10.84.231.143 with SMTP id g15mr2800197plk.1.1485423007363; Thu, 26 Jan 2017 01:30:07 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 197si25983013pgd.70.2017.01.26.01.30.07; Thu, 26 Jan 2017 01:30:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-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-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753264AbdAZJaF (ORCPT + 4 others); Thu, 26 Jan 2017 04:30:05 -0500 Received: from mailout3.w1.samsung.com ([210.118.77.13]:23716 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753088AbdAZJaD (ORCPT ); Thu, 26 Jan 2017 04:30:03 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OKD0082ARPYD170@mailout3.w1.samsung.com>; Thu, 26 Jan 2017 09:30:00 +0000 (GMT) Received: from eusmges4.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170126092959eucas1p183e406b9dcd394aa2b387fab526b283d~dSFkaCr582547725477eucas1p1o; Thu, 26 Jan 2017 09:29:59 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges4.samsung.com (EUCPMTA) with SMTP id D0.7D.28517.791C9885; Thu, 26 Jan 2017 09:29:59 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170126092958eucas1p283f0ac46709ec4e72ecc6fc09735aade~dSFjlaPPe1109211092eucas1p2J; Thu, 26 Jan 2017 09:29:58 +0000 (GMT) X-AuditID: cbfec7f4-f79716d000006f65-11-5889c1979c86 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 38.FC.06687.6D1C9885; Thu, 26 Jan 2017 09:31:02 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OKD007J9RPVXW40@eusync3.samsung.com>; Thu, 26 Jan 2017 09:29:58 +0000 (GMT) From: Marek Szyprowski To: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Linus Walleij , Tomasz Figa , Bartlomiej Zolnierkiewicz Subject: [PATCH v3 REBASED 04/13] pinctrl: samsung: Document Exynos3250 SoC support Date: Thu, 26 Jan 2017 10:29:18 +0100 Message-id: <1485422967-30643-1-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrLIsWRmVeSWpSXmKPExsWy7djP87rTD3ZGGPz6KWaxccZ6Vovz5zew W0z5s5zJYtPja6wWm+f/YbT43HuE0WLG+X1MFmuP3GW3OPymndVi1a4/jA5cHjtn3WX32LSq k83jzrU9bB6bl9R79G1ZxejxeZNcAFsUl01Kak5mWWqRvl0CV0bXlcUsBZe4Ku7tWMzUwLiZ s4uR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KNGw pBfMYRaYwCQx81MDE0iVsECoxMWePewgNouAqsT6OZtYQGxeAQ+JMzu+sELsk5M4eWwyK8gZ nALBEv+OaIKEhQQCJGat2s08gZF3ASPDKkaR1NLi3PTcYkO94sTc4tK8dL3k/NxNjMCQ33bs 5+YdjJc2Bh9iFOBgVOLhPbCjI0KINbGsuDL3EKMEB7OSCO+hfZ0RQrwpiZVVqUX58UWlOanF hxhNgW6ayCwlmpwPjMe8knhDE0NzS0MjYwsLcyMjJXHekg9XwoUE0hNLUrNTUwtSi2D6mDg4 pRoY67jl1ZfPvlL/TumUzAz70+IN3/JecK283t7cZ8ylsbQ5KKSOY77Ejr6Z35U2uJ9mWpma KO0n9kLF+fSGSd9kGSbOW3EtMs8jiev7+88Lv4Vof9m2+Q7bQq9l6xxOHajfHLDLP8FiyuMK 7dj0rZoR2uLRGpXNao7/Fh5m0E4zfsyyc8avBd0sSizFGYmGWsxFxYkAYJiSPY8CAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170126092958eucas1p283f0ac46709ec4e72ecc6fc09735aade X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170126092958eucas1p283f0ac46709ec4e72ecc6fc09735aade X-RootMTR: 20170126092958eucas1p283f0ac46709ec4e72ecc6fc09735aade References: Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Add missing compatible id for Exynos3250 SoC to device tree docs. Exynos pin control driver supports it since commit d97f5b9804bfcdc1 ("pinctrl: exynos: Add driver data for Exynos3250"). Signed-off-by: Marek Szyprowski Reviewed-by: Krzysztof Kozlowski Acked-by: Tomasz Figa --- Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt | 1 + 1 file changed, 1 insertion(+) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt index 1baf19eecabf..5e00a21de2bf 100644 --- a/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt +++ b/Documentation/devicetree/bindings/pinctrl/samsung-pinctrl.txt @@ -13,6 +13,7 @@ Required Properties: - "samsung,s3c2450-pinctrl": for S3C2450-compatible pin-controller, - "samsung,s3c64xx-pinctrl": for S3C64xx-compatible pin-controller, - "samsung,s5pv210-pinctrl": for S5PV210-compatible pin-controller, + - "samsung,exynos3250-pinctrl": for Exynos3250 compatible pin-controller. - "samsung,exynos4210-pinctrl": for Exynos4210 compatible pin-controller. - "samsung,exynos4x12-pinctrl": for Exynos4x12 compatible pin-controller. - "samsung,exynos5250-pinctrl": for Exynos5250 compatible pin-controller. From patchwork Thu Jan 26 09:29:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 92498 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp96177qgi; Thu, 26 Jan 2017 01:30:10 -0800 (PST) X-Received: by 10.98.103.195 with SMTP id t64mr2009889pfj.106.1485423010277; Thu, 26 Jan 2017 01:30:10 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 197si25983013pgd.70.2017.01.26.01.30.10; Thu, 26 Jan 2017 01:30:10 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753136AbdAZJaH (ORCPT + 13 others); Thu, 26 Jan 2017 04:30:07 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:26843 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753144AbdAZJaD (ORCPT ); Thu, 26 Jan 2017 04:30:03 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OKD0063PRPZKE70@mailout1.w1.samsung.com>; Thu, 26 Jan 2017 09:30:00 +0000 (GMT) Received: from eusmges3.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170126092959eucas1p222ce674ae5e45612b89314f37fcdfa5a~dSFkk29oh0736607366eucas1p2g; Thu, 26 Jan 2017 09:29:59 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3.samsung.com (EUCPMTA) with SMTP id 96.A5.09557.791C9885; Thu, 26 Jan 2017 09:29:59 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170126092959eucas1p266be982a9afbc8086d69f3d24bee2b3a~dSFkAHvLO1108211082eucas1p2W; Thu, 26 Jan 2017 09:29:59 +0000 (GMT) X-AuditID: cbfec7f2-f790f6d000002555-88-5889c197feb2 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 09.FC.06687.7D1C9885; Thu, 26 Jan 2017 09:31:03 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OKD007J9RPVXW40@eusync3.samsung.com>; Thu, 26 Jan 2017 09:29:59 +0000 (GMT) From: Marek Szyprowski To: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Linus Walleij , Tomasz Figa , Bartlomiej Zolnierkiewicz Subject: [PATCH v3 REBASED 05/13] pinctrl: samsung: Remove messages for failed memory allocation Date: Thu, 26 Jan 2017 10:29:19 +0100 Message-id: <1485422967-30643-2-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1485422967-30643-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAAzWRf0gTYRzGe++2u3O4uqbVm5nkon8SLUvYURJGhScSWBGNkHLpMUdO5U6H RqBtWdvMGRpuFZHR75HOtrFW8+dm0xioExEdrTCJIpqEwz+UIeVu/fd53+/zPHwfvgQqCQvS CFV1HcNWK6qkmEjg8q9OZJtHDPKD/sVM6q3FJqQmJ/tw6l7sJULZF2eFlONxDFDRtlFAWSYH EapnNIxTvt+3hZT1QwwUiOj3D8I4bbcaMPrzbD9GO5410SanFdBRe0YJdlGUX8FUqTQMe+BY mahy3rGO13ZlNczd1CHN4ONeI0giIJkHI3eWhDxvh1NfbJgRiAgJ+RzA6fYQzj+iAHYMhVAj IOIOXzCZ/38BoOGHJ+FoRmDbQB+2EYWRudAYMcYHqaQOwPvhgXgUSpoQGHUMgA1VCnkFTi97 kA0WkPugtUUXd4tJGobaFxB+qQz4yd8ZXzCJLIJDWlc8CJKdOFwKuzF+p93QPozy+pPQZZ5L FEqBv8acOM/p0KAfSWS2A6htyeLZAuBERMzzUegbC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g7tcT0ioLzJkU3r3LMA3ee5w9c1vengNVC+5FLTFU /9dqN6uUZ1ndJM35bd9mtW4XONH0z+iBWztLxcLSKrvI8lVvf5+aGci8MOq5TaR1lNfxK6uK 1kz0954zx+7h0l6JPr312ZOmF16tesiamBacbsOkxFKckWioxVxUnAgA5J0rjpACAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170126092959eucas1p266be982a9afbc8086d69f3d24bee2b3a X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170126092959eucas1p266be982a9afbc8086d69f3d24bee2b3a X-RootMTR: 20170126092959eucas1p266be982a9afbc8086d69f3d24bee2b3a References: <1485422967-30643-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Memory subsystem already prints message about failed memory allocation, there is no need to do it in the drivers. Signed-off-by: Marek Szyprowski Reviewed-by: Krzysztof Kozlowski Acked-by: Tomasz Figa --- drivers/pinctrl/samsung/pinctrl-exynos.c | 8 ++------ drivers/pinctrl/samsung/pinctrl-s3c64xx.c | 12 +++--------- drivers/pinctrl/samsung/pinctrl-samsung.c | 24 ++++++------------------ 3 files changed, 11 insertions(+), 33 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c index 107d033bff86..37b48301661b 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos.c @@ -517,10 +517,8 @@ static int exynos_eint_wkup_init(struct samsung_pinctrl_drv_data *d) weint_data = devm_kzalloc(dev, bank->nr_pins * sizeof(*weint_data), GFP_KERNEL); - if (!weint_data) { - dev_err(dev, "could not allocate memory for weint_data\n"); + if (!weint_data) return -ENOMEM; - } for (idx = 0; idx < bank->nr_pins; ++idx) { irq = irq_of_parse_and_map(bank->of_node, idx); @@ -548,10 +546,8 @@ static int exynos_eint_wkup_init(struct samsung_pinctrl_drv_data *d) muxed_data = devm_kzalloc(dev, sizeof(*muxed_data) + muxed_banks*sizeof(struct samsung_pin_bank *), GFP_KERNEL); - if (!muxed_data) { - dev_err(dev, "could not allocate memory for muxed_data\n"); + if (!muxed_data) return -ENOMEM; - } irq_set_chained_handler_and_data(irq, exynos_irq_demux_eint16_31, muxed_data); diff --git a/drivers/pinctrl/samsung/pinctrl-s3c64xx.c b/drivers/pinctrl/samsung/pinctrl-s3c64xx.c index 4c632812ccff..f17890aa6e25 100644 --- a/drivers/pinctrl/samsung/pinctrl-s3c64xx.c +++ b/drivers/pinctrl/samsung/pinctrl-s3c64xx.c @@ -489,10 +489,8 @@ static int s3c64xx_eint_gpio_init(struct samsung_pinctrl_drv_data *d) data = devm_kzalloc(dev, sizeof(*data) + nr_domains * sizeof(*data->domains), GFP_KERNEL); - if (!data) { - dev_err(dev, "failed to allocate handler data\n"); + if (!data) return -ENOMEM; - } data->drvdata = d; bank = d->pin_banks; @@ -715,10 +713,8 @@ static int s3c64xx_eint_eint0_init(struct samsung_pinctrl_drv_data *d) return -ENODEV; data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL); - if (!data) { - dev_err(dev, "could not allocate memory for wkup eint data\n"); + if (!data) return -ENOMEM; - } data->drvdata = d; for (i = 0; i < NUM_EINT0_IRQ; ++i) { @@ -751,10 +747,8 @@ static int s3c64xx_eint_eint0_init(struct samsung_pinctrl_drv_data *d) ddata = devm_kzalloc(dev, sizeof(*ddata) + nr_eints, GFP_KERNEL); - if (!ddata) { - dev_err(dev, "failed to allocate domain data\n"); + if (!ddata) return -ENOMEM; - } ddata->bank = bank; bank->irq_domain = irq_domain_add_linear(bank->of_node, diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index 3bc925f61b71..b11e67e85460 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -93,10 +93,8 @@ static int reserve_map(struct device *dev, struct pinctrl_map **map, return 0; new_map = krealloc(*map, sizeof(*new_map) * new_num, GFP_KERNEL); - if (!new_map) { - dev_err(dev, "krealloc(map) failed\n"); + if (!new_map) return -ENOMEM; - } memset(new_map + old_num, 0, (new_num - old_num) * sizeof(*new_map)); @@ -133,10 +131,8 @@ static int add_map_configs(struct device *dev, struct pinctrl_map **map, dup_configs = kmemdup(configs, num_configs * sizeof(*dup_configs), GFP_KERNEL); - if (!dup_configs) { - dev_err(dev, "kmemdup(configs) failed\n"); + if (!dup_configs) return -ENOMEM; - } (*map)[*num_maps].type = PIN_MAP_TYPE_CONFIGS_GROUP; (*map)[*num_maps].data.configs.group_or_pin = group; @@ -156,10 +152,8 @@ static int add_config(struct device *dev, unsigned long **configs, new_configs = krealloc(*configs, sizeof(*new_configs) * new_num, GFP_KERNEL); - if (!new_configs) { - dev_err(dev, "krealloc(configs) failed\n"); + if (!new_configs) return -ENOMEM; - } new_configs[old_num] = config; @@ -756,10 +750,8 @@ static struct samsung_pmx_func *samsung_pinctrl_create_functions( functions = devm_kzalloc(dev, func_cnt * sizeof(*functions), GFP_KERNEL); - if (!functions) { - dev_err(dev, "failed to allocate memory for function list\n"); + if (!functions) return ERR_PTR(-EINVAL); - } func = functions; /* @@ -850,10 +842,8 @@ static int samsung_pinctrl_register(struct platform_device *pdev, pindesc = devm_kzalloc(&pdev->dev, sizeof(*pindesc) * drvdata->nr_pins, GFP_KERNEL); - if (!pindesc) { - dev_err(&pdev->dev, "mem alloc for pin descriptors failed\n"); + if (!pindesc) return -ENOMEM; - } ctrldesc->pins = pindesc; ctrldesc->npins = drvdata->nr_pins; @@ -867,10 +857,8 @@ static int samsung_pinctrl_register(struct platform_device *pdev, */ pin_names = devm_kzalloc(&pdev->dev, sizeof(char) * PIN_NAME_LENGTH * drvdata->nr_pins, GFP_KERNEL); - if (!pin_names) { - dev_err(&pdev->dev, "mem alloc for pin names failed\n"); + if (!pin_names) return -ENOMEM; - } /* for each pin, the name of the pin is pin-bank name + pin number */ for (bank = 0; bank < drvdata->nr_banks; bank++) { From patchwork Thu Jan 26 09:29:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 92499 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp96199qgi; Thu, 26 Jan 2017 01:30:13 -0800 (PST) X-Received: by 10.84.253.2 with SMTP id z2mr2760285pll.116.1485423013884; Thu, 26 Jan 2017 01:30:13 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 197si25983013pgd.70.2017.01.26.01.30.13; Thu, 26 Jan 2017 01:30:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-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-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753209AbdAZJaL (ORCPT + 4 others); Thu, 26 Jan 2017 04:30:11 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:34105 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753196AbdAZJaE (ORCPT ); Thu, 26 Jan 2017 04:30:04 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OKD00647RQ14M70@mailout2.w1.samsung.com>; Thu, 26 Jan 2017 09:30:01 +0000 (GMT) Received: from eusmges4.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170126093000eucas1p29fac8b79e1f27c7b0bdaf28d13b831f2~dSFlETzCu3033830338eucas1p2D; Thu, 26 Jan 2017 09:30:00 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges4.samsung.com (EUCPMTA) with SMTP id E1.7D.28517.791C9885; Thu, 26 Jan 2017 09:30:00 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170126092959eucas1p28ac04e5c3b9c4ae882047c93a57d3a4e~dSFkb3QJA3033830338eucas1p2C; Thu, 26 Jan 2017 09:29:59 +0000 (GMT) X-AuditID: cbfec7f4-f79716d000006f65-14-5889c1978b84 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id E9.FC.06687.7D1C9885; Thu, 26 Jan 2017 09:31:03 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OKD007J9RPVXW40@eusync3.samsung.com>; Thu, 26 Jan 2017 09:29:59 +0000 (GMT) From: Marek Szyprowski To: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Linus Walleij , Tomasz Figa , Bartlomiej Zolnierkiewicz Subject: [PATCH v3 REBASED 06/13] pinctrl: samsung: Fix samsung_pinctrl_create_functions return value Date: Thu, 26 Jan 2017 10:29:20 +0100 Message-id: <1485422967-30643-3-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1485422967-30643-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAAzWRbUhTYRTHe+7dvbsuF5c58mAqMpSi8A324ZJhRVELCvwSzb7UyMuUtqm7 vkM0fCk3mOayXPUhxVSYydYmy0rnNs2lsZYgGvnyZVJg2tukCGbkdte333nO//z/5/BQuGRZ kEZV6GpYvU6lkZEigXvmTyjX6jMqC+4PEswzq51gQiGHkOmODmGMM7xIMK7HUcREzNOIsYY8 GDMyvSpkpjZvE4ztZRSdEClePFwVKpw2I6lYWRwnFa4nNxUdozakiDgzS8jLomNlrKaijtXn F18Vld9781xYtUY2jPTZcQMKEyZEUUDLYXu8wISSdnE/vF+zkzGW0AMIPOF6ExLtcgTBd8cv jBfJYX36N8k3BhEMfFvB+MKAgXnCER8n6UIwbZniKindguDB6oQwVuB0BwYR1wSKZafQarCs V8cGBHQOGJ4GUYzFtALalixCPi4TZmfuEjFOos/BZLM77gN0pxCWvdbEDRng9OK8/jS09JsS q6bARmA04ZMOxnZf4r0TQXPbEZ6tCN5tiXkugqnAfDwLp/eBxd2D8/ZiaL8l4SUK6PB0IZ5P wuwjE8EfH0bQ+tGN30HpvWiPDUnZWk6rZjl5HqfScrU6dd61Sq0T7X7527+B7THUP3PUj2gK yZLF3rF2pYRQ1XGNWj8CCpdJxX6PUSkRl6kam1h95RV9rYbl/OgAJZClisd7Fy5JaLWqhr3O slWs/n8Xo5LSDOh83lKaMphzaF+PJmv0ePnSVoPRWFT5SmPWUsPBrhupxpCNbkqRqom+zPwf X/aOWYrstM1x8Gur6tSH/Gxb3fzkBuyU5g4F6z/JdzLW+nzO4hqv+fXnUh8RzS7Z7J4LJLss Pxv0BduFwztnL4bnBquphTM6TMRWCRezXBdkAq5cVXgY13Oqf4cBotnuAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrLLMWRmVeSWpSXmKPExsVy+t/xq7rXD3ZGGJxap2qxccZ6Vovz5zew W0z5s5zJYtPja6wWm+f/YbT43HuE0WLG+X1MFmuP3GW3OPymndVi1a4/jA5cHjtn3WX32LSq k83jzrU9bB6bl9R79G1ZxejxeZNcAFuUm01GamJKapFCal5yfkpmXrqtUmiIm66FkkJeYm6q rVKErm9IkJJCWWJOKZBnZIAGHJwD3IOV9O0S3DKmntjOXnCPrWLtwvXMDYyPWbsYOTkkBEwk nhz5zgZhi0lcuLceyObiEBJYwiix8/syVginiUli4fVHzCBVbAKGEl1vu8CqRASaGSUalvSC OcwCE5gkZn5qYOpi5OAQFkiXmPSkEKSBRUBVomHNWUYQm1fAQ6L1+iR2iHVyEiePTQY7g1PA U2J/0zawuJDAREaJo7OzJzDyLmBkWMUoklpanJueW2yoV5yYW1yal66XnJ+7iREY9NuO/dy8 g/HSxuBDjAIcjEo8vAd2dEQIsSaWFVfmHmKU4GBWEuE9tK8zQog3JbGyKrUoP76oNCe1+BCj KdBRE5mlRJPzgRGZVxJvaGJobmloZGxhYW5kpCTOW/LhSriQQHpiSWp2ampBahFMHxMHp1QD 49S3Podqky9tFfE49Yi/boLzDePMzwVvjm9bdiCSpa9SxzDLTuG7T0Xg5kfNm7Q6de7KWk91 nBwg3/+WT91Qeot+352vbmq72Dm0g9uMnhbeONk3dUHZjKBnYkprf068x5PBlrvww3LO8JyJ 1zUvNh3IOS1xvi95k9hk709p2Yuuvy1Q6S/fpsRSnJFoqMVcVJwIAIY9WoqQAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170126092959eucas1p28ac04e5c3b9c4ae882047c93a57d3a4e X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170126092959eucas1p28ac04e5c3b9c4ae882047c93a57d3a4e X-RootMTR: 20170126092959eucas1p28ac04e5c3b9c4ae882047c93a57d3a4e References: <1485422967-30643-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Return proper error code in case of memory allocation failure. Signed-off-by: Marek Szyprowski Reviewed-by: Krzysztof Kozlowski Acked-by: Tomasz Figa --- drivers/pinctrl/samsung/pinctrl-samsung.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index b11e67e85460..10b3fd826231 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -751,7 +751,7 @@ static struct samsung_pmx_func *samsung_pinctrl_create_functions( functions = devm_kzalloc(dev, func_cnt * sizeof(*functions), GFP_KERNEL); if (!functions) - return ERR_PTR(-EINVAL); + return ERR_PTR(-ENOMEM); func = functions; /* From patchwork Thu Jan 26 09:29:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 92500 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp96205qgi; Thu, 26 Jan 2017 01:30:15 -0800 (PST) X-Received: by 10.84.194.37 with SMTP id g34mr2747837pld.105.1485423015791; Thu, 26 Jan 2017 01:30:15 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 197si25983013pgd.70.2017.01.26.01.30.15; Thu, 26 Jan 2017 01:30:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-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-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753196AbdAZJaN (ORCPT + 4 others); Thu, 26 Jan 2017 04:30:13 -0500 Received: from mailout4.w1.samsung.com ([210.118.77.14]:46621 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753260AbdAZJaF (ORCPT ); Thu, 26 Jan 2017 04:30:05 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OKD0066JRQ2VH70@mailout4.w1.samsung.com>; Thu, 26 Jan 2017 09:30:02 +0000 (GMT) Received: from eusmges5.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170126093001eucas1p2aaf88a49a7a317913c6d4245d497f474~dSFmYcsUk3033830338eucas1p2F; Thu, 26 Jan 2017 09:30:01 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges5.samsung.com (EUCPMTA) with SMTP id 71.02.17477.991C9885; Thu, 26 Jan 2017 09:30:01 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170126093000eucas1p249774814b7dd40bc6e90488fd2a11445~dSFlF_M7_1106911069eucas1p2_; Thu, 26 Jan 2017 09:30:00 +0000 (GMT) X-AuditID: cbfec7f5-f79d06d000004445-7d-5889c199a8b6 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 4D.1C.10233.591C9885; Thu, 26 Jan 2017 09:29:57 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OKD007J9RPVXW40@eusync3.samsung.com>; Thu, 26 Jan 2017 09:30:00 +0000 (GMT) From: Marek Szyprowski To: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Linus Walleij , Tomasz Figa , Bartlomiej Zolnierkiewicz Subject: [PATCH v3 REBASED 07/13] pinctrl: samsung: Add missing initconst annotation Date: Thu, 26 Jan 2017 10:29:21 +0100 Message-id: <1485422967-30643-4-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1485422967-30643-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrNIsWRmVeSWpSXmKPExsWy7djPc7ozD3ZGGLROkLPYOGM9q8X58xvY Lab8Wc5ksenxNVaLzfP/MFp87j3CaDHj/D4mi7VH7rJbHH7TzmqxatcfRgcuj52z7rJ7bFrV yeZx59oeNo/NS+o9+rasYvT4vEkugC2KyyYlNSezLLVI3y6BK2PByWmsBfuUK07fn8zYwLhG rouRk0NCwERiz+wf7BC2mMSFe+vZQGwhgaWMEr/vqHQxcgHZnxkl/mzdzNjFyAHWsP17DkR8 GaPEzSfvWCGcBiaJn3uawSax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LCwlMZJQ4Ojt7AiPvAkaGVYwiqaXFuem5xUZ6xYm5xaV56XrJ+bmbGIFBv+3Y zy07GLveBR9iFOBgVOLhzdjWESHEmlhWXJl7iFGCg1lJhPfQvs4IId6UxMqq1KL8+KLSnNTi Q4ymQEdNZJYSTc4HRmReSbyhiaG5paGRsYWFuZGRkjjv1A9XwoUE0hNLUrNTUwtSi2D6mDg4 pRoYY/tXqK8+fsb8bOn0DyneXevW6307YfDlWY/DHkYrk4O3Dqyr6I969vZI7jnni57lgeef BiayXe/p3L1D5p28iJDx/cJrl5yq58x1jlT9znfO7R5D9uz/55Q+B/ps7j8eX95qK3lZOfOb KefNz3f2Fsx7Jeezu2A9/y+r66vXVof7tzU8yLvYo8RSnJFoqMVcVJwIAO1qgWaQAgAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170126093000eucas1p249774814b7dd40bc6e90488fd2a11445 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170126093000eucas1p249774814b7dd40bc6e90488fd2a11445 X-RootMTR: 20170126093000eucas1p249774814b7dd40bc6e90488fd2a11445 References: <1485422967-30643-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Exynos5433 support has been added in parallel to adding initconst annotation to most of the init data structures, so add those annotations also to Exynos5433 structures. Signed-off-by: Marek Szyprowski Acked-by: Tomasz Figa --- drivers/pinctrl/samsung/pinctrl-exynos.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c index 37b48301661b..53baafdad51b 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos.c @@ -1255,7 +1255,7 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) }; /* pin banks of exynos5433 pin-controller - ALIVE */ -static const struct samsung_pin_bank_data exynos5433_pin_banks0[] = { +static const struct samsung_pin_bank_data exynos5433_pin_banks0[] __initconst = { EXYNOS_PIN_BANK_EINTW(8, 0x000, "gpa0", 0x00), EXYNOS_PIN_BANK_EINTW(8, 0x020, "gpa1", 0x04), EXYNOS_PIN_BANK_EINTW(8, 0x040, "gpa2", 0x08), @@ -1268,28 +1268,28 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) }; /* pin banks of exynos5433 pin-controller - AUD */ -static const struct samsung_pin_bank_data exynos5433_pin_banks1[] = { +static const struct samsung_pin_bank_data exynos5433_pin_banks1[] __initconst = { EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz0", 0x00), EXYNOS_PIN_BANK_EINTG(4, 0x020, "gpz1", 0x04), }; /* pin banks of exynos5433 pin-controller - CPIF */ -static const struct samsung_pin_bank_data exynos5433_pin_banks2[] = { +static const struct samsung_pin_bank_data exynos5433_pin_banks2[] __initconst = { EXYNOS_PIN_BANK_EINTG(2, 0x000, "gpv6", 0x00), }; /* pin banks of exynos5433 pin-controller - eSE */ -static const struct samsung_pin_bank_data exynos5433_pin_banks3[] = { +static const struct samsung_pin_bank_data exynos5433_pin_banks3[] __initconst = { EXYNOS_PIN_BANK_EINTG(3, 0x000, "gpj2", 0x00), }; /* pin banks of exynos5433 pin-controller - FINGER */ -static const struct samsung_pin_bank_data exynos5433_pin_banks4[] = { +static const struct samsung_pin_bank_data exynos5433_pin_banks4[] __initconst = { EXYNOS_PIN_BANK_EINTG(4, 0x000, "gpd5", 0x00), }; /* pin banks of exynos5433 pin-controller - FSYS */ -static const struct samsung_pin_bank_data exynos5433_pin_banks5[] = { +static const struct samsung_pin_bank_data exynos5433_pin_banks5[] __initconst = { EXYNOS_PIN_BANK_EINTG(6, 0x000, "gph1", 0x00), EXYNOS_PIN_BANK_EINTG(7, 0x020, "gpr4", 0x04), EXYNOS_PIN_BANK_EINTG(5, 0x040, "gpr0", 0x08), @@ -1299,17 +1299,17 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) }; /* pin banks of exynos5433 pin-controller - IMEM */ -static const struct samsung_pin_bank_data exynos5433_pin_banks6[] = { +static const struct samsung_pin_bank_data exynos5433_pin_banks6[] __initconst = { EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpf0", 0x00), }; /* pin banks of exynos5433 pin-controller - NFC */ -static const struct samsung_pin_bank_data exynos5433_pin_banks7[] = { +static const struct samsung_pin_bank_data exynos5433_pin_banks7[] __initconst = { EXYNOS_PIN_BANK_EINTG(3, 0x000, "gpj0", 0x00), }; /* pin banks of exynos5433 pin-controller - PERIC */ -static const struct samsung_pin_bank_data exynos5433_pin_banks8[] = { +static const struct samsung_pin_bank_data exynos5433_pin_banks8[] __initconst = { EXYNOS_PIN_BANK_EINTG(6, 0x000, "gpv7", 0x00), EXYNOS_PIN_BANK_EINTG(5, 0x020, "gpb0", 0x04), EXYNOS_PIN_BANK_EINTG(8, 0x040, "gpc0", 0x08), @@ -1330,7 +1330,7 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) }; /* pin banks of exynos5433 pin-controller - TOUCH */ -static const struct samsung_pin_bank_data exynos5433_pin_banks9[] = { +static const struct samsung_pin_bank_data exynos5433_pin_banks9[] __initconst = { EXYNOS_PIN_BANK_EINTG(3, 0x000, "gpj1", 0x00), }; @@ -1338,7 +1338,7 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) * Samsung pinctrl driver data for Exynos5433 SoC. Exynos5433 SoC includes * ten gpio/pin-mux/pinconfig controllers. */ -const struct samsung_pin_ctrl exynos5433_pin_ctrl[] = { +const struct samsung_pin_ctrl exynos5433_pin_ctrl[] __initconst = { { /* pin-controller instance 0 data */ .pin_banks = exynos5433_pin_banks0, From patchwork Thu Jan 26 09:29:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 92501 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp96217qgi; Thu, 26 Jan 2017 01:30:18 -0800 (PST) X-Received: by 10.99.253.5 with SMTP id d5mr1902269pgh.47.1485423017986; Thu, 26 Jan 2017 01:30:17 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 197si25983013pgd.70.2017.01.26.01.30.17; Thu, 26 Jan 2017 01:30:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753291AbdAZJaP (ORCPT + 13 others); Thu, 26 Jan 2017 04:30:15 -0500 Received: from mailout3.w1.samsung.com ([210.118.77.13]:23716 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753256AbdAZJaF (ORCPT ); Thu, 26 Jan 2017 04:30:05 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OKD00AZYRQ13N60@mailout3.w1.samsung.com>; Thu, 26 Jan 2017 09:30:01 +0000 (GMT) Received: from eusmges2.samsung.com (unknown [203.254.199.241]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170126093001eucas1p23562f70c0f05678782f6ec12085e5ece~dSFmEYHY20736607366eucas1p2i; Thu, 26 Jan 2017 09:30:01 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2.samsung.com (EUCPMTA) with SMTP id 2C.63.30614.991C9885; Thu, 26 Jan 2017 09:30:01 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170126093000eucas1p2090613930c07a90f42e1b7b48584e012~dSFlVRyrN1109611096eucas1p2Q; Thu, 26 Jan 2017 09:30:00 +0000 (GMT) X-AuditID: cbfec7f1-f793f6d000007796-4e-5889c199c4d6 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id DA.FC.06687.8D1C9885; Thu, 26 Jan 2017 09:31:04 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OKD007J9RPVXW40@eusync3.samsung.com>; Thu, 26 Jan 2017 09:30:00 +0000 (GMT) From: Marek Szyprowski To: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Linus Walleij , Tomasz Figa , Bartlomiej Zolnierkiewicz Subject: [PATCH v3 REBASED 08/13] pinctrl: samsung: Remove dead code Date: Thu, 26 Jan 2017 10:29:22 +0100 Message-id: <1485422967-30643-5-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1485422967-30643-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrLIsWRmVeSWpSXmKPExsWy7djP87ozD3ZGGCx8wGmxccZ6Vovz5zew W0z5s5zJYtPja6wWm+f/YbT43HuE0WLG+X1MFmuP3GW3OPymndVi1a4/jA5cHjtn3WX32LSq k83jzrU9bB6bl9R79G1ZxejxeZNcAFsUl01Kak5mWWqRvl0CV8aD43uYCj7zVDzY2MvUwPia q4uRk0NCwERi4byJzBC2mMSFe+vZuhi5OIQEljJKNC25wQLhfGaUOPq0EyjDAdYx5VIBRHwZ o8SpM9dYIZwGJomfe5rZQUaxCRhKdL3tAhslItDMKDHz7l52EIdZoI9J4vPmvYwgVcICLhLH DraCdbAIqEpc7r/OAmLzCnhIfNt1lAXiKDmJk8cms4LYnAKeEvubtoENkhCYzC5xtWEmK8RN shKbDkA94SJx+M08VghbWOLV8S3sELaMRGfHQSYIux/ouVZtCHsGo8S5t7wQtrXE4eMXwXqZ BfgkJm2bzgwxnleio00IogTotGUzoU5zlLi0/gk0iB4zSqyeOJF9AqPMAkaGVYwiqaXFuemp xUZ6xYm5xaV56XrJ+bmbGIGRfvrf8Y87GN+fsDrEKMDBqMTDe2BHR4QQa2JZcWXuIUYJDmYl Ed5D+zojhHhTEiurUovy44tKc1KLDzFKc7AoifPuWXAlXEggPbEkNTs1tSC1CCbLxMEp1cC4 M0ZPi+3hwXLNAyflWFbdPhy7TqZbUvK0nYXpzMt/3jgkfImfZGFwuLipe5GCyXLzHrmbH/ui dgs27n5S3h7zucbkkuOy73q3LhvlqlsUZKaaHKprMsybW3Usm9m5PtV1w49nz1XOiGyddD4w ZdLhHn6O2ztuyAVdbzp1n/uGzd4JPjNNeO8osRRnJBpqMRcVJwIAf7yriPACAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrDLMWRmVeSWpSXmKPExsVy+t/xq7o3DnZGGCz4pWSxccZ6Vovz5zew W0z5s5zJYtPja6wWm+f/YbT43HuE0WLG+X1MFmuP3GW3OPymndVi1a4/jA5cHjtn3WX32LSq k83jzrU9bB6bl9R79G1ZxejxeZNcAFuUm01GamJKapFCal5yfkpmXrqtUmiIm66FkkJeYm6q rVKErm9IkJJCWWJOKZBnZIAGHJwD3IOV9O0S3DIeHN/DVPCZp+LBxl6mBsbXXF2MHBwSAiYS Uy4VdDFyApliEhfurWcDsYUEljBKPF0k0sXIBWQ3MUl8X/uXESTBJmAo0fW2iw0kISLQzCjR sKQXzGEWmMAkMfNTAxNIlbCAi8Sxg63sIDaLgKrE5f7rLCA2r4CHxLddR1kg1slJnDw2mRXE 5hTwlNjftI0dYvVERomjs7MnMPIuYGRYxSiSWlqcm55bbKhXnJhbXJqXrpecn7uJERjy2479 3LyD8dLG4EOMAhyMSjy8B3Z0RAixJpYVV+YeYpTgYFYS4T20rzNCiDclsbIqtSg/vqg0J7X4 EKMp0FETmaVEk/OB8ZhXEm9oYmhuaWhkbGFhbmSkJM5b8uFKuJBAemJJanZqakFqEUwfEwen VANj3Yqf2nOfv9wm8y5UR7Hh7NTyo50t9VI2fyacbbogXK7Wnq3Scf7CJn4+o1X3dtlGMuj4 JnOxdKq8yL3xf+n18uVMu4+u36psOuWmmWpXeE/i1Ta/3ngucdnv3to2rrtDvXYGK1mca9sS FpvN7nomOS4h6fvySPfeqVxZUdK/A95f59puu1mJpTgj0VCLuag4EQBOBkh3jwIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170126093000eucas1p2090613930c07a90f42e1b7b48584e012 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170126093000eucas1p2090613930c07a90f42e1b7b48584e012 X-RootMTR: 20170126093000eucas1p2090613930c07a90f42e1b7b48584e012 References: <1485422967-30643-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org 'enable' parameter has been removed a while ago, so all code for handling it can be simply removed. Signed-off-by: Marek Szyprowski Reviewed-by: Krzysztof Kozlowski Acked-by: Tomasz Figa --- drivers/pinctrl/samsung/pinctrl-samsung.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index 10b3fd826231..2803ae57f373 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -350,7 +350,7 @@ static void pin_to_reg_bank(struct samsung_pinctrl_drv_data *drvdata, /* enable or disable a pinmux function */ static void samsung_pinmux_setup(struct pinctrl_dev *pctldev, unsigned selector, - unsigned group, bool enable) + unsigned group) { struct samsung_pinctrl_drv_data *drvdata; const struct samsung_pin_bank_type *type; @@ -380,8 +380,7 @@ static void samsung_pinmux_setup(struct pinctrl_dev *pctldev, unsigned selector, data = readl(reg + type->reg_offset[PINCFG_TYPE_FUNC]); data &= ~(mask << shift); - if (enable) - data |= func->val << shift; + data |= func->val << shift; writel(data, reg + type->reg_offset[PINCFG_TYPE_FUNC]); spin_unlock_irqrestore(&bank->slock, flags); @@ -392,7 +391,7 @@ static int samsung_pinmux_set_mux(struct pinctrl_dev *pctldev, unsigned selector, unsigned group) { - samsung_pinmux_setup(pctldev, selector, group, true); + samsung_pinmux_setup(pctldev, selector, group); return 0; } From patchwork Thu Jan 26 09:29:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 92502 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp96237qgi; Thu, 26 Jan 2017 01:30:20 -0800 (PST) X-Received: by 10.98.214.209 with SMTP id a78mr2040552pfl.6.1485423020319; Thu, 26 Jan 2017 01:30:20 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 197si25983013pgd.70.2017.01.26.01.30.20; Thu, 26 Jan 2017 01:30:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-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-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753319AbdAZJaR (ORCPT + 4 others); Thu, 26 Jan 2017 04:30:17 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:26843 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753298AbdAZJaG (ORCPT ); Thu, 26 Jan 2017 04:30:06 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OKD00611RQ21G70@mailout1.w1.samsung.com>; Thu, 26 Jan 2017 09:30:02 +0000 (GMT) Received: from eusmges4.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170126093001eucas1p2b8fc96dc87a4073e224be37853f43623~dSFmbShmB1108211082eucas1p2X; Thu, 26 Jan 2017 09:30:01 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges4.samsung.com (EUCPMTA) with SMTP id C2.7D.28517.991C9885; Thu, 26 Jan 2017 09:30:01 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170126093001eucas1p23c2d5d589a0490fc19dde1be37250a00~dSFlxNW4I0738807388eucas1p2k; Thu, 26 Jan 2017 09:30:01 +0000 (GMT) X-AuditID: cbfec7f4-f79716d000006f65-18-5889c199caa4 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 8B.FC.06687.9D1C9885; Thu, 26 Jan 2017 09:31:05 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OKD007J9RPVXW40@eusync3.samsung.com>; Thu, 26 Jan 2017 09:30:01 +0000 (GMT) From: Marek Szyprowski To: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Linus Walleij , Tomasz Figa , Bartlomiej Zolnierkiewicz Subject: [PATCH v3 REBASED 09/13] pinctrl: samsung: Use generic of_device_get_match_data helper Date: Thu, 26 Jan 2017 10:29:23 +0100 Message-id: <1485422967-30643-6-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1485422967-30643-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrLIsWRmVeSWpSXmKPExsWy7djPc7ozD3ZGGKxdpWixccZ6Vovz5zew W0z5s5zJYtPja6wWm+f/YbT43HuE0WLG+X1MFmuP3GW3OPymnd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+sDYwbubsYOTkkBEwk Nn1fxARhi0lcuLeerYuRi0NIYAmjxNkfL1lAEkICTUwSeyZIg9hsAoYSXW+7wIpEBJoZJRqW 9II5zAITmCRmfmoAGyUskCjx7fU+MJtFQFXidEM3O4jNK+AhMfvwBzaIdXISJ49NZgWxOQU8 JfY3bWOH2DaRUeLo7OwJjLwLGBlWMYqklhbnpucWG+oVJ+YWl+al6yXn525iBAb9tmM/N+9g vLQx+BCjAAejEg/vgR0dEUKsiWXFlbmHGCU4mJVEeA/t64wQ4k1JrKxKLcqPLyrNSS0+xGgK dNREZinR5HxgROaVxBuaGJpbGhoZW1iYGxkpifOWfLgSLiSQnliSmp2aWpBaBNPHxMEp1cDI MEOgcefxcMsDUrcmnzUx3NbPuDiHdZGCctYHQ+c9iyyn/5+ybuWVXE+nM3Usb8okheUKM7Pd fjX5HFapNf0WcEB35WX/xFPT//i49Ectdt9/ZMe0r/U1z3jnnd3DNMMzxmtBwSr7wBnVd566 197vYDlz2etizUZh3uiJyRPKJe1Kd210+WetxFKckWioxVxUnAgAYTUylpACAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170126093001eucas1p23c2d5d589a0490fc19dde1be37250a00 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170126093001eucas1p23c2d5d589a0490fc19dde1be37250a00 X-RootMTR: 20170126093001eucas1p23c2d5d589a0490fc19dde1be37250a00 References: <1485422967-30643-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Replace custom code with generic helper. Signed-off-by: Marek Szyprowski Reviewed-by: Krzysztof Kozlowski Acked-by: Tomasz Figa --- drivers/pinctrl/samsung/pinctrl-samsung.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index 2803ae57f373..59f99ea7e65b 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -955,15 +956,12 @@ static int samsung_gpiolib_unregister(struct platform_device *pdev, return 0; } -static const struct of_device_id samsung_pinctrl_dt_match[]; - /* retrieve the soc specific data */ static const struct samsung_pin_ctrl * samsung_pinctrl_get_soc_data(struct samsung_pinctrl_drv_data *d, struct platform_device *pdev) { int id; - const struct of_device_id *match; struct device_node *node = pdev->dev.of_node; struct device_node *np; const struct samsung_pin_bank_data *bdata; @@ -978,8 +976,8 @@ static int samsung_gpiolib_unregister(struct platform_device *pdev, dev_err(&pdev->dev, "failed to get alias id\n"); return ERR_PTR(-ENOENT); } - match = of_match_node(samsung_pinctrl_dt_match, node); - ctrl = (struct samsung_pin_ctrl *)match->data + id; + ctrl = of_device_get_match_data(&pdev->dev); + ctrl += id; d->suspend = ctrl->suspend; d->resume = ctrl->resume; From patchwork Thu Jan 26 09:29:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 92506 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp96326qgi; Thu, 26 Jan 2017 01:30:35 -0800 (PST) X-Received: by 10.98.75.156 with SMTP id d28mr1994474pfj.59.1485423035240; Thu, 26 Jan 2017 01:30:35 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d65si912438pfl.73.2017.01.26.01.30.35; Thu, 26 Jan 2017 01:30:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-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-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753317AbdAZJac (ORCPT + 4 others); Thu, 26 Jan 2017 04:30:32 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:34105 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753262AbdAZJaG (ORCPT ); Thu, 26 Jan 2017 04:30:06 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OKD0072JRQ2DU70@mailout2.w1.samsung.com>; Thu, 26 Jan 2017 09:30:02 +0000 (GMT) Received: from eusmges3.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170126093002eucas1p23e781aecceea061b5e7abc863a328623~dSFm28Hhp0735707357eucas1p2j; Thu, 26 Jan 2017 09:30:02 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3.samsung.com (EUCPMTA) with SMTP id 87.A5.09557.991C9885; Thu, 26 Jan 2017 09:30:02 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170126093001eucas1p2531400b718191fd5fadd71d9f0c83597~dSFmNbVwi3033330333eucas1p2S; Thu, 26 Jan 2017 09:30:01 +0000 (GMT) X-AuditID: cbfec7f2-f790f6d000002555-8d-5889c1993882 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 5C.FC.06687.9D1C9885; Thu, 26 Jan 2017 09:31:05 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OKD007J9RPVXW40@eusync3.samsung.com>; Thu, 26 Jan 2017 09:30:01 +0000 (GMT) From: Marek Szyprowski To: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Linus Walleij , Tomasz Figa , Bartlomiej Zolnierkiewicz Subject: [PATCH v3 REBASED 10/13] pinctrl: samsung: Add infrastructure for pin-bank retention control Date: Thu, 26 Jan 2017 10:29:24 +0100 Message-id: <1485422967-30643-7-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1485422967-30643-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrDIsWRmVeSWpSXmKPExsWy7djPc7qzDnZGGBx0sNg4Yz2rxfnzG9gt pvxZzmSx6fE1VovN8/8wWnzuPcJoMeP8PiaLtUfuslscftPOarFq1x9GBy6PnbPusntsWtXJ 5nHn2h42j81L6j36tqxi9Pi8SS6ALYrLJiU1J7MstUjfLoEr4+Bvn4ImjYpfHxcyNTBuVuxi 5OSQEDCRuHN5JROELSZx4d56ti5GLg4hgaWMEt3XLjBCOJ8ZJS7vnsQG09F+9DcTRGIZo8Sq 4xOhWhqYJH4eXsQCUsUmYCjR9bYLLCEi0MwoMfPuXnYQh1mgj0ni8+a9jCBVwgLpEm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ECQ37bsZ+bdzBe 2hh8iFGAg1GJh/fAjo4IIdbEsuLK3EOMEhzMSiK8h/Z1RgjxpiRWVqUW5ccXleakFh9iNAU6 aiKzlGhyPjAe80riDU0MzS0NjYwtLMyNjJTEeUs+XAkXEkhPLEnNTk0tSC2C6WPi4JRqYIz/ Kv5h04dTistX5Uk4i5xdsefirSiF7UtTctbPtDnwxaRqxtPalzINV/nV+05lPf/+7jlXiOTm dz7Omh+29y3UqpyjwvCzvN9ex7Or1Ws932ulljDL9XyLC5fK2W6OP9HIpRlonGyxeovPPNHj 7H0aP/c0z/0ySbe+gj3miLDxhtuLnY7ZFCixFGckGmoxFxUnAgCnygpgjwIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170126093001eucas1p2531400b718191fd5fadd71d9f0c83597 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170126093001eucas1p2531400b718191fd5fadd71d9f0c83597 X-RootMTR: 20170126093001eucas1p2531400b718191fd5fadd71d9f0c83597 References: <1485422967-30643-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Pad retention control after suspend/resume cycle should be done from pin controller driver instead of PMU (power management unit) driver to avoid possible ordering and logical dependencies. Till now it worked fine only because PMU driver registered its sys_ops after pin controller. This patch adds infrastructure to handle pad retention during pin control driver resume. Signed-off-by: Marek Szyprowski Reviewed-by: Krzysztof Kozlowski Acked-by: Tomasz Figa --- drivers/pinctrl/samsung/pinctrl-samsung.c | 12 +++++++++ drivers/pinctrl/samsung/pinctrl-samsung.h | 42 +++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index 59f99ea7e65b..021abd7221f8 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -1060,6 +1060,13 @@ static int samsung_pinctrl_probe(struct platform_device *pdev) if (res) drvdata->irq = res->start; + if (ctrl->retention_data) { + drvdata->retention_ctrl = ctrl->retention_data->init(drvdata, + ctrl->retention_data); + if (IS_ERR(drvdata->retention_ctrl)) + return PTR_ERR(drvdata->retention_ctrl); + } + ret = samsung_gpiolib_register(pdev, drvdata); if (ret) return ret; @@ -1126,6 +1133,8 @@ static void samsung_pinctrl_suspend_dev( if (drvdata->suspend) drvdata->suspend(drvdata); + if (drvdata->retention_ctrl && drvdata->retention_ctrl->enable) + drvdata->retention_ctrl->enable(drvdata); } /** @@ -1173,6 +1182,9 @@ static void samsung_pinctrl_resume_dev(struct samsung_pinctrl_drv_data *drvdata) if (widths[type]) writel(bank->pm_save[type], reg + offs[type]); } + + if (drvdata->retention_ctrl && drvdata->retention_ctrl->disable) + drvdata->retention_ctrl->disable(drvdata); } /** diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.h b/drivers/pinctrl/samsung/pinctrl-samsung.h index 6f7ce7539a00..515a61035e54 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.h +++ b/drivers/pinctrl/samsung/pinctrl-samsung.h @@ -185,10 +185,48 @@ struct samsung_pin_bank { }; /** + * struct samsung_retention_data: runtime pin-bank retention control data. + * @regs: array of PMU registers to control pad retention. + * @nr_regs: number of registers in @regs array. + * @value: value to store to registers to turn off retention. + * @refcnt: atomic counter if retention control affects more than one bank. + * @priv: retention control code private data + * @enable: platform specific callback to enter retention mode. + * @disable: platform specific callback to exit retention mode. + **/ +struct samsung_retention_ctrl { + const u32 *regs; + int nr_regs; + u32 value; + atomic_t *refcnt; + void *priv; + void (*enable)(struct samsung_pinctrl_drv_data *); + void (*disable)(struct samsung_pinctrl_drv_data *); +}; + +/** + * struct samsung_retention_data: represent a pin-bank retention control data. + * @regs: array of PMU registers to control pad retention. + * @nr_regs: number of registers in @regs array. + * @value: value to store to registers to turn off retention. + * @refcnt: atomic counter if retention control affects more than one bank. + * @init: platform specific callback to initialize retention control. + **/ +struct samsung_retention_data { + const u32 *regs; + int nr_regs; + u32 value; + atomic_t *refcnt; + struct samsung_retention_ctrl *(*init)(struct samsung_pinctrl_drv_data *, + const struct samsung_retention_data *); +}; + +/** * struct samsung_pin_ctrl: represent a pin controller. * @pin_banks: list of pin banks included in this controller. * @nr_banks: number of pin banks. * @nr_ext_resources: number of the extra base address for pin banks. + * @retention_data: configuration data for retention control. * @eint_gpio_init: platform specific callback to setup the external gpio * interrupts for the controller. * @eint_wkup_init: platform specific callback to setup the external wakeup @@ -198,6 +236,7 @@ struct samsung_pin_ctrl { const struct samsung_pin_bank_data *pin_banks; u32 nr_banks; int nr_ext_resources; + const struct samsung_retention_data *retention_data; int (*eint_gpio_init)(struct samsung_pinctrl_drv_data *); int (*eint_wkup_init)(struct samsung_pinctrl_drv_data *); @@ -219,6 +258,7 @@ struct samsung_pin_ctrl { * @nr_function: number of such pin functions. * @pin_base: starting system wide pin number. * @nr_pins: number of pins supported by the controller. + * @retention_ctrl: retention control runtime data. */ struct samsung_pinctrl_drv_data { struct list_head node; @@ -238,6 +278,8 @@ struct samsung_pinctrl_drv_data { unsigned int pin_base; unsigned int nr_pins; + struct samsung_retention_ctrl *retention_ctrl; + void (*suspend)(struct samsung_pinctrl_drv_data *); void (*resume)(struct samsung_pinctrl_drv_data *); }; From patchwork Thu Jan 26 09:29:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 92503 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp96247qgi; Thu, 26 Jan 2017 01:30:22 -0800 (PST) X-Received: by 10.84.231.9 with SMTP id f9mr2814795plk.28.1485423022691; Thu, 26 Jan 2017 01:30:22 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 197si25983013pgd.70.2017.01.26.01.30.22; Thu, 26 Jan 2017 01:30:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-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-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753280AbdAZJaT (ORCPT + 4 others); Thu, 26 Jan 2017 04:30:19 -0500 Received: from mailout4.w1.samsung.com ([210.118.77.14]:46621 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753088AbdAZJaI (ORCPT ); Thu, 26 Jan 2017 04:30:08 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OKD0081ZRQ3HX70@mailout4.w1.samsung.com>; Thu, 26 Jan 2017 09:30:03 +0000 (GMT) Received: from eusmges4.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170126093002eucas1p1cc4753414783f3255278c5a3c0a42484~dSFneIcqX1383013830eucas1p1p; Thu, 26 Jan 2017 09:30:02 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges4.samsung.com (EUCPMTA) with SMTP id A3.7D.28517.A91C9885; Thu, 26 Jan 2017 09:30:02 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170126093002eucas1p1d2c86542c56bd54d78852693f9ddb0b2~dSFm34wQj2396023960eucas1p1l; Thu, 26 Jan 2017 09:30:02 +0000 (GMT) X-AuditID: cbfec7f4-f79716d000006f65-1d-5889c19ac8ef Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id CE.1C.10233.791C9885; Thu, 26 Jan 2017 09:29:59 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OKD007J9RPVXW40@eusync3.samsung.com>; Thu, 26 Jan 2017 09:30:01 +0000 (GMT) From: Marek Szyprowski To: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Linus Walleij , Tomasz Figa , Bartlomiej Zolnierkiewicz Subject: [PATCH v3 REBASED 11/13] pinctrl: samsung: Move retention control from mach-exynos to the pinctrl driver Date: Thu, 26 Jan 2017 10:29:25 +0100 Message-id: <1485422967-30643-8-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1485422967-30643-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrFIsWRmVeSWpSXmKPExsWy7djP87qzDnZGGBzerWGxccZ6Vovz5zew W0z5s5zJYtPja6wWm+f/YbT43HuE0WLG+X1MFmuP3GW3OPymndVi1a4/jA5cHjtn3WX32LSq k83jzrU9bB6bl9R79G1Z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lcuLeerYuRi0NIYAmjROft/WAJIYEmJok9E6RBbDYBQ4mut11gRSICzYwSDUt6 wRxmgQlMEjM/NTCBVAkLFEt8P3+CGcRmEVCVmDR1A5jNK+AhMePwNmaIdXISJ49NZgWxOQU8 JfY3bWOH2DaRUeLo7OwJjLwLGBlWMYqklhbnpucWG+kVJ+YWl+al6yXn525iBAb9tmM/t+xg 7HoXfIhRgINRiYc3Y1tHhBBrYllxZe4hRgkOZiUR3kP7OiOEeFMSK6tSi/Lji0pzUosPMZoC HTWRWUo0OR8YkXkl8YYmhuaWhkbGFhbmRkZK4rxTP1wJFxJITyxJzU5NLUgtgulj4uCUamC0 WBNcEm4094Eq++xjYTqaG35phW2LkyjUapstckCgpXx1xblXXsptRySuC5aUrm3J9wxg8Isu /i/1qkzmxNqYWI/5Cq3c61Men93YMX9xdvfnOLf9SS96Z+wXmdO1R9y72WGf9ORTDA83Ofy1 +pfj1/dE1cj39JVFtza1/Hd+k10mxfr2Z6cSS3FGoqEWc1FxIgDby2jxkAIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170126093002eucas1p1d2c86542c56bd54d78852693f9ddb0b2 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170126093002eucas1p1d2c86542c56bd54d78852693f9ddb0b2 X-RootMTR: 20170126093002eucas1p1d2c86542c56bd54d78852693f9ddb0b2 References: <1485422967-30643-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org This patch moves pad retention control from PMU driver to Exynos pin controller driver. This helps to avoid possible ordering and logical dependencies between machine, PMU and pin control code. Till now it worked fine only because sys_ops for PMU and pin controller were called in registration order. This is also a preparation for adding new features to Exynos pin controller driver, like runtime power management and suspending individual pin controllers, which might be a part of some power domain. Signed-off-by: Marek Szyprowski Reviewed-by: Krzysztof Kozlowski Acked-by: Tomasz Figa --- arch/arm/mach-exynos/suspend.c | 64 -------------- drivers/pinctrl/samsung/pinctrl-exynos.c | 145 +++++++++++++++++++++++++++++++ 2 files changed, 145 insertions(+), 64 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/mach-exynos/suspend.c b/arch/arm/mach-exynos/suspend.c index 06332f626565..10bc753624be 100644 --- a/arch/arm/mach-exynos/suspend.c +++ b/arch/arm/mach-exynos/suspend.c @@ -57,7 +57,6 @@ struct exynos_wkup_irq { struct exynos_pm_data { const struct exynos_wkup_irq *wkup_irq; unsigned int wake_disable_mask; - unsigned int *release_ret_regs; void (*pm_prepare)(void); void (*pm_resume_prepare)(void); @@ -95,47 +94,6 @@ struct exynos_pm_data { { /* sentinel */ }, }; -static unsigned int exynos_release_ret_regs[] = { - S5P_PAD_RET_MAUDIO_OPTION, - S5P_PAD_RET_GPIO_OPTION, - S5P_PAD_RET_UART_OPTION, - S5P_PAD_RET_MMCA_OPTION, - S5P_PAD_RET_MMCB_OPTION, - S5P_PAD_RET_EBIA_OPTION, - S5P_PAD_RET_EBIB_OPTION, - REG_TABLE_END, -}; - -static unsigned int exynos3250_release_ret_regs[] = { - S5P_PAD_RET_MAUDIO_OPTION, - S5P_PAD_RET_GPIO_OPTION, - S5P_PAD_RET_UART_OPTION, - S5P_PAD_RET_MMCA_OPTION, - S5P_PAD_RET_MMCB_OPTION, - S5P_PAD_RET_EBIA_OPTION, - S5P_PAD_RET_EBIB_OPTION, - S5P_PAD_RET_MMC2_OPTION, - S5P_PAD_RET_SPI_OPTION, - REG_TABLE_END, -}; - -static unsigned int exynos5420_release_ret_regs[] = { - EXYNOS_PAD_RET_DRAM_OPTION, - EXYNOS_PAD_RET_MAUDIO_OPTION, - EXYNOS_PAD_RET_JTAG_OPTION, - EXYNOS5420_PAD_RET_GPIO_OPTION, - EXYNOS5420_PAD_RET_UART_OPTION, - EXYNOS5420_PAD_RET_MMCA_OPTION, - EXYNOS5420_PAD_RET_MMCB_OPTION, - EXYNOS5420_PAD_RET_MMCC_OPTION, - EXYNOS5420_PAD_RET_HSI_OPTION, - EXYNOS_PAD_RET_EBIA_OPTION, - EXYNOS_PAD_RET_EBIB_OPTION, - EXYNOS5420_PAD_RET_SPI_OPTION, - EXYNOS5420_PAD_RET_DRAM_COREBLK_OPTION, - REG_TABLE_END, -}; - static int exynos_irq_set_wake(struct irq_data *data, unsigned int state) { const struct exynos_wkup_irq *wkup_irq; @@ -442,15 +400,6 @@ static int exynos5420_pm_suspend(void) return 0; } -static void exynos_pm_release_retention(void) -{ - unsigned int i; - - for (i = 0; (pm_data->release_ret_regs[i] != REG_TABLE_END); i++) - pmu_raw_writel(EXYNOS_WAKEUP_FROM_LOWPWR, - pm_data->release_ret_regs[i]); -} - static void exynos_pm_resume(void) { u32 cpuid = read_cpuid_part(); @@ -458,9 +407,6 @@ static void exynos_pm_resume(void) if (exynos_pm_central_resume()) goto early_wakeup; - /* For release retention */ - exynos_pm_release_retention(); - if (cpuid == ARM_CPU_PART_CORTEX_A9) scu_enable(S5P_VA_SCU); @@ -482,9 +428,6 @@ static void exynos3250_pm_resume(void) if (exynos_pm_central_resume()) goto early_wakeup; - /* For release retention */ - exynos_pm_release_retention(); - pmu_raw_writel(S5P_USE_STANDBY_WFI_ALL, S5P_CENTRAL_SEQ_OPTION); if (call_firmware_op(resume) == -ENOSYS @@ -522,9 +465,6 @@ static void exynos5420_pm_resume(void) if (exynos_pm_central_resume()) goto early_wakeup; - /* For release retention */ - exynos_pm_release_retention(); - pmu_raw_writel(exynos_pmu_spare3, S5P_PMU_SPARE3); early_wakeup: @@ -637,7 +577,6 @@ static void exynos_suspend_finish(void) static const struct exynos_pm_data exynos3250_pm_data = { .wkup_irq = exynos3250_wkup_irq, .wake_disable_mask = ((0xFF << 8) | (0x1F << 1)), - .release_ret_regs = exynos3250_release_ret_regs, .pm_suspend = exynos_pm_suspend, .pm_resume = exynos3250_pm_resume, .pm_prepare = exynos3250_pm_prepare, @@ -647,7 +586,6 @@ static void exynos_suspend_finish(void) static const struct exynos_pm_data exynos4_pm_data = { .wkup_irq = exynos4_wkup_irq, .wake_disable_mask = ((0xFF << 8) | (0x1F << 1)), - .release_ret_regs = exynos_release_ret_regs, .pm_suspend = exynos_pm_suspend, .pm_resume = exynos_pm_resume, .pm_prepare = exynos_pm_prepare, @@ -657,7 +595,6 @@ static void exynos_suspend_finish(void) static const struct exynos_pm_data exynos5250_pm_data = { .wkup_irq = exynos5250_wkup_irq, .wake_disable_mask = ((0xFF << 8) | (0x1F << 1)), - .release_ret_regs = exynos_release_ret_regs, .pm_suspend = exynos_pm_suspend, .pm_resume = exynos_pm_resume, .pm_prepare = exynos_pm_prepare, @@ -667,7 +604,6 @@ static void exynos_suspend_finish(void) static const struct exynos_pm_data exynos5420_pm_data = { .wkup_irq = exynos5250_wkup_irq, .wake_disable_mask = (0x7F << 7) | (0x1F << 1), - .release_ret_regs = exynos5420_release_ret_regs, .pm_resume_prepare = exynos5420_prepare_pm_resume, .pm_resume = exynos5420_pm_resume, .pm_suspend = exynos5420_pm_suspend, diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c index 53baafdad51b..c81df3c843c3 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos.c @@ -28,7 +28,10 @@ #include #include #include +#include #include +#include +#include #include "pinctrl-samsung.h" #include "pinctrl-exynos.h" @@ -679,6 +682,54 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) }, }; +/* Pad retention control code for accessing PMU regmap */ +static atomic_t exynos_shared_retention_refcnt; + +static void exynos_retention_enable(struct samsung_pinctrl_drv_data *drvdata) +{ + if (drvdata->retention_ctrl->refcnt) + atomic_inc(drvdata->retention_ctrl->refcnt); +} + +static void exynos_retention_disable(struct samsung_pinctrl_drv_data *drvdata) +{ + struct samsung_retention_ctrl *ctrl = drvdata->retention_ctrl; + struct regmap *pmu_regs = ctrl->priv; + int i; + + if (ctrl->refcnt && !atomic_dec_and_test(ctrl->refcnt)) + return; + + for (i = 0; i < ctrl->nr_regs; i++) + regmap_write(pmu_regs, ctrl->regs[i], ctrl->value); +} + +static struct samsung_retention_ctrl * +exynos_retention_init(struct samsung_pinctrl_drv_data *drvdata, + const struct samsung_retention_data *data) +{ + struct samsung_retention_ctrl *ctrl; + struct regmap *pmu_regs; + + ctrl = devm_kzalloc(drvdata->dev, sizeof(*ctrl), GFP_KERNEL); + if (!ctrl) + return ERR_PTR(-ENOMEM); + + pmu_regs = exynos_get_pmu_regmap(); + if (IS_ERR(pmu_regs)) + return ERR_CAST(pmu_regs); + + ctrl->priv = pmu_regs; + ctrl->regs = data->regs; + ctrl->nr_regs = data->nr_regs; + ctrl->value = data->value; + ctrl->refcnt = data->refcnt; + ctrl->enable = exynos_retention_enable; + ctrl->disable = exynos_retention_disable; + + return ctrl; +} + /* pin banks of exynos3250 pin-controller 0 */ static const struct samsung_pin_bank_data exynos3250_pin_banks0[] __initconst = { EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00), @@ -711,6 +762,30 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) }; /* + * PMU pad retention groups for Exynos3250 doesn't match pin banks, so handle + * them all together + */ +static const u32 exynos3250_retention_regs[] = { + S5P_PAD_RET_MAUDIO_OPTION, + S5P_PAD_RET_GPIO_OPTION, + S5P_PAD_RET_UART_OPTION, + S5P_PAD_RET_MMCA_OPTION, + S5P_PAD_RET_MMCB_OPTION, + S5P_PAD_RET_EBIA_OPTION, + S5P_PAD_RET_EBIB_OPTION, + S5P_PAD_RET_MMC2_OPTION, + S5P_PAD_RET_SPI_OPTION, +}; + +static const struct samsung_retention_data exynos3250_retention_data __initconst = { + .regs = exynos3250_retention_regs, + .nr_regs = ARRAY_SIZE(exynos3250_retention_regs), + .value = EXYNOS_WAKEUP_FROM_LOWPWR, + .refcnt = &exynos_shared_retention_refcnt, + .init = exynos_retention_init, +}; + +/* * Samsung pinctrl driver data for Exynos3250 SoC. Exynos3250 SoC includes * two gpio/pin-mux/pinconfig controllers. */ @@ -722,6 +797,7 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) .eint_gpio_init = exynos_eint_gpio_init, .suspend = exynos_pinctrl_suspend, .resume = exynos_pinctrl_resume, + .retention_data = &exynos3250_retention_data, }, { /* pin-controller instance 1 data */ .pin_banks = exynos3250_pin_banks1, @@ -730,6 +806,7 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) .eint_wkup_init = exynos_eint_wkup_init, .suspend = exynos_pinctrl_suspend, .resume = exynos_pinctrl_resume, + .retention_data = &exynos3250_retention_data, }, }; @@ -782,6 +859,36 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) EXYNOS_PIN_BANK_EINTN(7, 0x000, "gpz"), }; +/* PMU pad retention groups registers for Exynos4 (without audio) */ +static const u32 exynos4_retention_regs[] = { + S5P_PAD_RET_GPIO_OPTION, + S5P_PAD_RET_UART_OPTION, + S5P_PAD_RET_MMCA_OPTION, + S5P_PAD_RET_MMCB_OPTION, + S5P_PAD_RET_EBIA_OPTION, + S5P_PAD_RET_EBIB_OPTION, +}; + +static const struct samsung_retention_data exynos4_retention_data __initconst = { + .regs = exynos4_retention_regs, + .nr_regs = ARRAY_SIZE(exynos4_retention_regs), + .value = EXYNOS_WAKEUP_FROM_LOWPWR, + .refcnt = &exynos_shared_retention_refcnt, + .init = exynos_retention_init, +}; + +/* PMU retention control for audio pins can be tied to audio pin bank */ +static const u32 exynos4_audio_retention_regs[] = { + S5P_PAD_RET_MAUDIO_OPTION, +}; + +static const struct samsung_retention_data exynos4_audio_retention_data __initconst = { + .regs = exynos4_audio_retention_regs, + .nr_regs = ARRAY_SIZE(exynos4_audio_retention_regs), + .value = EXYNOS_WAKEUP_FROM_LOWPWR, + .init = exynos_retention_init, +}; + /* * Samsung pinctrl driver data for Exynos4210 SoC. Exynos4210 SoC includes * three gpio/pin-mux/pinconfig controllers. @@ -794,6 +901,7 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) .eint_gpio_init = exynos_eint_gpio_init, .suspend = exynos_pinctrl_suspend, .resume = exynos_pinctrl_resume, + .retention_data = &exynos4_retention_data, }, { /* pin-controller instance 1 data */ .pin_banks = exynos4210_pin_banks1, @@ -802,10 +910,12 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) .eint_wkup_init = exynos_eint_wkup_init, .suspend = exynos_pinctrl_suspend, .resume = exynos_pinctrl_resume, + .retention_data = &exynos4_retention_data, }, { /* pin-controller instance 2 data */ .pin_banks = exynos4210_pin_banks2, .nr_banks = ARRAY_SIZE(exynos4210_pin_banks2), + .retention_data = &exynos4_audio_retention_data, }, }; @@ -879,6 +989,7 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) .eint_gpio_init = exynos_eint_gpio_init, .suspend = exynos_pinctrl_suspend, .resume = exynos_pinctrl_resume, + .retention_data = &exynos4_retention_data, }, { /* pin-controller instance 1 data */ .pin_banks = exynos4x12_pin_banks1, @@ -887,6 +998,7 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) .eint_wkup_init = exynos_eint_wkup_init, .suspend = exynos_pinctrl_suspend, .resume = exynos_pinctrl_resume, + .retention_data = &exynos4_retention_data, }, { /* pin-controller instance 2 data */ .pin_banks = exynos4x12_pin_banks2, @@ -894,6 +1006,7 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) .eint_gpio_init = exynos_eint_gpio_init, .suspend = exynos_pinctrl_suspend, .resume = exynos_pinctrl_resume, + .retention_data = &exynos4_audio_retention_data, }, { /* pin-controller instance 3 data */ .pin_banks = exynos4x12_pin_banks3, @@ -973,6 +1086,7 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) .eint_wkup_init = exynos_eint_wkup_init, .suspend = exynos_pinctrl_suspend, .resume = exynos_pinctrl_resume, + .retention_data = &exynos4_retention_data, }, { /* pin-controller instance 1 data */ .pin_banks = exynos5250_pin_banks1, @@ -980,6 +1094,7 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) .eint_gpio_init = exynos_eint_gpio_init, .suspend = exynos_pinctrl_suspend, .resume = exynos_pinctrl_resume, + .retention_data = &exynos4_retention_data, }, { /* pin-controller instance 2 data */ .pin_banks = exynos5250_pin_banks2, @@ -994,6 +1109,7 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) .eint_gpio_init = exynos_eint_gpio_init, .suspend = exynos_pinctrl_suspend, .resume = exynos_pinctrl_resume, + .retention_data = &exynos4_audio_retention_data, }, }; @@ -1220,6 +1336,30 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) EXYNOS_PIN_BANK_EINTG(7, 0x000, "gpz", 0x00), }; +/* PMU pad retention groups registers for Exynos5420 (without audio) */ +static const u32 exynos5420_retention_regs[] = { + EXYNOS_PAD_RET_DRAM_OPTION, + EXYNOS_PAD_RET_JTAG_OPTION, + EXYNOS5420_PAD_RET_GPIO_OPTION, + EXYNOS5420_PAD_RET_UART_OPTION, + EXYNOS5420_PAD_RET_MMCA_OPTION, + EXYNOS5420_PAD_RET_MMCB_OPTION, + EXYNOS5420_PAD_RET_MMCC_OPTION, + EXYNOS5420_PAD_RET_HSI_OPTION, + EXYNOS_PAD_RET_EBIA_OPTION, + EXYNOS_PAD_RET_EBIB_OPTION, + EXYNOS5420_PAD_RET_SPI_OPTION, + EXYNOS5420_PAD_RET_DRAM_COREBLK_OPTION, +}; + +static const struct samsung_retention_data exynos5420_retention_data __initconst = { + .regs = exynos5420_retention_regs, + .nr_regs = ARRAY_SIZE(exynos5420_retention_regs), + .value = EXYNOS_WAKEUP_FROM_LOWPWR, + .refcnt = &exynos_shared_retention_refcnt, + .init = exynos_retention_init, +}; + /* * Samsung pinctrl driver data for Exynos5420 SoC. Exynos5420 SoC includes * four gpio/pin-mux/pinconfig controllers. @@ -1231,26 +1371,31 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) .nr_banks = ARRAY_SIZE(exynos5420_pin_banks0), .eint_gpio_init = exynos_eint_gpio_init, .eint_wkup_init = exynos_eint_wkup_init, + .retention_data = &exynos5420_retention_data, }, { /* pin-controller instance 1 data */ .pin_banks = exynos5420_pin_banks1, .nr_banks = ARRAY_SIZE(exynos5420_pin_banks1), .eint_gpio_init = exynos_eint_gpio_init, + .retention_data = &exynos5420_retention_data, }, { /* pin-controller instance 2 data */ .pin_banks = exynos5420_pin_banks2, .nr_banks = ARRAY_SIZE(exynos5420_pin_banks2), .eint_gpio_init = exynos_eint_gpio_init, + .retention_data = &exynos5420_retention_data, }, { /* pin-controller instance 3 data */ .pin_banks = exynos5420_pin_banks3, .nr_banks = ARRAY_SIZE(exynos5420_pin_banks3), .eint_gpio_init = exynos_eint_gpio_init, + .retention_data = &exynos5420_retention_data, }, { /* pin-controller instance 4 data */ .pin_banks = exynos5420_pin_banks4, .nr_banks = ARRAY_SIZE(exynos5420_pin_banks4), .eint_gpio_init = exynos_eint_gpio_init, + .retention_data = &exynos4_audio_retention_data, }, }; From patchwork Thu Jan 26 09:29:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 92504 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp96255qgi; Thu, 26 Jan 2017 01:30:23 -0800 (PST) X-Received: by 10.98.48.66 with SMTP id w63mr1929402pfw.179.1485423023818; Thu, 26 Jan 2017 01:30:23 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 197si25983013pgd.70.2017.01.26.01.30.23; Thu, 26 Jan 2017 01:30:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-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-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753290AbdAZJaW (ORCPT + 4 others); Thu, 26 Jan 2017 04:30:22 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:26843 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753229AbdAZJaI (ORCPT ); Thu, 26 Jan 2017 04:30:08 -0500 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OKD0063SRQ3KE70@mailout1.w1.samsung.com>; Thu, 26 Jan 2017 09:30:03 +0000 (GMT) Received: from eusmges1.samsung.com (unknown [203.254.199.239]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170126093003eucas1p2e54e04daa556f89499584ab18ad9f3c8~dSFnvs6UU1106611066eucas1p2P; Thu, 26 Jan 2017 09:30:03 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1.samsung.com (EUCPMTA) with SMTP id 59.A0.16908.D91C9885; Thu, 26 Jan 2017 09:30:05 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20170126093002eucas1p242ce2fc9c907f515d60e353076bf8214~dSFnH195D1106611066eucas1p2O; Thu, 26 Jan 2017 09:30:02 +0000 (GMT) X-AuditID: cbfec7ef-f79d26d00000420c-cd-5889c19d5892 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 0D.FC.06687.AD1C9885; Thu, 26 Jan 2017 09:31:06 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OKD007J9RPVXW40@eusync3.samsung.com>; Thu, 26 Jan 2017 09:30:02 +0000 (GMT) From: Marek Szyprowski To: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Linus Walleij , Tomasz Figa , Bartlomiej Zolnierkiewicz Subject: [PATCH v3 REBASED 12/13] pinctrl: samsung: Move retention control from mach-s5pv210 to the pinctrl driver Date: Thu, 26 Jan 2017 10:29:26 +0100 Message-id: <1485422967-30643-9-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1485422967-30643-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrFIsWRmVeSWpSXmKPExsWy7djPc7pzD3ZGGHxeo2qxccZ6Vovz5zew W0z5s5zJYtPja6wWm+f/YbT43HuE0WLG+X1MFmuP3GW3OPymndVi1a4/jA5cHjtn3WX32LSq k83jzrU9bB6bl9R79G1ZxejxeZNcAFsUl01Kak5mWWqRvl0CV8btmy/ZC/4rVdyeuoq9gXGv bBcjJ4eEgInE4W2tjBC2mMSFe+vZuhi5O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YzSKgKvF+1jtWEJtXwEOiYd0jRoh9chInj00Gi3MK eErsb9rGDmILCUxklDg6O3sCI+8CRoZVjCKppcW56bnFhnrFibnFpXnpesn5uZsYgUG/7djP zTsYL20MPsQowMGoxMN7YEdHhBBrYllxZe4hRgkOZiUR3kP7OiOEeFMSK6tSi/Lji0pzUosP MZoCHTWRWUo0OR8YkXkl8YYmhuaWhkbGFhbmRkZK4rwlH66ECwmkJ5akZqemFqQWwfQxcXBK NTDKxPTtY9vQvNg/sPvUd0PJzHVeU6ev+3cxqOWXQ94j7a05hVPi3DRPme0/svyvze2D1lY2 e6P/XLZcclMsls9GqCFGf47phgdKwm+/PVH3ryxZqrTvdP/yoB2eAhWTFr0usCl4t6u0Kdlg 8iuNORqOre1WE6zmxjNM2mg85UlqvoOYVtNU9W1KLMUZiYZazEXFiQAB0J2JkAIAAA== X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170126093002eucas1p242ce2fc9c907f515d60e353076bf8214 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170126093002eucas1p242ce2fc9c907f515d60e353076bf8214 X-RootMTR: 20170126093002eucas1p242ce2fc9c907f515d60e353076bf8214 References: <1485422967-30643-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org This patch moves pad retention control from S5PV210 machine code to Exynos pin controller driver. This helps to avoid possible ordering and logical dependencies between machine and pin control code. Till now it worked fine only because sys_ops for machine code and pin controller were called in registration order. Signed-off-by: Marek Szyprowski Acked-by: Tomasz Figa For mach-s5pv210: Acked-by: Krzysztof Kozlowski --- arch/arm/mach-s5pv210/pm.c | 7 ---- arch/arm/mach-s5pv210/regs-clock.h | 4 --- drivers/pinctrl/samsung/pinctrl-exynos.c | 56 ++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 11 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/mach-s5pv210/pm.c b/arch/arm/mach-s5pv210/pm.c index 21b4b13c5ab7..7d69666de5ba 100644 --- a/arch/arm/mach-s5pv210/pm.c +++ b/arch/arm/mach-s5pv210/pm.c @@ -155,13 +155,6 @@ static void s5pv210_suspend_finish(void) */ static void s5pv210_pm_resume(void) { - u32 tmp; - - tmp = __raw_readl(S5P_OTHERS); - tmp |= (S5P_OTHERS_RET_IO | S5P_OTHERS_RET_CF |\ - S5P_OTHERS_RET_MMC | S5P_OTHERS_RET_UART); - __raw_writel(tmp , S5P_OTHERS); - s3c_pm_do_restore_core(s5pv210_core_save, ARRAY_SIZE(s5pv210_core_save)); } diff --git a/arch/arm/mach-s5pv210/regs-clock.h b/arch/arm/mach-s5pv210/regs-clock.h index 4640f0f03c12..fb3eb77412db 100644 --- a/arch/arm/mach-s5pv210/regs-clock.h +++ b/arch/arm/mach-s5pv210/regs-clock.h @@ -188,10 +188,6 @@ #define S5P_SLEEP_CFG_USBOSC_EN (1 << 1) /* OTHERS Resgister */ -#define S5P_OTHERS_RET_IO (1 << 31) -#define S5P_OTHERS_RET_CF (1 << 30) -#define S5P_OTHERS_RET_MMC (1 << 29) -#define S5P_OTHERS_RET_UART (1 << 28) #define S5P_OTHERS_USB_SIG_MASK (1 << 16) /* S5P_DAC_CONTROL */ diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c index c81df3c843c3..f16f52ab4912 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -632,6 +633,60 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) exynos_pinctrl_resume_bank(drvdata, bank); } +/* Retention control for S5PV210 are located at the end of clock controller */ +#define S5P_OTHERS 0xE000 + +#define S5P_OTHERS_RET_IO (1 << 31) +#define S5P_OTHERS_RET_CF (1 << 30) +#define S5P_OTHERS_RET_MMC (1 << 29) +#define S5P_OTHERS_RET_UART (1 << 28) + +static void s5pv210_retention_disable(struct samsung_pinctrl_drv_data *drvdata) +{ + void *clk_base = drvdata->retention_ctrl->priv; + u32 tmp; + + tmp = __raw_readl(clk_base + S5P_OTHERS); + tmp |= (S5P_OTHERS_RET_IO | S5P_OTHERS_RET_CF | S5P_OTHERS_RET_MMC | + S5P_OTHERS_RET_UART); + __raw_writel(tmp, clk_base + S5P_OTHERS); +} + +static struct samsung_retention_ctrl * +s5pv210_retention_init(struct samsung_pinctrl_drv_data *drvdata, + const struct samsung_retention_data *data) +{ + struct samsung_retention_ctrl *ctrl; + struct device_node *np; + void *clk_base; + + ctrl = devm_kzalloc(drvdata->dev, sizeof(*ctrl), GFP_KERNEL); + if (!ctrl) + return ERR_PTR(-ENOMEM); + + np = of_find_compatible_node(NULL, NULL, "samsung,s5pv210-clock"); + if (!np) { + pr_err("%s: failed to find clock controller DT node\n", + __func__); + return ERR_PTR(-ENODEV); + } + + clk_base = of_iomap(np, 0); + if (!clk_base) { + pr_err("%s: failed to map clock registers\n", __func__); + return ERR_PTR(-EINVAL); + } + + ctrl->priv = clk_base; + ctrl->disable = s5pv210_retention_disable; + + return ctrl; +} + +static const struct samsung_retention_data s5pv210_retention_data __initconst = { + .init = s5pv210_retention_init, +}; + /* pin banks of s5pv210 pin-controller */ static const struct samsung_pin_bank_data s5pv210_pin_bank[] __initconst = { EXYNOS_PIN_BANK_EINTG(8, 0x000, "gpa0", 0x00), @@ -679,6 +734,7 @@ static void exynos_pinctrl_resume(struct samsung_pinctrl_drv_data *drvdata) .eint_wkup_init = exynos_eint_wkup_init, .suspend = exynos_pinctrl_suspend, .resume = exynos_pinctrl_resume, + .retention_data = &s5pv210_retention_data, }, }; From patchwork Thu Jan 26 09:29:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 92505 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp96311qgi; Thu, 26 Jan 2017 01:30:32 -0800 (PST) X-Received: by 10.84.142.101 with SMTP id 92mr2744002plw.66.1485423032770; Thu, 26 Jan 2017 01:30:32 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l187si882217pfc.285.2017.01.26.01.30.32; Thu, 26 Jan 2017 01:30:32 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-gpio-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-gpio-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-gpio-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753260AbdAZJa3 (ORCPT + 4 others); Thu, 26 Jan 2017 04:30:29 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:26843 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753317AbdAZJaL (ORCPT ); Thu, 26 Jan 2017 04:30:11 -0500 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OKD0063URQ4KE70@mailout1.w1.samsung.com>; Thu, 26 Jan 2017 09:30:04 +0000 (GMT) Received: from eusmges4.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170126093003eucas1p141385225420838de160c5f9460c22b3e~dSFodIast2397223972eucas1p1p; Thu, 26 Jan 2017 09:30:03 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges4.samsung.com (EUCPMTA) with SMTP id 64.7D.28517.B91C9885; Thu, 26 Jan 2017 09:30:03 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20170126093003eucas1p1e63fcbad90361f6ccf90fe07da897823~dSFnzyVyA1381013810eucas1p15; Thu, 26 Jan 2017 09:30:03 +0000 (GMT) X-AuditID: cbfec7f4-f79716d000006f65-1e-5889c19b50fd Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id D0.2C.10233.891C9885; Thu, 26 Jan 2017 09:30:00 +0000 (GMT) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OKD007J9RPVXW40@eusync3.samsung.com>; Thu, 26 Jan 2017 09:30:02 +0000 (GMT) From: Marek Szyprowski To: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-samsung-soc@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Krzysztof Kozlowski , Linus Walleij , Tomasz Figa , Bartlomiej Zolnierkiewicz Subject: [PATCH v3 REBASED 13/13] pinctrl: samsung: Replace syscore ops with standard platform device pm_ops Date: Thu, 26 Jan 2017 10:29:27 +0100 Message-id: <1485422967-30643-10-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1485422967-30643-1-git-send-email-m.sz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rJbHH7TzmqxatcfRgcuj52z7rJ7bFrV yeZx59oeNo/NS+o9+rasYvT4vEkugC3KzSYjNTEltUghNS85PyUzL91WKTTETddCSSEvMTfV VilC1zckSEmhLDGnFMgzMkADDs4B7sFK+nYJbhnPJt9jLfiuUXFr5Q6mBsZepS5GTg4JAROJ z5e72CFsMYkL99azdTFycQgJLGGUaPr/lhHCaWKSmDFpDxtIFZuAoUTX2y6wKhGBZkaJhiW9 YA6zwAQmiZmfGphAqoQF8iQ2TTwNNpdFQFWi780hVhCbV8BToufBTCaIfXISJ49NBotzAsX3 N20DqxcSmMgocXR29gRG3gWMDKsYRVJLi3PTc4uN9IoTc4tL89L1kvNzNzECw37bsZ9bdjB2 vQs+xCjAwajEw5uxrSNCiDWxrLgy9xCjBAezkgjvoX2dEUK8KYmVValF+fFFpTmpxYcYTYGO msgsJZqcD4zJvJJ4QxNDc0tDI2MLC3MjIyVx3qkfroQLCaQnlqRmp6YWpBbB9DFxcEo1MPKU Z3xSeF/6YeK+S531F4777ykLUW6U0ZLg+/hpfd/Xc/KBq5e95bnaeqHoyeFVRVz3X55YZc+3 6fw+vSYb5Z1ftOdIHHYOLZ56Y1F27pOjy1pebY85OS9ue8O+X2K8df/Y9Pj/CU9Xdl3Y81Tq g4jRVKsplx68FD8V6nttZlXEicIrWo9u8OQqsRRnJBpqMRcVJwIAqvLhM5ECAAA= X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170126093003eucas1p1e63fcbad90361f6ccf90fe07da897823 X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1B?= =?utf-8?b?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?utf-8?q?Marek_Szyprowski=1BSRPOL-Kernel_=28TP=29=1BSam?= =?utf-8?q?sung_Electronics=1BSenior_Software_Engineer?= X-Sender-Code: =?utf-8?q?C10=1BEHQ=1BC10CD02CD027392?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170126093003eucas1p1e63fcbad90361f6ccf90fe07da897823 X-RootMTR: 20170126093003eucas1p1e63fcbad90361f6ccf90fe07da897823 References: <1485422967-30643-1-git-send-email-m.szyprowski@samsung.com> Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Once the dependency on PMU driver (for pad retention control) has been removed, there is no reason to use syscore_ops based suspend/resume. This patch replaces it with standard platform device pm_ops based solution. Signed-off-by: Marek Szyprowski Reviewed-by: Krzysztof Kozlowski Acked-by: Tomasz Figa --- drivers/pinctrl/samsung/pinctrl-samsung.c | 72 ++++++------------------------- 1 file changed, 14 insertions(+), 58 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-gpio" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pinctrl/samsung/pinctrl-samsung.c b/drivers/pinctrl/samsung/pinctrl-samsung.c index 021abd7221f8..d79eadad6c5f 100644 --- a/drivers/pinctrl/samsung/pinctrl-samsung.c +++ b/drivers/pinctrl/samsung/pinctrl-samsung.c @@ -29,7 +29,6 @@ #include #include #include -#include #include "../core.h" #include "pinctrl-samsung.h" @@ -49,9 +48,6 @@ { "samsung,pin-val", PINCFG_TYPE_DAT }, }; -/* Global list of devices (struct samsung_pinctrl_drv_data) */ -static LIST_HEAD(drvdata_list); - static unsigned int pin_base; static int samsung_get_group_count(struct pinctrl_dev *pctldev) @@ -1084,22 +1080,18 @@ static int samsung_pinctrl_probe(struct platform_device *pdev) platform_set_drvdata(pdev, drvdata); - /* Add to the global list */ - list_add_tail(&drvdata->node, &drvdata_list); - return 0; } #ifdef CONFIG_PM - /** - * samsung_pinctrl_suspend_dev - save pinctrl state for suspend for a device + * samsung_pinctrl_suspend - save pinctrl state for suspend * * Save data for all banks handled by this device. */ -static void samsung_pinctrl_suspend_dev( - struct samsung_pinctrl_drv_data *drvdata) +static int samsung_pinctrl_suspend(struct device *dev) { + struct samsung_pinctrl_drv_data *drvdata = dev_get_drvdata(dev); int i; for (i = 0; i < drvdata->nr_banks; i++) { @@ -1135,18 +1127,21 @@ static void samsung_pinctrl_suspend_dev( drvdata->suspend(drvdata); if (drvdata->retention_ctrl && drvdata->retention_ctrl->enable) drvdata->retention_ctrl->enable(drvdata); + + return 0; } /** - * samsung_pinctrl_resume_dev - restore pinctrl state from suspend for a device + * samsung_pinctrl_resume - restore pinctrl state from suspend * * Restore one of the banks that was saved during suspend. * * We don't bother doing anything complicated to avoid glitching lines since * we're called before pad retention is turned off. */ -static void samsung_pinctrl_resume_dev(struct samsung_pinctrl_drv_data *drvdata) +static int samsung_pinctrl_resume(struct device *dev) { + struct samsung_pinctrl_drv_data *drvdata = dev_get_drvdata(dev); int i; if (drvdata->resume) @@ -1185,48 +1180,11 @@ static void samsung_pinctrl_resume_dev(struct samsung_pinctrl_drv_data *drvdata) if (drvdata->retention_ctrl && drvdata->retention_ctrl->disable) drvdata->retention_ctrl->disable(drvdata); -} - -/** - * samsung_pinctrl_suspend - save pinctrl state for suspend - * - * Save data for all banks across all devices. - */ -static int samsung_pinctrl_suspend(void) -{ - struct samsung_pinctrl_drv_data *drvdata; - - list_for_each_entry(drvdata, &drvdata_list, node) { - samsung_pinctrl_suspend_dev(drvdata); - } return 0; } - -/** - * samsung_pinctrl_resume - restore pinctrl state for suspend - * - * Restore data for all banks across all devices. - */ -static void samsung_pinctrl_resume(void) -{ - struct samsung_pinctrl_drv_data *drvdata; - - list_for_each_entry_reverse(drvdata, &drvdata_list, node) { - samsung_pinctrl_resume_dev(drvdata); - } -} - -#else -#define samsung_pinctrl_suspend NULL -#define samsung_pinctrl_resume NULL #endif -static struct syscore_ops samsung_pinctrl_syscore_ops = { - .suspend = samsung_pinctrl_suspend, - .resume = samsung_pinctrl_resume, -}; - static const struct of_device_id samsung_pinctrl_dt_match[] = { #ifdef CONFIG_PINCTRL_EXYNOS { .compatible = "samsung,exynos3250-pinctrl", @@ -1268,25 +1226,23 @@ static void samsung_pinctrl_resume(void) }; MODULE_DEVICE_TABLE(of, samsung_pinctrl_dt_match); +static const struct dev_pm_ops samsung_pinctrl_pm_ops = { + SET_LATE_SYSTEM_SLEEP_PM_OPS(samsung_pinctrl_suspend, + samsung_pinctrl_resume) +}; + static struct platform_driver samsung_pinctrl_driver = { .probe = samsung_pinctrl_probe, .driver = { .name = "samsung-pinctrl", .of_match_table = samsung_pinctrl_dt_match, .suppress_bind_attrs = true, + .pm = &samsung_pinctrl_pm_ops, }, }; static int __init samsung_pinctrl_drv_register(void) { - /* - * Register syscore ops for save/restore of registers across suspend. - * It's important to ensure that this driver is running at an earlier - * initcall level than any arch-specific init calls that install syscore - * ops that turn off pad retention (like exynos_pm_resume). - */ - register_syscore_ops(&samsung_pinctrl_syscore_ops); - return platform_driver_register(&samsung_pinctrl_driver); } postcore_initcall(samsung_pinctrl_drv_register);