From patchwork Sat Feb 17 10:01:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 202595 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp241204dyc; Sat, 17 Feb 2024 02:03:15 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWjDkfjZ/ik5Kwap5vjzgy3bjHFBdAKpBGB+lmjNl7o8mpzQMFJ2uaBOHca816tA+SZh6LWR51j/J8jXB87G7Dwnt9+Bw== X-Google-Smtp-Source: AGHT+IHcWmiXHXl3vtEdRv2IvIUFSJ4eCElgBWbc+/FkTdg+MOcvE7SLD5eOA+FFOEsF/f4KPzP/ X-Received: by 2002:a17:90b:1d8a:b0:299:43fd:e967 with SMTP id pf10-20020a17090b1d8a00b0029943fde967mr3647542pjb.18.1708164195566; Sat, 17 Feb 2024 02:03:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708164195; cv=pass; d=google.com; s=arc-20160816; b=OPvHWeeXJLrXl32e3af3biNS4S2mkoanmcACbn//lwF4CnBEsGoCxjbzQERP83GrS6 kivF7PVLN38trhC5KaC4EC5q4kUcQ+G3yUJ6lRX+onIHgxQEOvjBelZBY42/YMSskMy+ lM/u4rm/tUCZYcyL7OYtZPmsGPvhtF+16bnCMgP/kKjwh0xep3Z2lYk2kG2WV9yCd5W8 KNfqLlLkJ/qrulS/rj8oRH4iPR+yBUV5OtiAXmGM4ZVcY3XJPrxTvCiKOboJN5IpHomT 9mIeSqXxw9NCUkNS/7RlpIUpnaNh9p9xNzyUyIsBxX8VwF+AuKhKCEikeKu5WVT7/dJb uNHQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=3ZM66OWGdF6SbtT/QLY8tKqxblTioRIXbDjnM5RGQoM=; fh=4dscvFdFMvGz/PG0e113nJ1CTx5PMT2YRky1pQgLtsM=; b=oW/f9FBU7wcEB6tLxAO3i7HDYVYNzPg5xxmQYUW6vsP1DQ+IxCRKZJjfH9p/IVeV/J fdODvN0QMKyPFKF6zRLAoI+gicqoBXsRat0cEEv2FILCPmZQypBtZH6XlfZr6/QQN0MC 5gXZ/8xeoCWsgnPxZTuLdoyBr3Ti51YBwCtfyW6l0LAgJ7fyjDX2L33CZfUtv6iwbmA7 Z1LsfzP8A4YG4pbvQ2cT8Ju4tw0AScmWkHmjST7vrM8bPlXAsSIm2MkDaluCjRLEd7bz 8/9e7tWMTKk8zEPIg+cubkpEK9NCg32Y+Yo1nLduIbRPw0373+yY1F7E8o3WLMDC6t+b 75TQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20230601 header.b=fxHMZSJZ; arc=pass (i=1 spf=pass spfdomain=googlemail.com dkim=pass dkdomain=googlemail.com dmarc=pass fromdomain=googlemail.com); spf=pass (google.com: domain of linux-kernel+bounces-69783-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69783-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id mw7-20020a17090b4d0700b002996e7f8d58si45046pjb.13.2024.02.17.02.03.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Feb 2024 02:03:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-69783-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@googlemail.com header.s=20230601 header.b=fxHMZSJZ; arc=pass (i=1 spf=pass spfdomain=googlemail.com dkim=pass dkdomain=googlemail.com dmarc=pass fromdomain=googlemail.com); spf=pass (google.com: domain of linux-kernel+bounces-69783-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69783-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id A4D22B21736 for ; Sat, 17 Feb 2024 10:03:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D85EE200C7; Sat, 17 Feb 2024 10:02:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=googlemail.com header.i=@googlemail.com header.b="fxHMZSJZ" Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 83C241C69F; Sat, 17 Feb 2024 10:02:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708164141; cv=none; b=QJ6oIVGgA53oAcpKGS6VoqiNtC+KLwRApe4CRln6qJO0/LqhWEJvtb+eaLx+PJKQ4NdbrBIBdYUK3IiCYtsl9l07kDYI9OJ0BtvOFS7PRoGC918oceV0jT6X+y8hTy8BXw76ujEeGVfCDV1+MKywbDBjCble/G7t+ZQ164MtFwI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708164141; c=relaxed/simple; bh=USFCdbHyoE8FKG3GAqIj7/95rop2cgT/ZVVdnVi+iQg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=UReHqVt3LBbZWNAhlhj/wPlyD+v3m/4mtiTCvtzF+Tpp3tudXAylndgF9v3jOeE5kxytDXp9pb/pa+cBEU2eoOy0Tb+k3cDOdXE5M4y8hLqa0PUaSHvejP1JLA1kbYm6sv7XA846std0U8OSyZBQ0bhJjnH+2ZmbezC/TTOBaZ4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=googlemail.com; spf=pass smtp.mailfrom=googlemail.com; dkim=pass (2048-bit key) header.d=googlemail.com header.i=@googlemail.com header.b=fxHMZSJZ; arc=none smtp.client-ip=209.85.218.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=googlemail.com Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-a3de25186fbso164053166b.0; Sat, 17 Feb 2024 02:02:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20230601; t=1708164134; x=1708768934; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3ZM66OWGdF6SbtT/QLY8tKqxblTioRIXbDjnM5RGQoM=; b=fxHMZSJZugBa6NBkOjCCOBIlcIKcfLmcPPjlHm43IvKp0NHKKEahswCttp7CZOWwbQ B4SQgZhDl7lGkihp7MsAuGwUR1EreMgctd9CcRi/3PucY5X+ncCVzOhqnUKsVQ+0wlz6 EV8SLle20BvJNn640Qw7B0avj3/d/SpNM8HMCkvuUM9UBuTs67gGfFznGOCmvaS/W0DA AgbrKeatPJEmmr+/GJACkS+bx2BQj840rtxU7JDPDiu5TLI24kJ0o4SzUajZXLeqyBYz +uLWwOO1WeF9IyVrCiamup1i2YFkaGoCGy7GmkDo5EFM3qUqgvlkPpUxMoScOCNNUMZB JihA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708164134; x=1708768934; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3ZM66OWGdF6SbtT/QLY8tKqxblTioRIXbDjnM5RGQoM=; b=DMWpjMym3hkLL3gHfRNBHgtzIwZAQ84eV+H7e9WLFtPVKB6jeg9YF2WUxlWMXRUnE2 fy6dDA3ltpNkrU2kwouVHYALmbWYMvgSHI8q4aSgs9eb/iJMRlO0/ETgjit3geIYG82w nvU0fwkRX1KeERdNb5KD1Wmc0FQm5hyZPWeTHEArkTr01tmRZLoCwDhdYr6onLWatH8w RsK7lPp4VInsJ92v0fHM8lyYtkGzPeT6uDFMZrN+Qvo/7R+6IcgnkdAhWZP6cxI6CgcJ jrmffDZ2whptTGFnWQQZUpgsIp1ZL1285ot0SL9iqFxWfwojLGa9C5xGXMnZqmNmmptv 5oBQ== X-Forwarded-Encrypted: i=1; AJvYcCX3mpjX1pCs+GaQ/YyukTXcYGhXfr5yh6C1LHkz+20OlSyjMoj31JQ7qJww/BSzcTn7FIFBFXEnJhwg/NpGnbRpvqG2eNKdxcMawp3vQKJX1oYKGHUI61cJ7eT7XVMuvUsP5PCZzPVy X-Gm-Message-State: AOJu0Yxd94DLg9i1bRkImkdLfsSi+YYYH2TlpKm++jsT0HGZm4dnrV3j pwdZChmdkPd7QVMwDVsK5pM461iBX4gAlG0m163wFXmPIa3ww8oT0Em1f74b X-Received: by 2002:a17:906:abce:b0:a3e:13f3:e1ab with SMTP id kq14-20020a170906abce00b00a3e13f3e1abmr890687ejb.3.1708164133432; Sat, 17 Feb 2024 02:02:13 -0800 (PST) Received: from localhost.localdomain (dynamic-2a01-0c23-c18b-3d00-0000-0000-0000-0e63.c23.pool.telefonica.de. [2a01:c23:c18b:3d00::e63]) by smtp.googlemail.com with ESMTPSA id vu2-20020a170907a64200b00a3d2e690abfsm832444ejc.122.2024.02.17.02.02.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Feb 2024 02:02:13 -0800 (PST) From: Martin Blumenstingl To: linux-amlogic@lists.infradead.org, linux-mmc@vger.kernel.org, ulf.hansson@linaro.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Martin Blumenstingl Subject: [PATCH v1 1/2] mmc: meson-mx-sdhc: Use devm_clk_hw_get_clk() for clock retrieval Date: Sat, 17 Feb 2024 11:01:59 +0100 Message-ID: <20240217100200.1494980-2-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240217100200.1494980-1-martin.blumenstingl@googlemail.com> References: <20240217100200.1494980-1-martin.blumenstingl@googlemail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791139979293220611 X-GMAIL-MSGID: 1791139979293220611 Now that devm_clk_hw_get_clk() has been available for a while we can resolve an older TODO where this API did not exist yet. No functional changes intended. Signed-off-by: Martin Blumenstingl --- drivers/mmc/host/meson-mx-sdhc-clkc.c | 43 ++++++++++++++------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/drivers/mmc/host/meson-mx-sdhc-clkc.c b/drivers/mmc/host/meson-mx-sdhc-clkc.c index 19200b7079a6..cbd17a596cd2 100644 --- a/drivers/mmc/host/meson-mx-sdhc-clkc.c +++ b/drivers/mmc/host/meson-mx-sdhc-clkc.c @@ -71,12 +71,23 @@ static int meson_mx_sdhc_clk_hw_register(struct device *dev, static int meson_mx_sdhc_gate_clk_hw_register(struct device *dev, const char *name_suffix, struct clk_hw *parent, - struct clk_hw *hw) + struct clk_hw *hw, + struct clk_bulk_data *clk_bulk_data, + u8 bulk_index) { struct clk_parent_data parent_data = { .hw = parent }; + int ret; + + ret = meson_mx_sdhc_clk_hw_register(dev, name_suffix, &parent_data, 1, + &clk_gate_ops, hw); + if (ret) + return ret; + + clk_bulk_data[bulk_index].clk = devm_clk_hw_get_clk(dev, hw, name_suffix); + if (IS_ERR(clk_bulk_data[bulk_index].clk)) + return PTR_ERR(clk_bulk_data[bulk_index].clk); - return meson_mx_sdhc_clk_hw_register(dev, name_suffix, &parent_data, 1, - &clk_gate_ops, hw); + return 0; } int meson_mx_sdhc_register_clkc(struct device *dev, void __iomem *base, @@ -115,7 +126,8 @@ int meson_mx_sdhc_register_clkc(struct device *dev, void __iomem *base, clkc_data->mod_clk_en.bit_idx = 15; ret = meson_mx_sdhc_gate_clk_hw_register(dev, "mod_clk_on", &clkc_data->div.hw, - &clkc_data->mod_clk_en.hw); + &clkc_data->mod_clk_en.hw, + clk_bulk_data, 0); if (ret) return ret; @@ -123,7 +135,8 @@ int meson_mx_sdhc_register_clkc(struct device *dev, void __iomem *base, clkc_data->tx_clk_en.bit_idx = 14; ret = meson_mx_sdhc_gate_clk_hw_register(dev, "tx_clk_on", &clkc_data->div.hw, - &clkc_data->tx_clk_en.hw); + &clkc_data->tx_clk_en.hw, + clk_bulk_data, 1); if (ret) return ret; @@ -131,7 +144,8 @@ int meson_mx_sdhc_register_clkc(struct device *dev, void __iomem *base, clkc_data->rx_clk_en.bit_idx = 13; ret = meson_mx_sdhc_gate_clk_hw_register(dev, "rx_clk_on", &clkc_data->div.hw, - &clkc_data->rx_clk_en.hw); + &clkc_data->rx_clk_en.hw, + clk_bulk_data, 2); if (ret) return ret; @@ -139,18 +153,7 @@ int meson_mx_sdhc_register_clkc(struct device *dev, void __iomem *base, clkc_data->sd_clk_en.bit_idx = 12; ret = meson_mx_sdhc_gate_clk_hw_register(dev, "sd_clk_on", &clkc_data->div.hw, - &clkc_data->sd_clk_en.hw); - if (ret) - return ret; - - /* - * TODO: Replace clk_hw.clk with devm_clk_hw_get_clk() once that is - * available. - */ - clk_bulk_data[0].clk = clkc_data->mod_clk_en.hw.clk; - clk_bulk_data[1].clk = clkc_data->sd_clk_en.hw.clk; - clk_bulk_data[2].clk = clkc_data->tx_clk_en.hw.clk; - clk_bulk_data[3].clk = clkc_data->rx_clk_en.hw.clk; - - return 0; + &clkc_data->sd_clk_en.hw, + clk_bulk_data, 3); + return ret; } From patchwork Sat Feb 17 10:02:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 202596 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp241236dyc; Sat, 17 Feb 2024 02:03:19 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVGYrlAmqNCr44H4bsyVF/UlYrBzxemBYOUZw3Cv8LGGd09iWy5GmzmiNwEmaJQp+MA87A6wxuC+OcaLNaTzEPzQw2y/Q== X-Google-Smtp-Source: AGHT+IG6dWRAtXnSESwZoHAVVOpoCyeK0LVblMljVC3wNg1JuBhHsxMISJmGIJk54FjlTYSoSLgD X-Received: by 2002:a50:fb84:0:b0:564:2518:adfd with SMTP id e4-20020a50fb84000000b005642518adfdmr874715edq.10.1708164199460; Sat, 17 Feb 2024 02:03:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708164199; cv=pass; d=google.com; s=arc-20160816; b=kQKkPpskcnYRR8CqY9TkAR9UW4M7Zt67yRdCNVeA7UmLFYohg5YqvgLJoyEVLDK6fJ UrxZDP/+yLt0wvRTlZvQ6/iAKnv9/RKeoa9ajEhmzE23mtnUIXxdBrXA0bC2Jmxmn5NM 9K2Qd0Xxm1/DQ4RrWqpckHFGw6c2kFqTrWfNxtjJ+sMcAO/LspTay3UQTuO1eopuUXBa XySVrEFxKUoAl5U68JjYzj3rMH1gSs3XStaUoN/8d4Jes6MkV6oxOaG4UOm5P5z2r4Wn EIA/YU5qlrGg/Jzt6YKi/eAEg6VIKBUYYU0vw9sloFYc5GHWayOy1PRoHE1JHc2IpjfT Axfg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=nqfx68Stq1v6Qf4tIPhse4R7f6lQzjIJhU0OnU94194=; fh=EHKOgJmdmpht9PE+IXQYTwcm+mhzf+PgV92P2467Nl4=; b=mo5U/rK2JQK9otIeDSXkWI3N8Q7F9afDNHzogp86KzawXjeYig6EaoDwGs04Wl/hNf o5hBaWvUjBPjkEnn8rJG6rF4WEoj4gzATXFAF838f85A1UmZDNFdK++dEhomoP9HSsrp Lj7oTEm0uftIv7gWY6/0XcTftwg9WIqCVSSkYf6K5JDEuy5gMZ7aSy+JBd5w1sxteYMM uovhoW5NZ5oHl3njAcu+8EmfsVSnKhMDwO9x0W/Y74gETKnMag4eAEGN1iFKSN2f+JJu syLsGeMa0clYswirn+We+VWvq6p2ds7c71ogvrgjFrsVupDdaaauZkjxRXRc/gr0K46B d7Mg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20230601 header.b=UIIUWUCS; arc=pass (i=1 spf=pass spfdomain=googlemail.com dkim=pass dkdomain=googlemail.com dmarc=pass fromdomain=googlemail.com); spf=pass (google.com: domain of linux-kernel+bounces-69784-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69784-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id gy6-20020a0564025bc600b00563d4d9cf60si756201edb.478.2024.02.17.02.03.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Feb 2024 02:03:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-69784-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@googlemail.com header.s=20230601 header.b=UIIUWUCS; arc=pass (i=1 spf=pass spfdomain=googlemail.com dkim=pass dkdomain=googlemail.com dmarc=pass fromdomain=googlemail.com); spf=pass (google.com: domain of linux-kernel+bounces-69784-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69784-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E42471F21FC2 for ; Sat, 17 Feb 2024 10:03:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 570D120312; Sat, 17 Feb 2024 10:02:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=googlemail.com header.i=@googlemail.com header.b="UIIUWUCS" Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0900A1CAA5; Sat, 17 Feb 2024 10:02:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708164141; cv=none; b=FiUetxSgwnh40kk5iPKrzaLHK1t0eR9m7b7eREoYqzFnqTwiE+eXsQ5f8tS+hqPr8/RCAp3OJxmSzIe18MkMFv2zoenKMuUxfXXZg2pxIXfL300B/VBcmLZW2CXgxnRQqeCD3ArnLIt2Oqc47es3+QLfiLuzFAiKKgedKm3URao= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708164141; c=relaxed/simple; bh=c7c1Q3/20PbpOtZUY4apUCKgz6BG6WLPvFsA+YNlXP0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Jl0Uysgbcbh6mJaLATJsqqSin5AqanPilkkA4GeEAwRIXMTTw8Ggprienc0DYSkG+QGMxRAU8o8DNPL04FYi4a6pXHTc8BfWdGAiMueavDPyMDFo1syqI0ZGjAyZ06HtgcRcO1UZe1vAQH+GoUivjfRhMguUYb3G0EydlwJ/eCw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=googlemail.com; spf=pass smtp.mailfrom=googlemail.com; dkim=pass (2048-bit key) header.d=googlemail.com header.i=@googlemail.com header.b=UIIUWUCS; arc=none smtp.client-ip=209.85.218.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=googlemail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=googlemail.com Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-a2f79e79f0cso426924766b.2; Sat, 17 Feb 2024 02:02:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20230601; t=1708164134; x=1708768934; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nqfx68Stq1v6Qf4tIPhse4R7f6lQzjIJhU0OnU94194=; b=UIIUWUCSQLDGpM2qU+d8pfLd7YjfRehKfr7N11eQc5S3EHfZNMejDfQqutXuGRr9Om WfOl/OFU6g4nS7cRT6ewI2a1qdF+FvTKuP56z8d+eyGFJ8hn99YIIkia2GL/Pgf468p3 peijXMuXCLiLJ16E9P2j2uf/UQH7FPKeVgH5eRolokWUJMumE+hmzODJNvQzbHv9ARKy eRMftZ23e+TzWk8rOtRaFYK0zk5Z/blIb6BsFx0mgZnFC5lrjkmNQOK6ALPeKANQvbZM 0oaRKkKW/hVSqfqvN4Vw3koOiOKi/VsC/O9N5XvLct6S8o/fTw+bop/lSIHDxv0b1kcz 6INA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708164134; x=1708768934; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nqfx68Stq1v6Qf4tIPhse4R7f6lQzjIJhU0OnU94194=; b=r60UKr7KBgDwbx5T/N38CeX+iI06uSJ1rd8sycb02b3JebPj46qvyWPPexSNa6EPQe HwjVXl+U/fpK+jZdF1KRCXkLj7QLpmAz1xWKR7lPHvrEpCnRE6maq/moqE7fgl8LsT3r oja205CW0jyn+b5QgzLkvI1yI1Ux8jQM7NdV+z7XYBkKHrab5btBjaZVqFzwnzXqM7HZ OW7xI6RFs5zBg81nd6G5PZ6M0W40Wi2aU5uIpua7ON0kUE6dVIvFREj8kB1cOAtO+Tpn MJYaaUDrQi1J/3W8MvvIT6+D84qe6kH7FOUt3yW2mukN7x05jEfwZBw64wvLIWcRCL2x DdkA== X-Forwarded-Encrypted: i=1; AJvYcCV/+aTxZZfvppDlPpx8lgW2CYG44n1DMeWFMtw25rFvHhqOEYqxn7RmE1uaPtiOezU1Tzph2l75fNw3nB6o9AuypvJBrdTIrZcLMZspICyjtol3mPHB+kifiaBPxKKdfvJdzUm0Vy0v X-Gm-Message-State: AOJu0YzxOjt4byl8W8Wpj/qQf4GwgEgwRfLSNf/7Extwdl0joz86oKGW u5D5/qLBbljMyrtgvSrtOLwPnbLueqAgDffN4kwLbC+gx32xVUKK X-Received: by 2002:a17:906:694b:b0:a3d:590:195e with SMTP id c11-20020a170906694b00b00a3d0590195emr6136810ejs.4.1708164134317; Sat, 17 Feb 2024 02:02:14 -0800 (PST) Received: from localhost.localdomain (dynamic-2a01-0c23-c18b-3d00-0000-0000-0000-0e63.c23.pool.telefonica.de. [2a01:c23:c18b:3d00::e63]) by smtp.googlemail.com with ESMTPSA id vu2-20020a170907a64200b00a3d2e690abfsm832444ejc.122.2024.02.17.02.02.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 17 Feb 2024 02:02:13 -0800 (PST) From: Martin Blumenstingl To: linux-amlogic@lists.infradead.org, linux-mmc@vger.kernel.org, ulf.hansson@linaro.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Martin Blumenstingl Subject: [PATCH v1 2/2] mmc: meson-mx-sdhc: Remove .card_hw_reset callback Date: Sat, 17 Feb 2024 11:02:00 +0100 Message-ID: <20240217100200.1494980-3-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240217100200.1494980-1-martin.blumenstingl@googlemail.com> References: <20240217100200.1494980-1-martin.blumenstingl@googlemail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791139983757919041 X-GMAIL-MSGID: 1791139983757919041 Commit 32f18e596141 ("mmc: improve API to make clear hw_reset callback is for cards") made it clear that the hw_reset callback is intended for resetting the card. Remove the .card_hw_reset callback from the meson-mx-sdhc-mmc driver because it's purpose is to reset the SDHC controller (FIFOs, PHY, DMA interface, ...). While here also rename and change the argument of meson_mx_sdhc_hw_reset so it cannot be called by accident as a replacement for card_hw_reset in the future. Signed-off-by: Martin Blumenstingl --- drivers/mmc/host/meson-mx-sdhc-mmc.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/mmc/host/meson-mx-sdhc-mmc.c b/drivers/mmc/host/meson-mx-sdhc-mmc.c index 1ed9731e77ef..31f750301dc1 100644 --- a/drivers/mmc/host/meson-mx-sdhc-mmc.c +++ b/drivers/mmc/host/meson-mx-sdhc-mmc.c @@ -65,10 +65,8 @@ static const struct regmap_config meson_mx_sdhc_regmap_config = { .max_register = MESON_SDHC_CLK2, }; -static void meson_mx_sdhc_hw_reset(struct mmc_host *mmc) +static void meson_mx_sdhc_reset(struct meson_mx_sdhc_host *host) { - struct meson_mx_sdhc_host *host = mmc_priv(mmc); - regmap_write(host->regmap, MESON_SDHC_SRST, MESON_SDHC_SRST_MAIN_CTRL | MESON_SDHC_SRST_RXFIFO | MESON_SDHC_SRST_TXFIFO | MESON_SDHC_SRST_DPHY_RX | MESON_SDHC_SRST_DPHY_TX | @@ -116,7 +114,7 @@ static void meson_mx_sdhc_wait_cmd_ready(struct mmc_host *mmc) dev_warn(mmc_dev(mmc), "Failed to poll for CMD_BUSY while processing CMD%d\n", host->cmd->opcode); - meson_mx_sdhc_hw_reset(mmc); + meson_mx_sdhc_reset(host); } ret = regmap_read_poll_timeout(host->regmap, MESON_SDHC_ESTA, esta, @@ -127,7 +125,7 @@ static void meson_mx_sdhc_wait_cmd_ready(struct mmc_host *mmc) dev_warn(mmc_dev(mmc), "Failed to poll for ESTA[13:11] while processing CMD%d\n", host->cmd->opcode); - meson_mx_sdhc_hw_reset(mmc); + meson_mx_sdhc_reset(host); } } @@ -495,7 +493,6 @@ static int meson_mx_sdhc_execute_tuning(struct mmc_host *mmc, u32 opcode) } static const struct mmc_host_ops meson_mx_sdhc_ops = { - .card_hw_reset = meson_mx_sdhc_hw_reset, .request = meson_mx_sdhc_request, .set_ios = meson_mx_sdhc_set_ios, .card_busy = meson_mx_sdhc_card_busy, @@ -618,7 +615,7 @@ static irqreturn_t meson_mx_sdhc_irq_thread(int irq, void *irq_data) } if (cmd->error == -EIO || cmd->error == -ETIMEDOUT) - meson_mx_sdhc_hw_reset(host->mmc); + meson_mx_sdhc_reset(host); else if (cmd->data) /* * Clear the FIFOs after completing data transfers to prevent @@ -728,7 +725,7 @@ static void meson_mx_sdhc_init_hw(struct mmc_host *mmc) { struct meson_mx_sdhc_host *host = mmc_priv(mmc); - meson_mx_sdhc_hw_reset(mmc); + meson_mx_sdhc_reset(host); regmap_write(host->regmap, MESON_SDHC_CTRL, FIELD_PREP(MESON_SDHC_CTRL_RX_PERIOD, 0xf) |