From patchwork Fri Jul 14 19:03:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: George Stark X-Patchwork-Id: 13314176 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 C4451C001B0 for ; Fri, 14 Jul 2023 19:04:07 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=qEqGalJ5sPgiELq0nQYt3bahXNcE7onVCddfQ8+6bu8=; b=hotHEP97zzGtEm g99gWTE/4SCy0d5VFIofDuG4OXjKkSvhzqDl226DmeFZIKe8SvCheDFE1jAgEFIbMCHGpjfmGJM4/ Q7DOz7Mgd+4VbFTurZRt/LOxSGZa7JKnWdFyec/BAopwCrvOQPGhXnqG5k0uHbKsSDa9IZ8Ld2ICh c0aTKi2UW37flH5U5N4A/2vof79BxxP2ClDuAU3n6cuzJs+1uHq2Nv+EpAIDr2RBibFTRWaZ5/6iv 8FXqCR8I/ItNYyBtUSDVl0mDkKt0sq1E2lweqyg30ZIsGptqevsLqZRsJ2uRkRtJh58Nur0tL3xVi zzUnpvBV1+PyWR+k/geg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qKO4u-0073HW-0c; Fri, 14 Jul 2023 19:03:44 +0000 Received: from mx1.sberdevices.ru ([37.18.73.165]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qKO4q-0073Ft-2k; Fri, 14 Jul 2023 19:03:43 +0000 Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 9FC50100005; Fri, 14 Jul 2023 22:03:32 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 9FC50100005 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1689361412; bh=UKToA8zywV8uXSaW87LKG0cPDy8zHjWEhriI54HK4g0=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=q/buLI26I/8SjpIeBae5BfI4vwuzW+zm5f/xBiuLAr/BXwspqTcgIFSjhQEDJyl+u Tb3rGB2IfPHKqs+uZgfCCPjIj3mD3q/J7YA5ZxjYX/yzgZg6fdfqjcZRsLh3puOchJ YkWLipxdnr5v7F40p2wPtgPyToPriSmE4cKbAmOn+BCLhrgpPWxmqelOSmyKcN4THs 460b8K74xsy6ao2Kw/b9W0aYA8yECYy860CSzkQCWI8InNC2jBtO4pkc3OcVxoRqlB Hhm+bm9mQiurUfwNwMslT3Noz5d0Swk/7YNq+KVXyWCN33q60ezbhA/svzsSS+gO5G mpeMoly+bffAA== Received: from p-i-exch-sc-m02.sberdevices.ru (p-i-exch-sc-m02.sberdevices.ru [172.16.192.103]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Fri, 14 Jul 2023 22:03:32 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Fri, 14 Jul 2023 22:03:32 +0300 From: George Stark To: , , , , , , , , CC: , , , , Subject: [PATCH v1 0/1] iio: adc: meson: fix core clock enable/disable moment Date: Fri, 14 Jul 2023 22:03:14 +0300 Message-ID: <20230714190320.308320-1-gnstark@sberdevices.ru> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) To p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 178634 [Jul 14 2023] X-KSMG-AntiSpam-Version: 5.9.59.0 X-KSMG-AntiSpam-Envelope-From: GNStark@sberdevices.ru X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 523 523 523027ce26ed1d9067f7a52a4756a876e54db27c, {Tracking_from_domain_doesnt_match_to}, p-i-exch-sc-m02.sberdevices.ru:5.0.1,7.1.1;sberdevices.ru:5.0.1,7.1.1;127.0.0.199:7.1.2;100.64.160.123:7.1.2;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1, FromAlignment: s, {Tracking_white_helo}, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/07/14 14:48:00 #21614190 X-KSMG-AntiVirus-Status: Clean, skipped X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230714_120341_633536_86F17365 X-CRM114-Status: GOOD ( 10.20 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org This patch is a part of effort to support meson a1 SoC and make meson saradc driver independent from vendor boot code initialization in common. Core clock (passed to adc module thru dts) is supposed to be responsible for entier module and should be on before accessing modules' regs. I've made experiments and here are the results: on odroid-c1 (meson8) adc regs became readonly with core clock off: # disable clock (HHI_GCLK_MPEG0 bit 10) devmem 0xc1104140 32 0xBFFA72FF devmem 0xc110868C 0xE3A851FF devmem 0xc110868C 32 0xE3A85100 devmem 0xc110868C 0xE3A851FF # enable clock devmem 0xc1104140 32 0xBFFA76FF devmem 0xc110868C 0xE3A851FF devmem 0xc110868C 32 0xE3A85100 devmem 0xc110868C 0xE3A85100 on vim3 (a311d) adc regs became readonly with core clock off: # disable adc core clock: devmem 0xff80004C 32 0xFFFFFEFF # the adc register become readonly: devmem 0xff80902c 0x002C2002 devmem 0xff80902c 32 0x002C2000 devmem 0xff80902c 0x002C2002 on a1 adc registers are none-readable-writeable when adc core clock is off: devmem 0xfe002c2c 0x00002003 # disable clock devmem 0xfe00081c 32 0xFFFF9FFF devmem 0xfe002c2c 0x00000000 # enable clock devmem 0xfe00081c 32 0xFFFFFFFF devmem 0xfe002c2c 0x00002003 George Stark (1): iio: adc: meson: fix core clock enable/disable moment drivers/iio/adc/meson_saradc.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)