From patchwork Fri Sep 15 08:11:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikita Shubin via B4 Relay X-Patchwork-Id: 140234 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp888581vqi; Fri, 15 Sep 2023 01:23:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHUEi8CyWbGqe4yNvOz+APuNuun+ZyRh2MKio0fC7yVVrDOj69EqsawGqq/jV+ALBxG1Xp9 X-Received: by 2002:a05:6a00:1409:b0:68f:cd32:c52d with SMTP id l9-20020a056a00140900b0068fcd32c52dmr987105pfu.14.1694766232503; Fri, 15 Sep 2023 01:23:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694766232; cv=none; d=google.com; s=arc-20160816; b=BzABf+sTkixgb6xGEPWs9T0fQKIMcKDI+CxBF2BKX8iap2bY3dOgg+KKd2/7eWERrc AkFOO4ppAr8j/6grlMXjEnJmZhvzYMa9kp0zLUKCWZPcWsVHVRlpbNZjww7zioJOmIgZ sl9GHte6KvtlFBzcFq4JQ/GuAAaHp1MQLyroz7RPpaxs8H+A9XtQzxmdBntta819pUUS uKp8SaU2QNU8rwGoZgm7Nrh9nM1iQXcbTIKtYbXjgugLNrKz3btBLRgli0Asq1LD8Lvl o5zCvD3MDloZn6eXeUoqTSw1UcFkmaOO5iyhvvCdleXr/L9x03jg9CUhr8uIAxbynd4P jMkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:reply-to:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=D6j1Aa6jZMY/h3xmtgRXf6dpRb1UJ7dUkTuk4twpkQQ=; fh=pTlz6cfsIKWgNuEnZpACxYME/n36w6jJwNaXAUgVu40=; b=ZU7xYhi3vC8XodAEOFAqxontKVRgxlcg/N47O8dTZMQVNhvE1DfhDjG93HPX3c40Gu Garnl18GJPz52Fjsy1kRX/ClPDbSSttrp8jy01FyJgujfl7wOletjk1+LGhX2+CjZzL/ r88cdz/i+jt/n919h4FSprbQmZM+dTihXL+91fEIkH0XSSNI5P1WP2AH4+hUJDGXm4/q IBdwaEtLhaX37VVdL1IK59235/+9I8NXA4VmMEKKKQFiJ2w2qLpw5xWFZcSLhSlKrRdi kUmOXFxDEO36alsQAiLF5Fw78CNdyoevYYjAkZjSNGeSoeVsGMLYXLJF0nijpG176FrU C0+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vPgmoq5J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id k3-20020aa788c3000000b0068ff3a3c9bfsi3050482pff.8.2023.09.15.01.23.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 01:23:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=vPgmoq5J; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 4E186856781B; Fri, 15 Sep 2023 01:14:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233120AbjIOIN7 (ORCPT + 32 others); Fri, 15 Sep 2023 04:13:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233080AbjIOIMz (ORCPT ); Fri, 15 Sep 2023 04:12:55 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DD41A2D41; Fri, 15 Sep 2023 01:12:15 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPS id 64DDFC32774; Fri, 15 Sep 2023 08:12:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1694765530; bh=p+tfRZ3pQvswdqiustDmxA1N43Os4gY9YGvnB/EY5Ho=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=vPgmoq5JXp3l322/VeHyVhFKrGb7qUVL8Ys6yKEMNAZ2f2aTnVyxfNarvTsfl6khR GPjh0iQFEyAsbeuRg9FEJ0AZNpgQrpGO/8sMKgzvQIg3bSVzLPbbPcpXYvjhnLrowN wYYyEDj4jgZHBK/bKYRE1Ap5QsVZv2LquSJ3YWOkzu5rrNSnqNIzPoJ8L7X1Luq2qB V+7UMnAKmZhtNtsKsY6986X7Sl0Uz+U4ixfDrgNAqfyvMjps/brO1YL7K9eAwNCcD6 FZ9Xhp8R3L+DGLVacqodiSZWRaE4tUOJ7U4o3IXsDZP95ymj1wN/69S+XiMXCegUyJ gTwGGurFqONVQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5020EEE6446; Fri, 15 Sep 2023 08:12:10 +0000 (UTC) From: Nikita Shubin via B4 Relay Date: Fri, 15 Sep 2023 11:11:20 +0300 Subject: [PATCH v4 38/42] ata: pata_ep93xx: remove legacy pinctrl use MIME-Version: 1.0 Message-Id: <20230915-ep93xx-v4-38-a1d779dcec10@maquefel.me> References: <20230915-ep93xx-v4-0-a1d779dcec10@maquefel.me> In-Reply-To: <20230915-ep93xx-v4-0-a1d779dcec10@maquefel.me> To: Hartley Sweeten , Alexander Sverdlin , Russell King , Sergey Shtylyov , Damien Le Moal , Nikita Shubin , Dmitry Torokhov , Thierry Reding , Linus Walleij Cc: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org, Arnd Bergmann , Alexander Sverdlin X-Mailer: b4 0.13-dev-e3e53 X-Developer-Signature: v=1; a=ed25519-sha256; t=1694765525; l=5262; i=nikita.shubin@maquefel.me; s=20230718; h=from:subject:message-id; bh=clQMc6L/CZou9DWOlYtYYIgz0cXmxb3L8zWECLnFfFI=; =?utf-8?q?b=3DN12UH/nt/oLW?= =?utf-8?q?/ODhnWSBW1yzNMHRjkCNxZpvKAtMQpH9Y6CSwJvFlA49hqsDTQUj+sMbP8z0X5Sj?= 7Rb5AdCXCa0QRwKS33sIBueC+Zk4bXaANLI73kDYHPDOxSI8o1ev X-Developer-Key: i=nikita.shubin@maquefel.me; a=ed25519; pk=vqf5YIUJ7BJv3EJFaNNxWZgGuMgDH6rwufTLflwU9ac= X-Endpoint-Received: by B4 Relay for nikita.shubin@maquefel.me/20230718 with auth_id=65 X-Original-From: Nikita Shubin Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 15 Sep 2023 01:14:14 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777091196610450604 X-GMAIL-MSGID: 1777091196610450604 From: Nikita Shubin Drop legacy acquire/release since we are using pinctrl for this now. Reviewed-by: Sergey Shtylyov Acked-by: Damien Le Moal Signed-off-by: Nikita Shubin Reviewed-by: Linus Walleij --- arch/arm/mach-ep93xx/core.c | 72 --------------------------------------- drivers/ata/pata_ep93xx.c | 25 ++++---------- include/linux/soc/cirrus/ep93xx.h | 4 --- 3 files changed, 6 insertions(+), 95 deletions(-) diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c index 9afc6095d1c1..66dba9b4a6f9 100644 --- a/arch/arm/mach-ep93xx/core.c +++ b/arch/arm/mach-ep93xx/core.c @@ -778,78 +778,6 @@ void __init ep93xx_register_ide(void) platform_device_register(&ep93xx_ide_device); } -int ep93xx_ide_acquire_gpio(struct platform_device *pdev) -{ - int err; - int i; - - err = gpio_request(EP93XX_GPIO_LINE_EGPIO2, dev_name(&pdev->dev)); - if (err) - return err; - err = gpio_request(EP93XX_GPIO_LINE_EGPIO15, dev_name(&pdev->dev)); - if (err) - goto fail_egpio15; - for (i = 2; i < 8; i++) { - err = gpio_request(EP93XX_GPIO_LINE_E(i), dev_name(&pdev->dev)); - if (err) - goto fail_gpio_e; - } - for (i = 4; i < 8; i++) { - err = gpio_request(EP93XX_GPIO_LINE_G(i), dev_name(&pdev->dev)); - if (err) - goto fail_gpio_g; - } - for (i = 0; i < 8; i++) { - err = gpio_request(EP93XX_GPIO_LINE_H(i), dev_name(&pdev->dev)); - if (err) - goto fail_gpio_h; - } - - /* GPIO ports E[7:2], G[7:4] and H used by IDE */ - ep93xx_devcfg_clear_bits(EP93XX_SYSCON_DEVCFG_EONIDE | - EP93XX_SYSCON_DEVCFG_GONIDE | - EP93XX_SYSCON_DEVCFG_HONIDE); - return 0; - -fail_gpio_h: - for (--i; i >= 0; --i) - gpio_free(EP93XX_GPIO_LINE_H(i)); - i = 8; -fail_gpio_g: - for (--i; i >= 4; --i) - gpio_free(EP93XX_GPIO_LINE_G(i)); - i = 8; -fail_gpio_e: - for (--i; i >= 2; --i) - gpio_free(EP93XX_GPIO_LINE_E(i)); - gpio_free(EP93XX_GPIO_LINE_EGPIO15); -fail_egpio15: - gpio_free(EP93XX_GPIO_LINE_EGPIO2); - return err; -} -EXPORT_SYMBOL(ep93xx_ide_acquire_gpio); - -void ep93xx_ide_release_gpio(struct platform_device *pdev) -{ - int i; - - for (i = 2; i < 8; i++) - gpio_free(EP93XX_GPIO_LINE_E(i)); - for (i = 4; i < 8; i++) - gpio_free(EP93XX_GPIO_LINE_G(i)); - for (i = 0; i < 8; i++) - gpio_free(EP93XX_GPIO_LINE_H(i)); - gpio_free(EP93XX_GPIO_LINE_EGPIO15); - gpio_free(EP93XX_GPIO_LINE_EGPIO2); - - - /* GPIO ports E[7:2], G[7:4] and H used by GPIO */ - ep93xx_devcfg_set_bits(EP93XX_SYSCON_DEVCFG_EONIDE | - EP93XX_SYSCON_DEVCFG_GONIDE | - EP93XX_SYSCON_DEVCFG_HONIDE); -} -EXPORT_SYMBOL(ep93xx_ide_release_gpio); - /************************************************************************* * EP93xx ADC *************************************************************************/ diff --git a/drivers/ata/pata_ep93xx.c b/drivers/ata/pata_ep93xx.c index 47686dc1fed6..bcf90e46bad4 100644 --- a/drivers/ata/pata_ep93xx.c +++ b/drivers/ata/pata_ep93xx.c @@ -928,28 +928,18 @@ static int ep93xx_pata_probe(struct platform_device *pdev) void __iomem *ide_base; int err; - err = ep93xx_ide_acquire_gpio(pdev); - if (err) - return err; - /* INT[3] (IRQ_EP93XX_EXT3) line connected as pull down */ irq = platform_get_irq(pdev, 0); - if (irq < 0) { - err = irq; - goto err_rel_gpio; - } + if (irq < 0) + return irq; ide_base = devm_platform_get_and_ioremap_resource(pdev, 0, &mem_res); - if (IS_ERR(ide_base)) { - err = PTR_ERR(ide_base); - goto err_rel_gpio; - } + if (IS_ERR(ide_base)) + return PTR_ERR(ide_base); drv_data = devm_kzalloc(&pdev->dev, sizeof(*drv_data), GFP_KERNEL); - if (!drv_data) { - err = -ENOMEM; - goto err_rel_gpio; - } + if (!drv_data) + return -ENOMEM; drv_data->pdev = pdev; drv_data->ide_base = ide_base; @@ -1006,8 +996,6 @@ static int ep93xx_pata_probe(struct platform_device *pdev) err_rel_dma: ep93xx_pata_release_dma(drv_data); -err_rel_gpio: - ep93xx_ide_release_gpio(pdev); return err; } @@ -1019,7 +1007,6 @@ static int ep93xx_pata_remove(struct platform_device *pdev) ata_host_detach(host); ep93xx_pata_release_dma(drv_data); ep93xx_pata_clear_regs(drv_data->ide_base); - ep93xx_ide_release_gpio(pdev); return 0; } diff --git a/include/linux/soc/cirrus/ep93xx.h b/include/linux/soc/cirrus/ep93xx.h index 0df0f3322487..3212a145ae0f 100644 --- a/include/linux/soc/cirrus/ep93xx.h +++ b/include/linux/soc/cirrus/ep93xx.h @@ -12,15 +12,11 @@ struct regmap; #define EP93XX_CHIP_REV_E2 7 #if defined(CONFIG_EP93XX_SOC_COMMON) -int ep93xx_ide_acquire_gpio(struct platform_device *pdev); -void ep93xx_ide_release_gpio(struct platform_device *pdev); int ep93xx_i2s_acquire(void); void ep93xx_i2s_release(void); unsigned int ep93xx_chip_revision(void); #else -static inline int ep93xx_ide_acquire_gpio(struct platform_device *pdev) { return 0; } -static inline void ep93xx_ide_release_gpio(struct platform_device *pdev) {} static inline int ep93xx_i2s_acquire(void) { return 0; } static inline void ep93xx_i2s_release(void) {} static inline unsigned int ep93xx_chip_revision(void) { return 0; }