From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C46ABC433FE for ; Mon, 23 May 2022 13:53:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236682AbiEWNxl (ORCPT ); Mon, 23 May 2022 09:53:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236606AbiEWNx1 (ORCPT ); Mon, 23 May 2022 09:53:27 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 481DE5677E; Mon, 23 May 2022 06:53:26 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: kholk11) with ESMTPSA id 97A941F43599 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1653314005; bh=Dz3ZKPQtwBKUhDVWmG5Z5g8SZn+wliMq5r4L/qYaKxs=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=EVl4yiH5zAw6jU/LesJhdcZjrLZJDkNHinjOf4ToLslJ4PlFJ5m4IaXvTcvkLPhw+ JJu5XDjsHAMr713gN3K14F58MK1nRcuE3lIbNjmjJCkDp1hbq9LLXXWZ5SY8L/wq8f E47LCYpkGvzcElhFqW+1zjprXYTK7yF6x5t4D8BQyw74V45JlkAwNiUsmeLKvXjogU JhUArK8+Sw6wgx20cXnvE/PRJID08VdpatPiFR/L56YtsowbVZT3FFn3h+JPAu/n3W 3IvxfTISvT7jpWMDT9rURYT0llP1DNBdCFI+lfjD1F7rXxkvrycHOWzAkJ714LL7Vc HPgSCFXWCA/fw== Message-ID: <8334772a-6427-352d-4172-ca262267427d@collabora.com> Date: Mon, 23 May 2022 15:53:22 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH 2/4] regulator: Add driver for MT6331 PMIC regulators Content-Language: en-US To: Mark Brown Cc: lgirdwood@gmail.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, matthias.bgg@gmail.com, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org References: <20220520133305.265310-1-angelogioacchino.delregno@collabora.com> <20220520133305.265310-3-angelogioacchino.delregno@collabora.com> <6cc68be9-e509-eae4-801d-997fdc01dcf2@collabora.com> From: AngeloGioacchino Del Regno In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Il 23/05/22 15:43, Mark Brown ha scritto: > On Mon, May 23, 2022 at 03:22:39PM +0200, AngeloGioacchino Del Regno wrote: >> Il 23/05/22 15:00, Mark Brown ha scritto: > >>> Right, my point here is that it looks awfully like the documentation >>> (this came from documentation I guess?) is including some extra bits >>> that get ignored in the voltage selection field here. That seems like a >>> weird choice somewhere along the line. > >> I wish I had a datasheet for these parts... > >> All of this comes from analyzing a running device on the downstream 3.4 kernel >> and on understanding the (not really readable) downstream kernel code... >> ..but yes, I agree on the fact that this seems to be a weird choice. > >> Ah, besides, I hooked up an oscilloscope to the VCAM_IO and I can see that the >> vreg really does react as expected upon setting the upper bits.. but since it >> still works without, we can safely ignore them, which makes us able to simplify >> the driver (as no custom code for that will be required) and, at the same time, >> avoid seeing a table of values repeated 4 times in a row. > > That seems safer in general if we don't know what those bits are doing - > it could be some kind of mode control or something. > >> ...so, the regulator will indeed shut itself off and clear either/both the QI_EN >> and/or its relative bit in the enable register... I've also just found hints of >> the latter (enable register being set to 0) downstream, so I'm sure that this is >> indeed right. > > That's still not quite the same thing as a status bit, if the regulator > disables itself then it won't try to turn itself back on. Note that the > core will fall back on using the enable state if there's no status op so > there's no need for this logic, you can just omit the status op and the > behaviour will be the same. Ok then, I'll simply remove that! Thanks, Angelo From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CC4F4C433EF for ; Mon, 23 May 2022 13:54:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MiS5uLErdvOyfTBzqc94g7kKw36hfQgi8vfFR7avL4U=; b=nafWoRopR2dsei RXwjOGyXC33pCpPKCZMmrUPANspN8Hu9Xu2zn1nFX6YN3iG8HuPIMizeUaCWOsVgAbK7emha1zt7P nPMzI3u6dBg4+/q3DOSFcLUdQkY0r52qMHJEApPAcIV3S6KxO/bpaxhphU3NMn/+6r4mJjrLtKQrx Bpa6E1wzJuA68iJxyszWo49m4eCgpdxn9g5/lUF6HGT/wuPy4Nukosd4T9qi7AVMiDRr9KhDD1lfS NWTFNzdzvjHtd1abCC689+B8rfWOfIIqFfwQhpV4df4/ks3gfCWoYAvtDfQLbwIXD1eRIWmDPBm8r SSSTjh9aqLqHZpSLoReA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nt8Vn-004ZUL-PA; Mon, 23 May 2022 13:54:19 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nt8Ux-004Z7T-Aw; Mon, 23 May 2022 13:53:29 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: kholk11) with ESMTPSA id 97A941F43599 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1653314005; bh=Dz3ZKPQtwBKUhDVWmG5Z5g8SZn+wliMq5r4L/qYaKxs=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=EVl4yiH5zAw6jU/LesJhdcZjrLZJDkNHinjOf4ToLslJ4PlFJ5m4IaXvTcvkLPhw+ JJu5XDjsHAMr713gN3K14F58MK1nRcuE3lIbNjmjJCkDp1hbq9LLXXWZ5SY8L/wq8f E47LCYpkGvzcElhFqW+1zjprXYTK7yF6x5t4D8BQyw74V45JlkAwNiUsmeLKvXjogU JhUArK8+Sw6wgx20cXnvE/PRJID08VdpatPiFR/L56YtsowbVZT3FFn3h+JPAu/n3W 3IvxfTISvT7jpWMDT9rURYT0llP1DNBdCFI+lfjD1F7rXxkvrycHOWzAkJ714LL7Vc HPgSCFXWCA/fw== Message-ID: <8334772a-6427-352d-4172-ca262267427d@collabora.com> Date: Mon, 23 May 2022 15:53:22 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH 2/4] regulator: Add driver for MT6331 PMIC regulators Content-Language: en-US To: Mark Brown Cc: lgirdwood@gmail.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, matthias.bgg@gmail.com, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org References: <20220520133305.265310-1-angelogioacchino.delregno@collabora.com> <20220520133305.265310-3-angelogioacchino.delregno@collabora.com> <6cc68be9-e509-eae4-801d-997fdc01dcf2@collabora.com> From: AngeloGioacchino Del Regno In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220523_065327_556429_43619A13 X-CRM114-Status: GOOD ( 22.16 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Il 23/05/22 15:43, Mark Brown ha scritto: > On Mon, May 23, 2022 at 03:22:39PM +0200, AngeloGioacchino Del Regno wrote: >> Il 23/05/22 15:00, Mark Brown ha scritto: > >>> Right, my point here is that it looks awfully like the documentation >>> (this came from documentation I guess?) is including some extra bits >>> that get ignored in the voltage selection field here. That seems like a >>> weird choice somewhere along the line. > >> I wish I had a datasheet for these parts... > >> All of this comes from analyzing a running device on the downstream 3.4 kernel >> and on understanding the (not really readable) downstream kernel code... >> ..but yes, I agree on the fact that this seems to be a weird choice. > >> Ah, besides, I hooked up an oscilloscope to the VCAM_IO and I can see that the >> vreg really does react as expected upon setting the upper bits.. but since it >> still works without, we can safely ignore them, which makes us able to simplify >> the driver (as no custom code for that will be required) and, at the same time, >> avoid seeing a table of values repeated 4 times in a row. > > That seems safer in general if we don't know what those bits are doing - > it could be some kind of mode control or something. > >> ...so, the regulator will indeed shut itself off and clear either/both the QI_EN >> and/or its relative bit in the enable register... I've also just found hints of >> the latter (enable register being set to 0) downstream, so I'm sure that this is >> indeed right. > > That's still not quite the same thing as a status bit, if the regulator > disables itself then it won't try to turn itself back on. Note that the > core will fall back on using the enable state if there's no status op so > there's no need for this logic, you can just omit the status op and the > behaviour will be the same. Ok then, I'll simply remove that! Thanks, Angelo _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C97C2C433EF for ; Mon, 23 May 2022 13:54:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QhpnJCUFtg7HNXzZtCuBJIF6g8iG2hCUVGC0FM29sOI=; b=iXiLH4y9lYKFeh maCtiPfULICsnw6NKhidwcaSiGc/CuzSqqOUnkNzzuzvZBDFEmkAbn2XO7JU96h1rwKhKZ9chESpI Hq27z6G1GzyiocCRBXJtimlhvyZ65DlMiKHAkp56ioAOM2JKCzqs0dqc6GO/fb0120lz0cjeZIc94 KmnqVOl2S86jhjZRIhd+R40bpzds8IUQaQrt0e2KO7VNr+LBGeIZgyb+jWdDEt6yoL5QpjZwIfwaw aNBRm1M011oHhl1pgdjSKM8pJZ5V4c9BhoAgasX1NxXN6hwWyVOTeRJeIimY3CCzmQncOvK8uf+TZ Ft9lbSVqwCtSqCsWPveA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nt8V7-004ZA1-G0; Mon, 23 May 2022 13:53:38 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nt8Ux-004Z7T-Aw; Mon, 23 May 2022 13:53:29 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: kholk11) with ESMTPSA id 97A941F43599 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1653314005; bh=Dz3ZKPQtwBKUhDVWmG5Z5g8SZn+wliMq5r4L/qYaKxs=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=EVl4yiH5zAw6jU/LesJhdcZjrLZJDkNHinjOf4ToLslJ4PlFJ5m4IaXvTcvkLPhw+ JJu5XDjsHAMr713gN3K14F58MK1nRcuE3lIbNjmjJCkDp1hbq9LLXXWZ5SY8L/wq8f E47LCYpkGvzcElhFqW+1zjprXYTK7yF6x5t4D8BQyw74V45JlkAwNiUsmeLKvXjogU JhUArK8+Sw6wgx20cXnvE/PRJID08VdpatPiFR/L56YtsowbVZT3FFn3h+JPAu/n3W 3IvxfTISvT7jpWMDT9rURYT0llP1DNBdCFI+lfjD1F7rXxkvrycHOWzAkJ714LL7Vc HPgSCFXWCA/fw== Message-ID: <8334772a-6427-352d-4172-ca262267427d@collabora.com> Date: Mon, 23 May 2022 15:53:22 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH 2/4] regulator: Add driver for MT6331 PMIC regulators Content-Language: en-US To: Mark Brown Cc: lgirdwood@gmail.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, matthias.bgg@gmail.com, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org References: <20220520133305.265310-1-angelogioacchino.delregno@collabora.com> <20220520133305.265310-3-angelogioacchino.delregno@collabora.com> <6cc68be9-e509-eae4-801d-997fdc01dcf2@collabora.com> From: AngeloGioacchino Del Regno In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220523_065327_556429_43619A13 X-CRM114-Status: GOOD ( 22.16 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Il 23/05/22 15:43, Mark Brown ha scritto: > On Mon, May 23, 2022 at 03:22:39PM +0200, AngeloGioacchino Del Regno wrote: >> Il 23/05/22 15:00, Mark Brown ha scritto: > >>> Right, my point here is that it looks awfully like the documentation >>> (this came from documentation I guess?) is including some extra bits >>> that get ignored in the voltage selection field here. That seems like a >>> weird choice somewhere along the line. > >> I wish I had a datasheet for these parts... > >> All of this comes from analyzing a running device on the downstream 3.4 kernel >> and on understanding the (not really readable) downstream kernel code... >> ..but yes, I agree on the fact that this seems to be a weird choice. > >> Ah, besides, I hooked up an oscilloscope to the VCAM_IO and I can see that the >> vreg really does react as expected upon setting the upper bits.. but since it >> still works without, we can safely ignore them, which makes us able to simplify >> the driver (as no custom code for that will be required) and, at the same time, >> avoid seeing a table of values repeated 4 times in a row. > > That seems safer in general if we don't know what those bits are doing - > it could be some kind of mode control or something. > >> ...so, the regulator will indeed shut itself off and clear either/both the QI_EN >> and/or its relative bit in the enable register... I've also just found hints of >> the latter (enable register being set to 0) downstream, so I'm sure that this is >> indeed right. > > That's still not quite the same thing as a status bit, if the regulator > disables itself then it won't try to turn itself back on. Note that the > core will fall back on using the enable state if there's no status op so > there's no need for this logic, you can just omit the status op and the > behaviour will be the same. Ok then, I'll simply remove that! Thanks, Angelo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel