Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp162140pxb; Thu, 31 Mar 2022 02:10:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjxe0p7RLq05A43kuqaHzfZNYU1Qu1zO+M7Y3WonccdA1m3A5WUGtdnAhyNFYcFAnPOYiP X-Received: by 2002:a17:90b:1c88:b0:1b8:a77e:c9cb with SMTP id oo8-20020a17090b1c8800b001b8a77ec9cbmr4971131pjb.205.1648717842114; Thu, 31 Mar 2022 02:10:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648717842; cv=none; d=google.com; s=arc-20160816; b=esbqN5WT/Bx6RxgnzwbE6tO6TdT8h0MG26uNlOQaCx6nCRRnfkK2bpxsF8a0K9ztNf IPSnyn4n7+q3JkXLxbPozcZImXNvgp4CNQfrzE/57uVQyFiZm9mmx8oS2BD4fBaLFxSa xcDqqonRKky5k4hfPkDel7FKhPw7+J8VoVEn/2bbKRkEdnU+clzQTJFOrbzIHLe3pWOl RoLbXYyFjVm3Vgct/z1e/lYM7MBNNifzz+MUbt/TIqw/syYCobUKbmhB6HmgFz8XumpX OYCxi/ZZsK6V+eKrsJfAMJX5uuxu66aTUAZ+vVuFgLCp7TGi3QPKVt5qnyMW0DrGppis PFKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=zojte6WNOkLiaTO/tP4KayfUolmOY1CGzzHpNeOnP5k=; b=n/BQJASiee8e6PRn3ttF9pGewpxTZ+WJq2O91n6uyoMFQp23vO4Nm4ozKvRwnPvvIf xZE4R9CrDva52ny+3ksUTlusk0mwyRY9sPTKOo4gdbx8aNY2lNpV4plZ1Ka2AyvR17zn YKR+hds/8BwRQpoIHC15WGcUMCyq+KvmbCfoq7+VXUjGzx/nCPBi7eQFZGTToQb9XiW5 PYp+dwV5Dgb2PK8BNh1h8CeA18t2828yqU+f426aajQIq61vjNDvKyj+cJzhzTx0AOHd TdgzvIc3f7Dh71bUXE2TFM1ltanzuyxoGa9M3Eb8VS/0k2H6vrTUsd0nQdivRSQl/STs UhuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=GMvRcREW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a6-20020a655c86000000b00398cdd42fcdsi171945pgt.293.2022.03.31.02.10.29; Thu, 31 Mar 2022 02:10:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=GMvRcREW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232411AbiCaIAP (ORCPT + 99 others); Thu, 31 Mar 2022 04:00:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbiCaIAM (ORCPT ); Thu, 31 Mar 2022 04:00:12 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B652013EAE for ; Thu, 31 Mar 2022 00:58:23 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: kholk11) with ESMTPSA id 119661F463AE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1648713502; bh=q+KkXh4Pi0KibB5c7kl1SmkyDO/TsKJGH9MCkwBZDHU=; h=From:To:Cc:Subject:Date:From; b=GMvRcREW1cy7oMzB9xtXztHtyYLyMopePT1upmpmVdQUDsKoWudWaIdGFyDAN1dps NUcctXekdvSAi2VJf7bc5ElGnw2PneAE1o7ESKBIEIoXvdEeTQj6jiFoozKShnAxHw tmpYfL2vSdSxvyoNJlT8fje7gyXC3VJWqdtxPAKC6+vlY8d1PbSkEOH2TeWPSzaMSD zUGrJCuYgZHS91v6KDZhv2Lln88+fwyKAVR4HgQQ2Yl6n341xcOlYMpUNK0RtljRNF JZHpbvIIKYQyqGFr7GH923Ta0H73SCYH7Wo4kkFY+5QWaN7SD95UuXsA5P1kNcUlii gnu3ptbYxkzHw== From: AngeloGioacchino Del Regno To: matthias.bgg@gmail.com Cc: linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, nfraprado@collabora.com, AngeloGioacchino Del Regno Subject: [PATCH v2 0/3] MediaTek PMIC Wrap improvements and cleanups Date: Thu, 31 Mar 2022 09:58:14 +0200 Message-Id: <20220331075817.7122-1-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY 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 This series is meant to improve the mtk-pmic-wrap driver; that's done by removing the custom pwrap_wait_for_state() function and correctly using the readx_poll_timeout macro instead, which is doing exactly the same as the former. As also shown in a patch [1] by Zhiyong Tao (MediaTek), performing a tight loop is not desired: because of the operation timing in the SPMI PMICs on these platforms, it makes more sense to wait for some microseconds before trying to read again, reducing CPU busy time around these state waits. For this purpose, a ~10uS delay was chosen. While at it, I also took the occasion to tidy up this driver a little by optimizing its probe() function. [1]: https://patchwork.kernel.org/project/linux-mediatek/patch/20220329115824.13005-2-zhiyong.tao@mediatek.com/ Changes in v2: - Fixed a critical typo in patch 1/3. Thanks Nicolas! AngeloGioacchino Del Regno (3): soc: mediatek: pwrap: Use readx_poll_timeout() instead of custom function soc: mediatek: pwrap: Switch to devm_platform_ioremap_resource_byname() soc: mediatek: pwrap: Move and check return value of platform_get_irq() drivers/soc/mediatek/mtk-pmic-wrap.c | 73 +++++++++++++++------------- 1 file changed, 39 insertions(+), 34 deletions(-) -- 2.35.1