From patchwork Fri Dec 6 17:08:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 180933 Delivered-To: patches@linaro.org Received: by 2002:a92:3001:0:0:0:0:0 with SMTP id x1csp1054163ile; Fri, 6 Dec 2019 09:08:35 -0800 (PST) X-Received: by 2002:a2e:6e03:: with SMTP id j3mr9550143ljc.32.1575652115846; Fri, 06 Dec 2019 09:08:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575652115; cv=none; d=google.com; s=arc-20160816; b=sEUTMBTUgg0kLgynVfDn7JJIrdQ5VnK5spB0KWpGOx4XVmmLOedfaMv6D2MDnEkNj8 bVPsWGKcFU/fJ+BxKtgqV7W5T6V0XjDrJ/21XJRgM2JtjGDvbeIe0CZ78CShp8dcFTaj rZFuofoAFi69CreFj5Puj/7VZk72i+mV2DU/eEBsgpsOW9n89NXs7qzrkMAQHaQJ+3T6 7zHF+SCZNs3GfH9NCNbkheJVwTu1BV/1KGZV5p1N/6vnyNeONDSrC31DiPAJuphd3jDd ra9WaO8kchtRrpbervbQrXrLqNFClYDdMGF44R8rFlmGfZMnncNZXc0FMpK7f/4imEdj EkTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=fTEyh8XCr6qWiWO+Sm26auA9jej3JxBZE/rL5aBzRVY=; b=bT5KQYNkkcGdwASwrrQJRq+PvZvWHquTWldDMAaGn1VIOytpXHVePeXlrhfmgjD5xO HcfZPX/ts6onOcFCmIXbIPeOyWzhO/7YrBAsxliPZo8jR6HzEsD++26rkmON56hOkrC5 o97V1dzGFQRobE/MLtycamiZVIhgJ6B4wMNH40TeeoVfsNSRNrDVlgoDz7w4EA6qNQoG oUSKUHb030JhbEXQ8fTFm6TFC1EDnov06OT48SH5fgVn+GqWS5aIiaIwmPgOOZ2kKZjC YmwbTLxqqb1HFt41ncItRQRNcFPkxA2TvksHxR4bP2uRd6scE2Jq4q4xTlJr+C/+BZG2 TLhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dzqIxUO7; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id l15sor2883189lji.27.2019.12.06.09.08.35 for (Google Transport Security); Fri, 06 Dec 2019 09:08:35 -0800 (PST) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dzqIxUO7; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=fTEyh8XCr6qWiWO+Sm26auA9jej3JxBZE/rL5aBzRVY=; b=dzqIxUO7WxQk+plB0N+sxpgJHd9B7Gqjohrdy/hCB+cGg3rfhemNz+2LL8EssKd0MV upCGcYGQYMVNMExbGvN7Qreozlys4r8Q/t+j3QoLCQiSB1xykzvEJ9SOmOISwrA1jlvp 4YqHPRHa85RcGLnuhvUzfCGVkvNFoPHGWUjCMMR7Bjm70zmoMVHvm9rSqeqBhF5pJYET uu3CXmcUMAhftU9pWR0U+AkR1SxsikEKY2Lc1bWHLNgIODEP1QqxizVF1LdyzMUtxcHJ gV5lyhhxeEnapF91t37e5JauaL/D9OqEQjGP+GtxsJTJJaE5TXiESw07H2QqV8NtezBg RuGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=fTEyh8XCr6qWiWO+Sm26auA9jej3JxBZE/rL5aBzRVY=; b=tOe53QJYl4XJbTvYDSjeYR+eItnCRyGlEMouNF7NkK+aRmWuG/iyzmCFJu9V7NlkVH xxxctsFRCWAGq+ixQDPtObboTEkNTalbwrCSoMybwyl4pRXBhlshUa1tID/x+xH6np7E U23lvMRCtr0BbqzUPYPb3bZQ274mJFt+bwfoNb7FFTA16toCcj550w/gwQ/x3zAjd8Tc 6xqdCEI5LJXXO5W/iyHcCVQNEY7ULuhyg5cw2Y3TFdRRCb5DeesfUYhJOeIKEu+1+GP/ ajhrpGug6LDoCqaLt7lbSwFx6pEAoFtyX+3vLJihJqXrzHBCjw2G23PH8Pjb1ihX6Cvu Bfpg== X-Gm-Message-State: APjAAAXeuL6Wg4ZmoKX/WOReXK4Dj4zV8RgcQPNE5h5w+5Aq+ell6kzT 6Rvq8+u2/DrYnDwnjt6zn+3bvzxZ7NSBAw== X-Google-Smtp-Source: APXvYqx2YUEFT3CYqRkqrCF50CxYbiVYSIL4MAtnnjeQmuc33zVtu9572g9p4vEVQvm8MMy9E6jTOQ== X-Received: by 2002:a05:651c:1110:: with SMTP id d16mr9527832ljo.86.1575652115109; Fri, 06 Dec 2019 09:08:35 -0800 (PST) Return-Path: Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id z9sm6905283ljm.40.2019.12.06.09.08.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Dec 2019 09:08:34 -0800 (PST) From: Ulf Hansson To: linux-gpio@vger.kernel.org, Linus Walleij Cc: linux-mmc@vger.kernel.org, Ulf Hansson , Adrian Hunter Subject: [PATCH 6/9] mmc: sdhci-esdhc-imx: Convert to pinctrl_select_default_state() Date: Fri, 6 Dec 2019 18:08:18 +0100 Message-Id: <20191206170821.29711-7-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191206170821.29711-1-ulf.hansson@linaro.org> References: <20191206170821.29711-1-ulf.hansson@linaro.org> Let's drop the boilerplate code for managing the default pinctrl state and convert into using the new pinctrl_select_default_state(). Cc: Adrian Hunter Signed-off-by: Ulf Hansson --- drivers/mmc/host/sdhci-esdhc-imx.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) -- 2.17.1 diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index 1c988d6a2433..43628c9c05ac 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -224,7 +224,6 @@ static struct esdhc_soc_data usdhc_imx8qxp_data = { struct pltfm_imx_data { u32 scratchpad; struct pinctrl *pinctrl; - struct pinctrl_state *pins_default; struct pinctrl_state *pins_100mhz; struct pinctrl_state *pins_200mhz; const struct esdhc_soc_data *socdata; @@ -951,7 +950,6 @@ static int esdhc_change_pinstate(struct sdhci_host *host, dev_dbg(mmc_dev(host->mmc), "change pinctrl state for uhs %d\n", uhs); if (IS_ERR(imx_data->pinctrl) || - IS_ERR(imx_data->pins_default) || IS_ERR(imx_data->pins_100mhz) || IS_ERR(imx_data->pins_200mhz)) return -EINVAL; @@ -968,7 +966,7 @@ static int esdhc_change_pinstate(struct sdhci_host *host, break; default: /* back to default state for other legacy timing */ - pinctrl = imx_data->pins_default; + return pinctrl_select_default_state(mmc_dev(host->mmc)); } return pinctrl_select_state(imx_data->pinctrl, pinctrl); @@ -1338,7 +1336,7 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev, mmc_of_parse_voltage(np, &host->ocr_mask); - if (esdhc_is_usdhc(imx_data) && !IS_ERR(imx_data->pins_default)) { + if (esdhc_is_usdhc(imx_data)) { imx_data->pins_100mhz = pinctrl_lookup_state(imx_data->pinctrl, ESDHC_PINCTRL_STATE_100MHZ); imx_data->pins_200mhz = pinctrl_lookup_state(imx_data->pinctrl, @@ -1492,11 +1490,6 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev) goto disable_ahb_clk; } - imx_data->pins_default = pinctrl_lookup_state(imx_data->pinctrl, - PINCTRL_STATE_DEFAULT); - if (IS_ERR(imx_data->pins_default)) - dev_warn(mmc_dev(host->mmc), "could not get default state\n"); - if (esdhc_is_usdhc(imx_data)) { host->quirks2 |= SDHCI_QUIRK2_PRESET_VALUE_BROKEN; host->mmc->caps |= MMC_CAP_1_8V_DDR | MMC_CAP_3_3V_DDR;