From patchwork Mon Sep 3 10:01:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 965363 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-ide-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Ms/AL1db"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 423ls91Gyrz9s55 for ; Mon, 3 Sep 2018 20:03:09 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727612AbeICOVf (ORCPT ); Mon, 3 Sep 2018 10:21:35 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:53667 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727126AbeICOVe (ORCPT ); Mon, 3 Sep 2018 10:21:34 -0400 Received: by mail-wm0-f65.google.com with SMTP id b19-v6so547090wme.3; Mon, 03 Sep 2018 03:02:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=k6iCbW8J+KgHVaSl644rAO8j84rXqhGHUryoNJ+DbzA=; b=Ms/AL1dbSwu/6OkcCoXkniJHuTppTg1eS/iAfsbHlJ4Igfren9etlHtyrmUz46G8v1 m5sOK4cOjhvE5gmLsm4B/yx/f3y8G9pf6oL9/JibL4a3Uw+ivm0U1VeQb9/JdawLRP3t 23ryPujptKghn7ly2mJ2FmLVXW2Mxm8oPKa9RJPLyvLxOH6wBNFC70TDFW7Nu/P1qD5G 6r2iRj8e7ZLKZKHgtqt/pW9+W+pC4jH+X9QgbL0W5eUesmDNFFOqyj3v5hCkdnu1DwYN ovhbadxfujnJSB6IHyflzPjmAvD/b140Z24hhQx+VgQU83T/MPPI01E0V3h6dBo1u5wv YOXQ== 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=k6iCbW8J+KgHVaSl644rAO8j84rXqhGHUryoNJ+DbzA=; b=aq3hjJlWlApXFzFrzHghEss1izgGzH985Q/9hk+kHGFjxODHfywmLp/rcVpYBc/uOB i2oFewibkMKRagIL2rsrQmLfKYVhr4vzNHDRVkRTF+RhoSNKpPzExaQFsZcmw+n5YeOc K2mbd2sa24V2dxJzzJM2zUJiDHmPKfEkAYJpBQZtT/YQVrJZ+bLGU9AY+cEPv4Qm4sJ0 6wN+ldzRyy/oTehHqV+7UDEioDZOpdaxnRrsm+ZmGPRh3bfP/yRtTQbY8IDujLigxFCd 9jUoErjQA29m38+iykZk4TzizOfqJQvns8ra2rckrMl1f77//fXzS/Acw+L7pesSHDVH lLmw== X-Gm-Message-State: APzg51Ajw+EvzC+3bwo8eDhLd3M6d2WOUXiHCSzr++jLGasVzq2pn9fl m41VpSs/x0uyeH8UCZ1vfF0= X-Google-Smtp-Source: ANB0VdYyEQP9p7oEOTJkZmuWF9IdDN1AzCi5TwwUnzPJub8vTSwG4ac49aFeYlkOajQT/IDi45yZLg== X-Received: by 2002:a1c:8145:: with SMTP id c66-v6mr3739310wmd.139.1535968927560; Mon, 03 Sep 2018 03:02:07 -0700 (PDT) Received: from Red.localdomain ([2a01:cb1d:147:7200:2e56:dcff:fed2:c6d6]) by smtp.googlemail.com with ESMTPSA id k34-v6sm31773936wre.18.2018.09.03.03.02.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Sep 2018 03:02:06 -0700 (PDT) From: Corentin Labbe To: axboe@kernel.dk, hdegoede@redhat.com, mark.rutland@arm.com, maxime.ripard@bootlin.com, robh+dt@kernel.org, wens@csie.org Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Corentin Labbe Subject: [PATCH v5 1/9] dt-bindings: ata: ahci-platform: fix indentation of target-supply Date: Mon, 3 Sep 2018 12:01:53 +0200 Message-Id: <20180903100201.23131-2-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180903100201.23131-1-clabbe.montjoie@gmail.com> References: <20180903100201.23131-1-clabbe.montjoie@gmail.com> Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org This patch fix the indentation of target-supply's ':'. Signed-off-by: Corentin Labbe --- Documentation/devicetree/bindings/ata/ahci-platform.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/ata/ahci-platform.txt b/Documentation/devicetree/bindings/ata/ahci-platform.txt index 5d5bd456d9d9..b88820b4c01e 100644 --- a/Documentation/devicetree/bindings/ata/ahci-platform.txt +++ b/Documentation/devicetree/bindings/ata/ahci-platform.txt @@ -47,7 +47,7 @@ Sub-nodes required properties: - reg : the port number And at least one of the following properties: - phys : reference to the SATA PHY node -- target-supply : regulator for SATA target power +- target-supply : regulator for SATA target power Examples: sata@ffe08000 { From patchwork Mon Sep 3 10:01:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 965361 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-ide-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="m070xjmT"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 423ls43wKVz9s55 for ; Mon, 3 Sep 2018 20:03:04 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727666AbeICOVh (ORCPT ); Mon, 3 Sep 2018 10:21:37 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:40694 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726061AbeICOVg (ORCPT ); Mon, 3 Sep 2018 10:21:36 -0400 Received: by mail-wm0-f68.google.com with SMTP id 207-v6so515520wme.5; Mon, 03 Sep 2018 03:02:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=t7Yy96h1CNLQsmpPB+gBtt+3MwMJX3o+4LyGaKYq94s=; b=m070xjmTV8oB18DF8XHLMSb11OXMKQs4HbkTJBzGsA/kkCepsrdAH/620RDjGWUxkr fVxM32Xk6O2ToADYUpC/Bq1fbBsqzz92WEv6rSx+LGrz9kYfmE73CQe85+DXUqdmUBaE uWoKO6TxQ4k8oheINrk/Jq9Ac6XrtY5d2/O2jLgsq96FdD8xXuF2Nl9aLvUQghs7ofoe nUoBZa99VKNQ+jcvmjSFELfUQbPnZ9lmh/l7UQq3nnfTTZ7kPUdp65SqiBqvf8gtq69B YqDJdpoLk/EmwXZcd40Kii785c1BHBSZ6eKnbDhQ+TROcSG2r8uN4HXB0TjMrtLBAFWt 4xwA== 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=t7Yy96h1CNLQsmpPB+gBtt+3MwMJX3o+4LyGaKYq94s=; b=nCiuma0+0eRTyFISjGCPXZBS/57wRf+bsCquqBvD+Ne2Nh9F0m0WQcT4ayoc4kfWOX OBtuvaKH7QveiZ5Q4NzIkp+b4+GB1Crhly3p3qlE4q7oWv21gHXXrS1+zfTz7BTmTpH5 R4wG8zvA3UKdPwtpiQRN4fPjd6tv1J7qcczhpd1yVB0vKQp+OsSRHDUphNgLLGxnmovL JuuQnhsOs4EC71oBjOY6G7w5IRC37k18LeyHN5BXfJiy8MZrhhS/kPmP6lK5K0lL8D32 sSCpeHFqU/MgfHMpEZGh1Fw7SOt9sPxPZ0Nch397EDMgJQSdgPzd0Y5IxgyuWyDVwsPX P/gg== X-Gm-Message-State: APzg51BukSDwVKW+gz12jpNjWXXLFTSTih7FHtQlxYqScmIddP2aULCa uWq+Ykt6j7CtVaCGTfKYHOA= X-Google-Smtp-Source: ANB0VdaOCrX22FEezBJWtRmBN94RtIe219A0b5ROX8xCmEYZdUsBkS2c17wZUAYKwtPmJevJ1M10EQ== X-Received: by 2002:a1c:1d87:: with SMTP id d129-v6mr4492426wmd.34.1535968928948; Mon, 03 Sep 2018 03:02:08 -0700 (PDT) Received: from Red.localdomain ([2a01:cb1d:147:7200:2e56:dcff:fed2:c6d6]) by smtp.googlemail.com with ESMTPSA id k34-v6sm31773936wre.18.2018.09.03.03.02.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Sep 2018 03:02:08 -0700 (PDT) From: Corentin Labbe To: axboe@kernel.dk, hdegoede@redhat.com, mark.rutland@arm.com, maxime.ripard@bootlin.com, robh+dt@kernel.org, wens@csie.org Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Corentin Labbe Subject: [PATCH v5 2/9] ata: ahci_platform: add support for AHCI controller regulator Date: Mon, 3 Sep 2018 12:01:54 +0200 Message-Id: <20180903100201.23131-3-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180903100201.23131-1-clabbe.montjoie@gmail.com> References: <20180903100201.23131-1-clabbe.montjoie@gmail.com> Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org The SoC R40 AHCI controller need a regulator to work. So this patch add a way to add an optional regulator on AHCI controller. Signed-off-by: Corentin Labbe --- drivers/ata/ahci.h | 1 + drivers/ata/libahci_platform.c | 26 ++++++++++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h index 6a1515f0da40..1415f1012de5 100644 --- a/drivers/ata/ahci.h +++ b/drivers/ata/ahci.h @@ -352,6 +352,7 @@ struct ahci_host_priv { struct clk *clks[AHCI_MAX_CLKS]; /* Optional */ struct reset_control *rsts; /* Optional */ struct regulator **target_pwrs; /* Optional */ + struct regulator *ahci_regulator;/* Optional */ /* * If platform uses PHYs. There is a 1:1 relation between the port number and * the PHY position in this array. diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c index c92c10d55374..a886b61476a3 100644 --- a/drivers/ata/libahci_platform.c +++ b/drivers/ata/libahci_platform.c @@ -139,7 +139,7 @@ EXPORT_SYMBOL_GPL(ahci_platform_disable_clks); * ahci_platform_enable_regulators - Enable regulators * @hpriv: host private area to store config values * - * This function enables all the regulators found in + * This function enables all the regulators found in controller and * hpriv->target_pwrs, if any. If a regulator fails to be enabled, it * disables all the regulators already enabled in reverse order and * returns an error. @@ -151,6 +151,12 @@ int ahci_platform_enable_regulators(struct ahci_host_priv *hpriv) { int rc, i; + if (hpriv->ahci_regulator) { + rc = regulator_enable(hpriv->ahci_regulator); + if (rc) + return rc; + } + for (i = 0; i < hpriv->nports; i++) { if (!hpriv->target_pwrs[i]) continue; @@ -167,6 +173,8 @@ int ahci_platform_enable_regulators(struct ahci_host_priv *hpriv) if (hpriv->target_pwrs[i]) regulator_disable(hpriv->target_pwrs[i]); + if (hpriv->ahci_regulator) + regulator_disable(hpriv->ahci_regulator); return rc; } EXPORT_SYMBOL_GPL(ahci_platform_enable_regulators); @@ -175,7 +183,8 @@ EXPORT_SYMBOL_GPL(ahci_platform_enable_regulators); * ahci_platform_disable_regulators - Disable regulators * @hpriv: host private area to store config values * - * This function disables all regulators found in hpriv->target_pwrs. + * This function disables all regulators found in hpriv->target_pwrs and + * AHCI controller. */ void ahci_platform_disable_regulators(struct ahci_host_priv *hpriv) { @@ -186,6 +195,9 @@ void ahci_platform_disable_regulators(struct ahci_host_priv *hpriv) continue; regulator_disable(hpriv->target_pwrs[i]); } + + if (hpriv->ahci_regulator) + regulator_disable(hpriv->ahci_regulator); } EXPORT_SYMBOL_GPL(ahci_platform_disable_regulators); /** @@ -351,6 +363,7 @@ static int ahci_platform_get_regulator(struct ahci_host_priv *hpriv, u32 port, * * 1) mmio registers (IORESOURCE_MEM 0, mandatory) * 2) regulator for controlling the targets power (optional) + * regulator for controlling the AHCI controller (optional) * 3) 0 - AHCI_MAX_CLKS clocks, as specified in the devs devicetree node, * or for non devicetree enabled platforms a single clock * 4) resets, if flags has AHCI_PLATFORM_GET_RESETS (optional) @@ -408,6 +421,15 @@ struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev, hpriv->clks[i] = clk; } + hpriv->ahci_regulator = devm_regulator_get_optional(dev, "ahci"); + if (IS_ERR(hpriv->ahci_regulator)) { + rc = PTR_ERR(hpriv->ahci_regulator); + if (rc == -EPROBE_DEFER) + goto err_out; + rc = 0; + hpriv->ahci_regulator = NULL; + } + if (flags & AHCI_PLATFORM_GET_RESETS) { hpriv->rsts = devm_reset_control_array_get_optional_shared(dev); if (IS_ERR(hpriv->rsts)) { From patchwork Mon Sep 3 10:01:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 965359 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-ide-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="gEDqDcKo"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 423ls21Hzqz9s4Z for ; Mon, 3 Sep 2018 20:03:01 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727680AbeICOVi (ORCPT ); Mon, 3 Sep 2018 10:21:38 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:55699 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727636AbeICOVh (ORCPT ); Mon, 3 Sep 2018 10:21:37 -0400 Received: by mail-wm0-f68.google.com with SMTP id f21-v6so534935wmc.5; Mon, 03 Sep 2018 03:02:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/+HNfr3I0MzGHGd7Aj3LN1rm33wfTbHxswxtDehlIDw=; b=gEDqDcKo7iy9T0WsJtmQLxyIP9rtZgMc9YreV4LnDm2vMI3qxoT5/qt/KAPFnFYhuP by+38DFjwWf5t0BKdPZ8F2FO65Cq8ZBga4J9kyowCpuGj38qDMS00JgKGm260tXMjzsC fVkYwl2A4C5aC6HweijBzuHZmwYUHJ6bASLi/FuA4pGFDn9zxrBQSICcVZLJ7tJyv0yC J4sTKmcr4xlRZA+ikai0huBh19pO7bTvyP7juqoyswIusWzsXZA2f8GAd7IP5oOc+eiF y6MxfhcAW/Z0hAKMYCVm93mWAXR0y6sf8Lro5eNagQ1vD8hlLqwPVPh4KOLmuP5Gs6Gq W7Yg== 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=/+HNfr3I0MzGHGd7Aj3LN1rm33wfTbHxswxtDehlIDw=; b=q+0AZfah1syJ120oMReV0RYbMCgzfIPMJShHu+gDPIEOI5/SpW6+wZVJWjSKXJKMYw su/hvaNzlMHQyJi7ZnLCpw94SmIuYntCKDhahIdjQ2+GH+nFgL480wEiOzrlMwPxPxbR OfbtAB/hKCa2bk5/k/W6DbAu0+QHC96nkXbAARGhA+IBL16yadJb9zcChN4oYfrvhoZM V1q4seqrqhkC0tugecwqLwxwsB/FeXPHApMtZ0ZNZzDZ8iAa4R952N+aQfQeXodrOjA0 vNi1mjvGHco2OkFQnTW4FgVyL/moZyLdQd4bD0hIMfdO7qOlYVpW0/DjH2jRWTa5AWjb 3l/Q== X-Gm-Message-State: APzg51BjJZ85C3fi6ppxJsAbcScQ5bXVuzeEEgLzM3Hzul8XOQFGCFth bg3485SbocTytPtP+8ZT8lM= X-Google-Smtp-Source: ANB0VdYhlcIdxIk13NqnuVtKSdI2MnJEZ1y776Cx47R3Q6YYuWJ4e0r+t4sXdpC8xJ31nTgyCLrO5Q== X-Received: by 2002:a1c:e70b:: with SMTP id e11-v6mr4496423wmh.22.1535968930273; Mon, 03 Sep 2018 03:02:10 -0700 (PDT) Received: from Red.localdomain ([2a01:cb1d:147:7200:2e56:dcff:fed2:c6d6]) by smtp.googlemail.com with ESMTPSA id k34-v6sm31773936wre.18.2018.09.03.03.02.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Sep 2018 03:02:09 -0700 (PDT) From: Corentin Labbe To: axboe@kernel.dk, hdegoede@redhat.com, mark.rutland@arm.com, maxime.ripard@bootlin.com, robh+dt@kernel.org, wens@csie.org Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Corentin Labbe Subject: [PATCH v5 3/9] dt-bindings: ata: ahci-platform: document ahci-supply Date: Mon, 3 Sep 2018 12:01:55 +0200 Message-Id: <20180903100201.23131-4-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180903100201.23131-1-clabbe.montjoie@gmail.com> References: <20180903100201.23131-1-clabbe.montjoie@gmail.com> Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org This patch document the new optional ahci-supply. Signed-off-by: Corentin Labbe Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/ata/ahci-platform.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/ata/ahci-platform.txt b/Documentation/devicetree/bindings/ata/ahci-platform.txt index b88820b4c01e..f495774c8af9 100644 --- a/Documentation/devicetree/bindings/ata/ahci-platform.txt +++ b/Documentation/devicetree/bindings/ata/ahci-platform.txt @@ -33,6 +33,7 @@ Optional properties: - target-supply : regulator for SATA target power - phys : reference to the SATA PHY node - phy-names : must be "sata-phy" +- ahci-supply : regulator for AHCI controller - ports-implemented : Mask that indicates which ports that the HBA supports are available for software to use. Useful if PORTS_IMPL is not programmed by the BIOS, which is true with From patchwork Mon Sep 3 10:01:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 965358 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-ide-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ASc6T1XR"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 423lrs04Yjz9s1x for ; Mon, 3 Sep 2018 20:02:53 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727741AbeICOVj (ORCPT ); Mon, 3 Sep 2018 10:21:39 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:40696 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727126AbeICOVi (ORCPT ); Mon, 3 Sep 2018 10:21:38 -0400 Received: by mail-wm0-f66.google.com with SMTP id 207-v6so515685wme.5; Mon, 03 Sep 2018 03:02:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9LXnz2fUikvXtzGPguMQqVne60eSM6Bi3/wfM9ERA6c=; b=ASc6T1XRSP/kNEywFxw90OG1YnpHJ4VQZ+PqmR+SWLpIB9Wh7pYhzG+vAE0G+Ebi1E O5QFT4TH9NSfb3jjSv/9OSYhX+jnrslrUWNL53S/hupKMjmjeMhpkRiT+NOv0g8lW8ph 1i32SWXceUoP9UE1h/LfZ2HzgstomtNjVbMZ1EDd5MZGWa3Xg8/jwK2/yaD4EGQfyjMZ 90gwkayHWTrzAnglB96xpKyFTX/JpaKlRU3DCa9mRuesMayYa0Gr3hT6TnNluM26PzCy XFY+IozKXf/TTz32pTRbCaF4UUR7w15OV6yp+E2G8VXuJbqvrnlntVgD76CNEgTbh151 dBGA== 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=9LXnz2fUikvXtzGPguMQqVne60eSM6Bi3/wfM9ERA6c=; b=mlPVooPOSBVaSN/lkM7+T8vGZI7UAWdlOu95E1ozf9yVr3pjkElQc7SQDoSVQKuqF3 r38OLS2lPByICHn76GDUN0RchzYNvlIxnmtHNYwj/y3GzwKpC/Qitn++KWQWRtv/mR1P VA2akB/H48czRvoZdR6hy53re07Ou02V7XZamwQG21pSUZEKfrx39XtF5pD4M2Hkexhn ukjWBgaJLW84ZW2lsRMoJtHskkoi5H/jjRNyYKgv7+7SYJ90Yzvog38Lg94TCaO9Pqgs EegSbdqmleh6HoRYpG+/qrn10kxi86IihDQH3FKO49LHOr4tKBirZity8LG4cKpWopGv QOZg== X-Gm-Message-State: APzg51D9KOtm6/4STyYRGu8MuQSJKJqnwYTmNQvf0+B14ofBhg6EUjQS VjBEIb0mFU8bvfuVmsOq/vM= X-Google-Smtp-Source: ANB0VdZI120x0VHUXWNAWmRFu+EcW5fHDIy9v8o9znsWpScJc35G4xbJN0WpuA+55izJLaYmVUDo5Q== X-Received: by 2002:a1c:32c4:: with SMTP id y187-v6mr4447461wmy.31.1535968931627; Mon, 03 Sep 2018 03:02:11 -0700 (PDT) Received: from Red.localdomain ([2a01:cb1d:147:7200:2e56:dcff:fed2:c6d6]) by smtp.googlemail.com with ESMTPSA id k34-v6sm31773936wre.18.2018.09.03.03.02.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Sep 2018 03:02:10 -0700 (PDT) From: Corentin Labbe To: axboe@kernel.dk, hdegoede@redhat.com, mark.rutland@arm.com, maxime.ripard@bootlin.com, robh+dt@kernel.org, wens@csie.org Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Corentin Labbe Subject: [PATCH v5 4/9] ata: ahci_platform: add support for PHY controller regulator Date: Mon, 3 Sep 2018 12:01:56 +0200 Message-Id: <20180903100201.23131-5-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180903100201.23131-1-clabbe.montjoie@gmail.com> References: <20180903100201.23131-1-clabbe.montjoie@gmail.com> Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org The SoC R40 AHCI controller need a PHY regulator to work. But since the PHY is embedded in the controller, we cannot do a DT node for it, since phy-supply works only in node with a PHY compatible. So this patch adds a way to add an optional phy-supply regulator on AHCI controller node. Signed-off-by: Corentin Labbe --- drivers/ata/ahci.h | 1 + drivers/ata/libahci_platform.c | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h index 1415f1012de5..ef356e70e6de 100644 --- a/drivers/ata/ahci.h +++ b/drivers/ata/ahci.h @@ -353,6 +353,7 @@ struct ahci_host_priv { struct reset_control *rsts; /* Optional */ struct regulator **target_pwrs; /* Optional */ struct regulator *ahci_regulator;/* Optional */ + struct regulator *phy_regulator;/* Optional */ /* * If platform uses PHYs. There is a 1:1 relation between the port number and * the PHY position in this array. diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c index a886b61476a3..dc4d79b1c9ae 100644 --- a/drivers/ata/libahci_platform.c +++ b/drivers/ata/libahci_platform.c @@ -157,6 +157,12 @@ int ahci_platform_enable_regulators(struct ahci_host_priv *hpriv) return rc; } + if (hpriv->phy_regulator) { + rc = regulator_enable(hpriv->phy_regulator); + if (rc) + goto disable_ahci_pwrs; + } + for (i = 0; i < hpriv->nports; i++) { if (!hpriv->target_pwrs[i]) continue; @@ -173,6 +179,9 @@ int ahci_platform_enable_regulators(struct ahci_host_priv *hpriv) if (hpriv->target_pwrs[i]) regulator_disable(hpriv->target_pwrs[i]); + if (hpriv->phy_regulator) + regulator_disable(hpriv->phy_regulator); +disable_ahci_pwrs: if (hpriv->ahci_regulator) regulator_disable(hpriv->ahci_regulator); return rc; @@ -198,6 +207,8 @@ void ahci_platform_disable_regulators(struct ahci_host_priv *hpriv) if (hpriv->ahci_regulator) regulator_disable(hpriv->ahci_regulator); + if (hpriv->phy_regulator) + regulator_disable(hpriv->phy_regulator); } EXPORT_SYMBOL_GPL(ahci_platform_disable_regulators); /** @@ -430,6 +441,15 @@ struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev, hpriv->ahci_regulator = NULL; } + hpriv->phy_regulator = devm_regulator_get_optional(dev, "phy"); + if (IS_ERR(hpriv->phy_regulator)) { + rc = PTR_ERR(hpriv->phy_regulator); + if (rc == -EPROBE_DEFER) + goto err_out; + rc = 0; + hpriv->phy_regulator = NULL; + } + if (flags & AHCI_PLATFORM_GET_RESETS) { hpriv->rsts = devm_reset_control_array_get_optional_shared(dev); if (IS_ERR(hpriv->rsts)) { From patchwork Mon Sep 3 10:01:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 965356 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-ide-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="laD9dgft"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 423lrn2SDlz9s1x for ; Mon, 3 Sep 2018 20:02:49 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727769AbeICOVl (ORCPT ); Mon, 3 Sep 2018 10:21:41 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:53679 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727636AbeICOVk (ORCPT ); Mon, 3 Sep 2018 10:21:40 -0400 Received: by mail-wm0-f65.google.com with SMTP id b19-v6so547421wme.3; Mon, 03 Sep 2018 03:02:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RUdmpyjvYH/P3gTVki1Kcr+96q6wklBBPgCeGs+6Dmc=; b=laD9dgftVxceZOvDHfCHlcltULXv1fqRzKjtuF6i1CuYCH/3IpLneIU0UA4HTWLzbm k7/KWF2eyedhidhT7l8W32vTlv/h6ybsNUqQ8XjhXKsPQIL2jwEMbZK9JkJAeP8oRTMp qtxIfTf4Xe9bG+2LoPGO5i7T1WKibKTBMdw7e85Dxt98zyvdOpHGBWdcZz5wEGhhxtuC xPt4t22anO0uGSCM0Ghc5YX9pyZzcBYVBWuBAa5UKUdfEV6eAiha9zB8YTjWTWSs1bqC lwdGAFQsJ1Clf7KWTH97gmoIQ6Bl6TPY+/21UW3JLhiJipizln9AfdYWnDldNzBxyFiI T+lA== 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=RUdmpyjvYH/P3gTVki1Kcr+96q6wklBBPgCeGs+6Dmc=; b=p5jwA1njYneRudRMErrjbrYV0UrkyWuhSIw9MEq///cZzOXPeOUdvIVCEfH+VwhNx1 5ZePCadHSNjptQpkIl+VCeCETclL1k7ALb3QlGqskDW/zRv4keA4W7UAFVFKgdijihbw 9XLMbg2CV7rqKs9BYsvFyL/g24t5HeV2aVntzNcutgg9zzR9jEq2xxpwjD55ohxmN9GK 3IvlmRcxCNOx9Mevkzqs2SJIAJe4geech6DmXM1PQzW3Byh5XV7SXlEM2IKKOnNqVDCe SWasKa2ejX4kv8IT+D1aFVTsv5M1vOOOStK7tpsTxkChDf0XlIeKLoXg6ITGqThtPtNg wbCw== X-Gm-Message-State: APzg51AHRYR/YvVSU+CeJzpUZfz5PhF0Q6ctO1mpkSa7muPbpEuibgKO W3/w0s0HATVp53riClhH8GEos+ir X-Google-Smtp-Source: ANB0VdYO7WlmRYurEh9tWRufF7iTZ5egaNo4eHQzghRCOy6uc+EMDSvuAWuAJCI1AcCDdzcCYZnuJg== X-Received: by 2002:a1c:2e11:: with SMTP id u17-v6mr4638794wmu.102.1535968933093; Mon, 03 Sep 2018 03:02:13 -0700 (PDT) Received: from Red.localdomain ([2a01:cb1d:147:7200:2e56:dcff:fed2:c6d6]) by smtp.googlemail.com with ESMTPSA id k34-v6sm31773936wre.18.2018.09.03.03.02.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Sep 2018 03:02:12 -0700 (PDT) From: Corentin Labbe To: axboe@kernel.dk, hdegoede@redhat.com, mark.rutland@arm.com, maxime.ripard@bootlin.com, robh+dt@kernel.org, wens@csie.org Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Corentin Labbe Subject: [PATCH v5 5/9] dt-bindings: ata: ahci-platform: document phy-supply Date: Mon, 3 Sep 2018 12:01:57 +0200 Message-Id: <20180903100201.23131-6-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180903100201.23131-1-clabbe.montjoie@gmail.com> References: <20180903100201.23131-1-clabbe.montjoie@gmail.com> Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org This patch document the new optional phy-supply. Signed-off-by: Corentin Labbe --- Documentation/devicetree/bindings/ata/ahci-platform.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/ata/ahci-platform.txt b/Documentation/devicetree/bindings/ata/ahci-platform.txt index f495774c8af9..45b451961612 100644 --- a/Documentation/devicetree/bindings/ata/ahci-platform.txt +++ b/Documentation/devicetree/bindings/ata/ahci-platform.txt @@ -31,6 +31,7 @@ Optional properties: - clocks : a list of phandle + clock specifier pairs - resets : a list of phandle + reset specifier pairs - target-supply : regulator for SATA target power +- phy-supply : regulator for PHY power - phys : reference to the SATA PHY node - phy-names : must be "sata-phy" - ahci-supply : regulator for AHCI controller From patchwork Mon Sep 3 10:01:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 965355 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-ide-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="dkY7GaVz"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 423lrj6hRRz9s55 for ; Mon, 3 Sep 2018 20:02:45 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727795AbeICOVl (ORCPT ); Mon, 3 Sep 2018 10:21:41 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:50566 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727126AbeICOVl (ORCPT ); Mon, 3 Sep 2018 10:21:41 -0400 Received: by mail-wm0-f65.google.com with SMTP id s12-v6so564080wmc.0; Mon, 03 Sep 2018 03:02:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=tfuzh9T+CpyAPnemdnqeg4728XIZ30noV5zNc4YBbSs=; b=dkY7GaVzP2wLdFWCwyAMlswzjqggspJYq8VFG7wQe9/IZAXX6xJqJKxB783tYp23mG hhrySEyAMj/TN6r9QQGrQY2JhGI1vt/BEKEl3tLe/UQjfuzy9GhfLlZCMmDvURdr9zY5 yTDgyt/3Gov6fU4iL/zfEE6ntECK1PkvNmryp5djRcGbGcxOXxYVyoFD4J4hNk+a+ODb RdNHA6zniX6ngL7ElgrsP9Qb7xNWzoSXu+Zbzb08lESQ7ptWki58I/YZiG2jeH2S80G5 HJKyNyJd9F3fUXAkyR7w/snERMA1yAZShXQi0E2JyNilVXqEWYNmzaEdufWSlVSivwSZ 8C8w== 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=tfuzh9T+CpyAPnemdnqeg4728XIZ30noV5zNc4YBbSs=; b=OQSz/IBfOqs1HnU01j6vezhFQp3H7YW4Ptl2ppkFSIDklJ92QgqzU+uxijGcI/PPNJ btzzIiaBrGqpWyntIp9o6FecRnueGouq84XR99acyTi4dCtRpEqH/Nb5YZEoZ+TkAfcj faOWynZtuGLoRcFSBVn2U2yfr8g1jxVT2Jcc82dtlL6INnwaJ431UWS5RZzBS9VdQTsh smqAj05HF0vdjKg+0y5F9+8k9F+pU8HPdfd2eJnmgx3HRto5TYrarv69wVoLL0gne0ik DoDlhlDfpzOPT6adN/kD9+UmQ240rn5VnrjzeoN6sfkl20rxi4AdJ90yqA575aQ3upPB Qu0Q== X-Gm-Message-State: APzg51DOHfVlhdkeN5DJ8rR4O25c4wrnbYrwVt4HEvpueBOPIPQw/Bnf Qz+9JdGBkrfhGVMi+YYd83Y= X-Google-Smtp-Source: ANB0VdZpQGuSBITo3ceVBcWUmYxP6UpkNxPjKYVo2cynUaeXk/8PYnZXGOxJoI86W7paaHTYauwDxA== X-Received: by 2002:a1c:b441:: with SMTP id d62-v6mr4695405wmf.17.1535968934457; Mon, 03 Sep 2018 03:02:14 -0700 (PDT) Received: from Red.localdomain ([2a01:cb1d:147:7200:2e56:dcff:fed2:c6d6]) by smtp.googlemail.com with ESMTPSA id k34-v6sm31773936wre.18.2018.09.03.03.02.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Sep 2018 03:02:13 -0700 (PDT) From: Corentin Labbe To: axboe@kernel.dk, hdegoede@redhat.com, mark.rutland@arm.com, maxime.ripard@bootlin.com, robh+dt@kernel.org, wens@csie.org Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Corentin Labbe Subject: [PATCH v5 6/9] ata: ahci_sunxi: add support for r40 Date: Mon, 3 Sep 2018 12:01:58 +0200 Message-Id: <20180903100201.23131-7-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180903100201.23131-1-clabbe.montjoie@gmail.com> References: <20180903100201.23131-1-clabbe.montjoie@gmail.com> Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org This patch add the r40 compatible to the ahci_sunxi's supported list of compatible. Since R40 need ahci_platform to handle the reset controller, we also add the new AHCI_PLATFORM_GET_RESETS flag for ahci_platform_get_resources(). This has no consequence for older platform (a10, a20) since the reset is optional. Signed-off-by: Corentin Labbe --- drivers/ata/ahci_sunxi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/ata/ahci_sunxi.c b/drivers/ata/ahci_sunxi.c index 631610b72aa5..911710643305 100644 --- a/drivers/ata/ahci_sunxi.c +++ b/drivers/ata/ahci_sunxi.c @@ -181,7 +181,7 @@ static int ahci_sunxi_probe(struct platform_device *pdev) struct ahci_host_priv *hpriv; int rc; - hpriv = ahci_platform_get_resources(pdev, 0); + hpriv = ahci_platform_get_resources(pdev, AHCI_PLATFORM_GET_RESETS); if (IS_ERR(hpriv)) return PTR_ERR(hpriv); @@ -250,6 +250,7 @@ static SIMPLE_DEV_PM_OPS(ahci_sunxi_pm_ops, ahci_platform_suspend, static const struct of_device_id ahci_sunxi_of_match[] = { { .compatible = "allwinner,sun4i-a10-ahci", }, + { .compatible = "allwinner,sun8i-r40-ahci", }, { }, }; MODULE_DEVICE_TABLE(of, ahci_sunxi_of_match); From patchwork Mon Sep 3 10:01:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 965350 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-ide-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="S2/ZIJCi"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 423lrC50cNz9s55 for ; Mon, 3 Sep 2018 20:02:19 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727815AbeICOVn (ORCPT ); Mon, 3 Sep 2018 10:21:43 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:52354 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727636AbeICOVm (ORCPT ); Mon, 3 Sep 2018 10:21:42 -0400 Received: by mail-wm0-f67.google.com with SMTP id y139-v6so536542wmc.2; Mon, 03 Sep 2018 03:02:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=sz99Ed4cFqHyXgEVj3BM7faY7Awz0qAK84Sc1hbiz1k=; b=S2/ZIJCiEXJjhxXnVeHi+pLSw3LwTTWpDMaaNjklWtYTVm10+efVbe3sykAGxVbuQP gAaQ48ck4Rrqr1UW7OKRa967JWbD49cFo68ykrQqdtfsmRzV7tZJocaoENvFH9Ab+wGJ chuI3cCXIDznKsrmTZL0jKArWuOFHM8/euRo7yXtDF6lVM/J2YEjprSNIwSuporMrpnV 765qGuaQX6PKlRgRD8Ns07+z1z3UamALBztNeJbmY7Cn9IWlr3mK/9iq3TOobGpwqamj C6IQwa1Gt2h0nFKW6rGW/k7aw7qJarrJgTZqOrd6QMxWW9thgY7lPRgQDlQjfmQCYR61 s2Vw== 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=sz99Ed4cFqHyXgEVj3BM7faY7Awz0qAK84Sc1hbiz1k=; b=hY5859sVTZ8tdNk60m25D0gi4Mx9eMtef0viaNENNQHUU38ndH0/Habpz5C0AH0gaZ yFBSKbPruThJruZMgQxiIPrxPinXNW9vrRrBiCHEE7uxdjrVPtyBRpzba/8Td0nmY4ld aJh8YFgPVzJegABNjpaDT/HqITX6BfGJWt6M/zu9nPQQWZF8oyfglyb+I3758J6NDxmo koo/vlJrJlxUaG2RCUiKADArgoDjlKTb/YFZbDTOVckqHQpd/cDCQRxyUseAFn0kbJMZ 8JQeVctZQz3yOvbmjOGpW8plPuvZdqjSL4v1z8LMLnllehtoCKsBcX6VFhv4gl8WGVLr xIgQ== X-Gm-Message-State: APzg51Dl9yK9PAufZk9TebUCxMjVRzB2fRGRxcQhsfI6iJ3pXWN2diXT xnkRxPA60QcyzkXBb24J09k= X-Google-Smtp-Source: ANB0VdbnQ4DGqks37mn1q9DRTmofyTEpSofTDMg1HggzCg2Xp6sbNUIYPT285kUa1RnATH0fOvj9aw== X-Received: by 2002:a1c:1805:: with SMTP id 5-v6mr4397863wmy.25.1535968935782; Mon, 03 Sep 2018 03:02:15 -0700 (PDT) Received: from Red.localdomain ([2a01:cb1d:147:7200:2e56:dcff:fed2:c6d6]) by smtp.googlemail.com with ESMTPSA id k34-v6sm31773936wre.18.2018.09.03.03.02.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Sep 2018 03:02:15 -0700 (PDT) From: Corentin Labbe To: axboe@kernel.dk, hdegoede@redhat.com, mark.rutland@arm.com, maxime.ripard@bootlin.com, robh+dt@kernel.org, wens@csie.org Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Corentin Labbe Subject: [PATCH v5 7/9] dt-bindings: ata: update ahci_sunxi bindings Date: Mon, 3 Sep 2018 12:01:59 +0200 Message-Id: <20180903100201.23131-8-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180903100201.23131-1-clabbe.montjoie@gmail.com> References: <20180903100201.23131-1-clabbe.montjoie@gmail.com> Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org This patch update binding with the new R40 compatible. Signed-off-by: Corentin Labbe Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/ata/ahci-platform.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/ata/ahci-platform.txt b/Documentation/devicetree/bindings/ata/ahci-platform.txt index 45b451961612..e30fd106df4f 100644 --- a/Documentation/devicetree/bindings/ata/ahci-platform.txt +++ b/Documentation/devicetree/bindings/ata/ahci-platform.txt @@ -10,6 +10,7 @@ PHYs. Required properties: - compatible : compatible string, one of: - "allwinner,sun4i-a10-ahci" + - "allwinner,sun8i-r40-ahci" - "brcm,iproc-ahci" - "hisilicon,hisi-ahci" - "cavium,octeon-7130-ahci" @@ -44,6 +45,7 @@ Required properties when using sub-nodes: - #address-cells : number of cells to encode an address - #size-cells : number of cells representing the size of an address +For allwinner,sun8i-r40-ahci, the reset propertie must be present. Sub-nodes required properties: - reg : the port number From patchwork Mon Sep 3 10:02:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 965352 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-ide-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Da0LDtvU"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 423lrS0qjFz9s1x for ; Mon, 3 Sep 2018 20:02:32 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727835AbeICOVo (ORCPT ); Mon, 3 Sep 2018 10:21:44 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:46633 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727126AbeICOVn (ORCPT ); Mon, 3 Sep 2018 10:21:43 -0400 Received: by mail-wr1-f65.google.com with SMTP id a108-v6so17172782wrc.13; Mon, 03 Sep 2018 03:02:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=UNiJvsSjjdgkQ1ZQoChwHdQ+/Jgt1wIrgsMDUlZYcDA=; b=Da0LDtvUx2ZakB3RYUo5s50VYBxKrxaxV+rN/HJEZP6SHYGGVcSrxGBYkVVFuMkMGK +dZ4PFxRXHuinvFrz2NSHlL6k/o/UB/YrXcn4QG1DJkvyuwRfX2bN1vablMwBV49QSyj XwjLVLlKhF6uFG0A5JCkMvIy1O4/XiJ0o7eFc3J5GCqn578gGR+Fr+LINYLX3IRHVoNX KN20NGujdnZC8PY21heiL2hKIOMpmjFNSml33FC71sQNXceZPqA6zjckHFG47mEriDqC dMiRnnrUizmsNroMIjSt4wFl4jBng3f7bYzftyzYnSe9tO6zYFr1hD0qzSGUkx7rBcJv yoIw== 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=UNiJvsSjjdgkQ1ZQoChwHdQ+/Jgt1wIrgsMDUlZYcDA=; b=F9zcGqSFz8A4ddvzXRSFMLwWe3NF0EHSsyFCj3oV5WIWnEvvopZWoR1YC1uU3Y7q5j bwn2Llg1AobJxeBhzQ/WjBAEpRDHgVFDeWjFlcHrrqwsdKrsO9Kz9rEn9SfqLdJDHOqZ IzazOeZanuf2InsEkDOKwYnP7mtiOUBQOqO+I7CAnQBFUoTk/NAs2Nesre1FJN9BaCdx hV1q5QbdlpFhvDPu67NSwDdlp+79pPY0TGysX4wOM/Pjqz08je7aQQt1SFFHxT6RFXRi 7HoLRrO/fB7cLdOXvupCmWgHDTuq0YJqGr/t5mKC1WFtB8N1oqWVKUKha1ShyNbMfdhk aXjg== X-Gm-Message-State: APzg51BR1HM++MZJqQT/xFgEPkXQ3dFX9XBptoIZcDEInppDzt23ihbr 3t7QI2J5NEtYpS1q19GPv0E= X-Google-Smtp-Source: ANB0VdaNyNMsh0OqKfQXULzzxhfM4EIKfWqEDJ0m/NjlNsFiVZriZMTIOdT+FGXBpQeEF34mD+zj4Q== X-Received: by 2002:adf:e792:: with SMTP id n18-v6mr7407609wrm.136.1535968937245; Mon, 03 Sep 2018 03:02:17 -0700 (PDT) Received: from Red.localdomain ([2a01:cb1d:147:7200:2e56:dcff:fed2:c6d6]) by smtp.googlemail.com with ESMTPSA id k34-v6sm31773936wre.18.2018.09.03.03.02.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Sep 2018 03:02:16 -0700 (PDT) From: Corentin Labbe To: axboe@kernel.dk, hdegoede@redhat.com, mark.rutland@arm.com, maxime.ripard@bootlin.com, robh+dt@kernel.org, wens@csie.org Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Corentin Labbe , Icenowy Zheng Subject: [PATCH v5 8/9] ARM: dts: sun8i: r40: add sata node Date: Mon, 3 Sep 2018 12:02:00 +0200 Message-Id: <20180903100201.23131-9-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180903100201.23131-1-clabbe.montjoie@gmail.com> References: <20180903100201.23131-1-clabbe.montjoie@gmail.com> Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org R40 have a sata controller which is the same as A20. This patch adds a DT node for it. Signed-off-by: Icenowy Zheng Signed-off-by: Corentin Labbe --- arch/arm/boot/dts/sun8i-r40.dtsi | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arch/arm/boot/dts/sun8i-r40.dtsi b/arch/arm/boot/dts/sun8i-r40.dtsi index 852c2ccc3268..d27c522e1918 100644 --- a/arch/arm/boot/dts/sun8i-r40.dtsi +++ b/arch/arm/boot/dts/sun8i-r40.dtsi @@ -550,6 +550,19 @@ #size-cells = <0>; }; + ahci: sata@1c18000 { + compatible = "allwinner,sun8i-r40-ahci"; + reg = <0x01c18000 0x1000>; + interrupts = ; + clocks = <&ccu CLK_BUS_SATA>, <&ccu CLK_SATA>; + resets = <&ccu RST_BUS_SATA>; + resets-name = "ahci"; + #address-cells = <1>; + #size-cells = <0>; + status = "disabled"; + + }; + gmac: ethernet@1c50000 { compatible = "allwinner,sun8i-r40-gmac"; syscon = <&ccu>; From patchwork Mon Sep 3 10:02:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 965351 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-ide-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="J1X5KvpQ"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 423lrN4rmjz9s1x for ; Mon, 3 Sep 2018 20:02:28 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727858AbeICOVr (ORCPT ); Mon, 3 Sep 2018 10:21:47 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:41249 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727636AbeICOVp (ORCPT ); Mon, 3 Sep 2018 10:21:45 -0400 Received: by mail-wr1-f65.google.com with SMTP id z96-v6so6618wrb.8; Mon, 03 Sep 2018 03:02:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Yco3GuOwe1ADSho8sukxLRIOHQlCReJ4bgpdQLYejFc=; b=J1X5KvpQE8zgQgmc2/vQAmiKvPlYH1gGdMjr9Zuw9Y4Dos/aMtoSMHUNUhFqFXqeGd T3F8YIahgkY940DbwdulOsuINGsKtknyxXi1kvQpljEe4rM7fat35dAT+SWAt8J9vV3s 7KVWYEmTaWvqHrjvfPUcKYav5YtxbOqh7/w+qM3qI4U6VrnLNjJsgzr95uDgM2KQJ6k0 cnlooSaxrl5xHSkxW1DnZ73wVmzOjRbFWDo00o53FjBpoNaTQjix3YcAuGYbzqZZKtgn O7JBlpXiDHNSvGp+kmub0iow0Oi3DckfbwIeZxwSqJVqHMXDPObNVbpbl3azYMdcCA0h 4bpg== 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=Yco3GuOwe1ADSho8sukxLRIOHQlCReJ4bgpdQLYejFc=; b=lLDnnboDMgh1ilM5L8NV7vmfpHxsxpbG5jAk3NJdUs69/AN9IjwNlKxfqJrSf7oICr 7PQbkIvJyHAQDX0GVv/61vEVEAuqLaxAuVMLARKGwlrlOeXE6y+7khQTjdO/hxpcgP0m szdt/SPalMYExt2gK4CElCa9lfRI2vBSeE12ZImdzbCa7tsmnMU+TmnnQC0MGC0JBNU6 c/8BFxqswHXZ3YwxDl/vU/vRWMhgCaFCg3UXpF8aFkay1HOZ0bpvcp773JhZvQu1ecW4 RnRNM4gbqkOOvhZjWAo+kyUkhd05Jr/vwSiYKnU6h92AgPhvhnI9VL3VSRrV1UmDmQ4I df4g== X-Gm-Message-State: APzg51DEmcW0MEO7REU+Kw1sLClslTEQOy7UpTonoc6DuV88pHGBrMsF LEeHVz5KTgnPMAIRor2YkGE= X-Google-Smtp-Source: ANB0VdYcw7DcZk2D5RcjweU2/i4DeLxR20feymZy2BW1uejbAnCva4EEXUo8FY/IQzBQh93UZ3UD+w== X-Received: by 2002:adf:e084:: with SMTP id c4-v6mr17993852wri.199.1535968938709; Mon, 03 Sep 2018 03:02:18 -0700 (PDT) Received: from Red.localdomain ([2a01:cb1d:147:7200:2e56:dcff:fed2:c6d6]) by smtp.googlemail.com with ESMTPSA id k34-v6sm31773936wre.18.2018.09.03.03.02.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Sep 2018 03:02:17 -0700 (PDT) From: Corentin Labbe To: axboe@kernel.dk, hdegoede@redhat.com, mark.rutland@arm.com, maxime.ripard@bootlin.com, robh+dt@kernel.org, wens@csie.org Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Corentin Labbe Subject: [PATCH v5 9/9] ARM: dts: sun8i: sun8i-r40-bananapi-m2-ultra: enable AHCI Date: Mon, 3 Sep 2018 12:02:01 +0200 Message-Id: <20180903100201.23131-10-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180903100201.23131-1-clabbe.montjoie@gmail.com> References: <20180903100201.23131-1-clabbe.montjoie@gmail.com> Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org This patch enable the AHCI controller. Since this controller need two regulator, this patch add them. Signed-off-by: Corentin Labbe --- arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts index a891a387e8f1..438b7b44dab3 100644 --- a/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts +++ b/arch/arm/boot/dts/sun8i-r40-bananapi-m2-ultra.dts @@ -105,6 +105,12 @@ }; }; +&ahci { + ahci-supply = <®_dldo4>; + phy-supply = <®_eldo3>; + status = "okay"; +}; + &de { status = "okay"; }; @@ -250,6 +256,18 @@ regulator-name = "vcc-wifi"; }; +®_dldo4 { + regulator-min-microvolt = <2500000>; + regulator-max-microvolt = <2500000>; + regulator-name = "vdd2v5-sata"; +}; + +®_eldo3 { + regulator-min-microvolt = <1200000>; + regulator-max-microvolt = <1200000>; + regulator-name = "vdd1v2-sata"; +}; + &tcon_tv0 { status = "okay"; };