Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp4415594pxa; Mon, 10 Aug 2020 08:34:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwcHDPkorfHuAsbwJhCzf3hmDawlIoVyGVRmV7u2h7decRSGnE9A5gbInxeXUJwnnVB0Imk X-Received: by 2002:aa7:c6c2:: with SMTP id b2mr22360624eds.173.1597073648708; Mon, 10 Aug 2020 08:34:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597073648; cv=none; d=google.com; s=arc-20160816; b=ij+Vb5vwWQa1ssZ+TCF0A9CwGalmhJJ4m0HfcAr8wGz147Rd+GmD91ga6VSNruRl6p fqHZ/k/LzQBrF8cK8vN4TVvPr4a2cT9PzTmgHjsEBrAHJScZN9KV+9UlQdP45fM47QFa FdlIKESZRj3fszmTsqCeEvYKsBnLz9tqkygDVN1Z3GxMH5h79mhDk7L47UbEApPZyaxm bJGwqb4Bwremgh3wh8Mk+x82ZryGnlCqftUG6ZHcYCGqCkY9zG3jFNOQIqjk7UvlKe1V IAEeJK3FJxQfcPGUO9errqiIss5lOXxdnkTpJ0X9EpoyBq8kHLmtvqPqA4Lnt0U1rHmr lR6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=dcuOjA1HpR3QZxk+5y9E1beTjB3I0OMJo34ZTTvNx74=; b=xWgQXvrP4DtVClIlFKiOt0ZbATxerOarFBIoQv8XjG83pqF7gvMWqzYOKmQuMSklU8 1Qwg+GN0en4CLuhKBnKEayaAOPknRiX+qRZ8/sy7b8bo9EwjMo5qZaNts3mpi7GnjBpv 6dI+HeXDAAqdsaE5iLemW7f/0D3QY4ueSkNyWnQg9L5+Gnr6+fc7VbahvwOwnPU0jgHK /s6X4nT4iFIWO97wi8hzFm5LbgsknpFnB8Y9bvMJANO6GXX1dYP0kpRpEmU3LquLv2cd hCt47k59DeehB1O45uIYeLqRKyURzMGiELPt+iwk4DTddNhYIkdjX7Ph2FvgLYOlkdUq YTlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=uI5x7w77; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bj23si11187908ejb.94.2020.08.10.08.33.45; Mon, 10 Aug 2020 08:34:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=uI5x7w77; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728068AbgHJPdT (ORCPT + 99 others); Mon, 10 Aug 2020 11:33:19 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:42709 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729110AbgHJPdH (ORCPT ); Mon, 10 Aug 2020 11:33:07 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200810153306euoutp0238f8b94667b08964b4d61a0119d95d02~p8fcDgV6h1821818218euoutp02e for ; Mon, 10 Aug 2020 15:33:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200810153306euoutp0238f8b94667b08964b4d61a0119d95d02~p8fcDgV6h1821818218euoutp02e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1597073586; bh=dcuOjA1HpR3QZxk+5y9E1beTjB3I0OMJo34ZTTvNx74=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uI5x7w77V0hlEiLCla0KH1IQoSmGmbYuC4fAz6ZsFgnyW3sXx7rQHIh86xOB47Mf3 dJ9pJLsqpk0VKDRxhOatLItyzEvIwsl+NTgbPhzHnlmyZy6N0trosS6fA7spQ/Sjhq kFz6YvU4cXA8hDKvZCp3t0XpezLKcZmnAR4dMK2Q= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200810153305eucas1p273be5417e848f874295c32d64362b8f4~p8fb4tnVd0872108721eucas1p28; Mon, 10 Aug 2020 15:33:05 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 78.FE.06318.1B8613F5; Mon, 10 Aug 2020 16:33:05 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200810153305eucas1p2246d0e265d6548789cd24557fcd0d6f4~p8fbj793P0868908689eucas1p2E; Mon, 10 Aug 2020 15:33:05 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200810153305eusmtrp25510ee1efc4bf1ed22997012ea49e917~p8fbjYGyE0085100851eusmtrp2Z; Mon, 10 Aug 2020 15:33:05 +0000 (GMT) X-AuditID: cbfec7f5-38bff700000018ae-bd-5f3168b10773 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id BE.C2.06314.1B8613F5; Mon, 10 Aug 2020 16:33:05 +0100 (BST) Received: from AMDC3061.digital.local (unknown [106.120.51.75]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200810153305eusmtip2ae761a2d74747ddc4303c2fdffbfb64e~p8fbIb6WA2897228972eusmtip2O; Mon, 10 Aug 2020 15:33:05 +0000 (GMT) From: Sylwester Nawrocki To: linux-media@vger.kernel.org Cc: hslester96@gmail.com, krzk@kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, b.zolnierkie@samsung.com, m.szyprowski@samsung.com, Sylwester Nawrocki Subject: [PATCH 2/2] media: exynos4-is: Simplify the pinctrl code Date: Mon, 10 Aug 2020 17:32:40 +0200 Message-Id: <20200810153240.23827-2-s.nawrocki@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200810153240.23827-1-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpjleLIzCtJLcpLzFFi42LZduznOd2NGYbxBs/mGFtsnLGe1WL2oZfM FufPb2C32PT4GqvF5V1z2Cx6NmxltZhxfh+Txdojd9ktDr9pZ3Xg9Ng56y67x6ZVnWwem5fU e/RtWcXo8XmTXABrFJdNSmpOZllqkb5dAlfGya/fWQuWylfMeDCXpYFxmlQXIyeHhICJxMu3 S1i7GLk4hARWMEp8WX6fDcL5wiix8Ww7VOYzo8SvU8+ZYVomfdrBDJFYzijxfPk6JriW9bsm MIFUsQkYSvQe7WMEsUUE5CWe9N4Am8ss8J1RYue53ywgCWEBR4nbqy6B2SwCqhKzdt5kA7F5 Bawlzlw9wAixTl5i9YYDQOs4ODgFbCQWX+YHmSMh0Mwu8fr/K6iTXCSuTH/ACmELS7w6voUd wpaR+L9zPhNUA6NEz+7b7BDOBEaJ+8cXQG2wlrhz7hcbyAZmAU2gF/Qhwo4SL9etBAtLCPBJ 3HgrCBJmBjInbZvODBHmlehoE4KoVpH4vWo6E4QtJdH95D8LhO0h0XlzLjQY+xklvt6YyTSB UX4WwrIFjIyrGMVTS4tz01OLjfNSy/WKE3OLS/PS9ZLzczcxAlPH6X/Hv+5g3Pc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h1oUqrgveBxXs25RmarwxfDDQGzXl8znX3RLTVs mpGzT9ndhI/tsiHrWA6X8yixFGckGmoxFxUnAgCVk/EUdwIAAA== X-CMS-MailID: 20200810153305eucas1p2246d0e265d6548789cd24557fcd0d6f4 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200810153305eucas1p2246d0e265d6548789cd24557fcd0d6f4 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200810153305eucas1p2246d0e265d6548789cd24557fcd0d6f4 References: <20200810153240.23827-1-s.nawrocki@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is no need to request the "idle" pinctrl state in the driver as that is implemented in the driver core and the pinctrl_pm_* API can be used for switching between the default and the idle state. Simplify the pinctrl code to only request and check for the mandatory "default" pinctrl state. Switching between the default/idle pinctrl state is not yet implemented in the driver and this patch doesn't change that. Signed-off-by: Sylwester Nawrocki --- drivers/media/platform/exynos4-is/media-dev.c | 27 +++++---------------------- drivers/media/platform/exynos4-is/media-dev.h | 11 ----------- 2 files changed, 5 insertions(+), 33 deletions(-) diff --git a/drivers/media/platform/exynos4-is/media-dev.c b/drivers/media/platform/exynos4-is/media-dev.c index 9a57523..6df2796 100644 --- a/drivers/media/platform/exynos4-is/media-dev.c +++ b/drivers/media/platform/exynos4-is/media-dev.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -1254,26 +1255,6 @@ static ssize_t fimc_md_sysfs_store(struct device *dev, static DEVICE_ATTR(subdev_conf_mode, S_IWUSR | S_IRUGO, fimc_md_sysfs_show, fimc_md_sysfs_store); -static int fimc_md_get_pinctrl(struct fimc_md *fmd) -{ - struct device *dev = &fmd->pdev->dev; - struct fimc_pinctrl *pctl = &fmd->pinctl; - - pctl->pinctrl = devm_pinctrl_get(dev); - if (IS_ERR(pctl->pinctrl)) - return PTR_ERR(pctl->pinctrl); - - pctl->state_default = pinctrl_lookup_state(pctl->pinctrl, - PINCTRL_STATE_DEFAULT); - if (IS_ERR(pctl->state_default)) - return PTR_ERR(pctl->state_default); - - /* PINCTRL_STATE_IDLE is optional */ - pctl->state_idle = pinctrl_lookup_state(pctl->pinctrl, - PINCTRL_STATE_IDLE); - return 0; -} - static int cam_clk_prepare(struct clk_hw *hw) { struct cam_clk *camclk = to_cam_clk(hw); @@ -1429,6 +1410,7 @@ static int fimc_md_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct v4l2_device *v4l2_dev; + struct pinctrl *pinctrl; struct fimc_md *fmd; int ret; @@ -1465,8 +1447,9 @@ static int fimc_md_probe(struct platform_device *pdev) if (ret) goto err_v4l2dev; - ret = fimc_md_get_pinctrl(fmd); - if (ret < 0) { + pinctrl = devm_pinctrl_get(dev); + if (IS_ERR(pinctrl)) { + ret = PTR_ERR(pinctrl); if (ret != EPROBE_DEFER) dev_err(dev, "Failed to get pinctrl: %d\n", ret); goto err_clk; diff --git a/drivers/media/platform/exynos4-is/media-dev.h b/drivers/media/platform/exynos4-is/media-dev.h index 4b8f9ac..9447faf 100644 --- a/drivers/media/platform/exynos4-is/media-dev.h +++ b/drivers/media/platform/exynos4-is/media-dev.h @@ -27,8 +27,6 @@ #define FIMC_IS_OF_NODE_NAME "fimc-is" #define CSIS_OF_NODE_NAME "csis" -#define PINCTRL_STATE_IDLE "idle" - #define FIMC_MAX_SENSORS 4 #define FIMC_MAX_CAMCLKS 2 #define DEFAULT_SENSOR_CLK_FREQ 24000000U @@ -109,9 +107,6 @@ struct cam_clk { * @media_dev: top level media device * @v4l2_dev: top level v4l2_device holding up the subdevs * @pdev: platform device this media device is hooked up into - * @pinctrl: camera port pinctrl handle - * @state_default: pinctrl default state handle - * @state_idle: pinctrl idle state handle * @cam_clk_provider: CAMCLK clock provider structure * @user_subdev_api: true if subdevs are not configured by the host driver * @slock: spinlock protecting @sensor array @@ -131,12 +126,6 @@ struct fimc_md { struct v4l2_device v4l2_dev; struct platform_device *pdev; - struct fimc_pinctrl { - struct pinctrl *pinctrl; - struct pinctrl_state *state_default; - struct pinctrl_state *state_idle; - } pinctl; - struct cam_clk_provider { struct clk *clks[FIMC_MAX_CAMCLKS]; struct clk_onecell_data clk_data; -- 2.7.4