Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp7229088rwr; Tue, 25 Apr 2023 09:48:48 -0700 (PDT) X-Google-Smtp-Source: AKy350blFNHxw4K6g/tJqbyZJYdmViG3c+sqha0nzUMfWNmrcV3UL5wpRXx7068lZ9QJ6ifUc5t9 X-Received: by 2002:a05:6a21:110c:b0:eb:6e43:8e1b with SMTP id oh12-20020a056a21110c00b000eb6e438e1bmr20135710pzb.30.1682441327465; Tue, 25 Apr 2023 09:48:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682441327; cv=none; d=google.com; s=arc-20160816; b=nfIR3+2qR0jAGHZ4kPxsXbMo1Nrfy1632n3Y9rBwlAylP6f4f01mBzn0wW/l+PzpEv fJpNpmDop4tHI3G4ozAHUpSqQXyJLYfaNWlYaaqqGOWtTbdGiMZyFaGeivr3tqEeMA/d PWxEhQoApfamcP9apCwmulejoZ71Zp/ZlW71X8nuMbKFGnhIBKx7wi07WweN3Dyfu8za GU3l9C2tFNXQLJer9C1mJfn3tR8lShtyrzG6m1E8j4UH1VSr25OXpRwibj9csLlJmT7R eMfvRgG1xc9cMCsXpWar4MQ6FcbYYb0x29+1jRP+UhEAMma7nj9ibYR0rC734r/ozwUy Kj6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=qiGrnDuMfo3LrvcoZ7kAdACoFBfjHXw34Npd0uzTDRc=; b=EB2065u6JHcOHel2/xf+a8DqdtXnel0+EFNDTn2yamVV2dSi3Oc+LMhA8S86BwViUC myzT4nIwW6Fr1ZJ/rmYwUE8EnvvqfReRYcW6Cgf2qKQvqqtISsNwrhZt9ZV5lXZYgL0A J3IRloUcbmupjLagKyb9SCFkZL7YRd8yYwM0hvxfXpdybvfNh8+gUcDnji7XQdcJ9Gay vTP19ann3tbx2RfHCLM62KB/c4Ml5wfu+NUQfVE22Fgnpg6Wr0lQcfrj4c1hnnin7sjb /EkjLnSEOM378Gks7VmKpH2BXZ164xMJozEub2/3O9bBIuvONujReB8ibkLCo6ugxQJA mCCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uc49KU1x; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q1-20020a634301000000b00528595a1390si3828194pga.588.2023.04.25.09.48.35; Tue, 25 Apr 2023 09:48:47 -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=@kernel.org header.s=k20201202 header.b=uc49KU1x; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234711AbjDYQmP (ORCPT + 99 others); Tue, 25 Apr 2023 12:42:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234301AbjDYQmN (ORCPT ); Tue, 25 Apr 2023 12:42:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94FCC10F7; Tue, 25 Apr 2023 09:42:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 29A2362FEB; Tue, 25 Apr 2023 16:42:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A77F6C433D2; Tue, 25 Apr 2023 16:42:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1682440931; bh=j2FI866f7bJRSZe9pyoQke2gaKz6vKX/jQrjan0VOyQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uc49KU1xoyNHghB/S2mkrucoVJ6dNXsKowUEI6tYnUyGgzir6xHVINqi4TMBPmFQZ fuYws4vt5muCYXw6Pz+aItDSuVUrJPvKcctIz8Lsy3X8ezdi5DV0EgMN8aDvrY7dNh G5H0ggiBFHl79QJp8f/4jSivUevYCykoQm7FEmOAYwaeRB37gcIegwUE7ahMg6CVve AUqwNFIQOrPU8rb7RChBJEN8389wVJ1kEBbRNHwDrGVLvgnrg3OSwBf8VtyYitI+G/ v59RXq6l0l+/5FwUbLLUKm65vW57WqQfQXHtJG2uzHXMcLcOz6kSYKkYtIgxjsOuWU RbRVSRK4JageA== Date: Tue, 25 Apr 2023 17:42:03 +0100 From: Mark Brown To: =?utf-8?B?UGF3ZcWC?= Anikiel Cc: alsa-devel@alsa-project.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, dinguyen@kernel.org, lars@metafoo.de, nuno.sa@analog.com, upstream@semihalf.com Subject: Re: [PATCH 5/9] ASoC: ssm2602: Add workaround for playback with external MCLK Message-ID: <417f9340-3270-4579-8cff-701200a62591@sirena.org.uk> References: <20230414140203.707729-1-pan@semihalf.com> <20230414140203.707729-6-pan@semihalf.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="zKP4caOJkrTJMMD/" Content-Disposition: inline In-Reply-To: X-Cookie: The meek don't want it. X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 --zKP4caOJkrTJMMD/ Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 25, 2023 at 06:02:20PM +0200, Pawe=C5=82 Anikiel wrote: > On Fri, Apr 14, 2023 at 7:35=E2=80=AFPM Mark Brown w= rote: > > On Fri, Apr 14, 2023 at 04:01:59PM +0200, Pawe=C5=82 Anikiel wrote: > > > Apply a workaround for what seems to be a hardware quirk: when using > > > an external MCLK signal, powering on Output and DAC for the first time > > > produces output distortions unless they're powered together with whole > > > chip power. > > This doesn't seem coherent, these are multiple register writes so > > clearly can't be done at the same moment as initial power on. Clearly > > there's some other constraint here. > The "at the same time" part is done by writing multiple bits at once > to SSM2602_PWR. But before that, SSM2602_ACTIVE has to be set, and > then the chip is reset (SSM2602_RESET) to power everything down again. So you need to power up the chip then do a register write sequence - that's noticably different to what the description says. > > > Here are some sequences run at the very start before a sw reset (and > > > later using one of the NOT OK sequences from above): > > > ssmset 0x09 0x01 # core > > > ssmset 0x06 0x07 # chip, out, dac > > > OK > > I can't tell what any of this is trying to say, especially given all the > > magic numbers, and obviously no actual use of the driver should be > > writing directly to the register map. > These are shell commands run from userspace (with no ssm2602 driver > present in the kernel). ssmset is a wrapper for the i2cset command: > ssmset() { > i2cset -y 0 0x1a $(($1*2)) $2 > } > I definitely should have made that more clear. > Do you think these logs are worth adding? If so, I'll improve the > explanation what these mean. Probably? Since I couldn't really follow what these were trying to tell me it's a bit hard to say. It looks like you worked this out yourself rather than using an erratum so documenting where the workaround comes =66rom seems useful. --zKP4caOJkrTJMMD/ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmRIAtoACgkQJNaLcl1U h9CamAgAhCuIv1AvQmJghDPpVDrb/Wzz212HfxzlxLRi8TgBJV4fLdTc6tUs0YqN XYMXREF2B9AZR+d92U8auVTbEgPxS0wQxr453J7TICBcvyK6t+xlKSg5AhPmQ0lh uCjjErq3YoxLp13vNrNE84SjLb9PL92+r7vS2dA8WJmwhcwQIk67QVqiF6ywKFUR sH6EBeAZVZVpsn++ll8z/F/uNVS+cyi/I0IeMuG5kxCsSFcOciYwHUgqWcZYLZA2 bu6ez52dmOPPt5G17MfGSt3W4kZZBM9LT/Qzc+qJ8auQapwAgut/aAYnqPUewlSM hBfGzlMAlsLti8PUCA7rmd9LbECjVw== =hoS+ -----END PGP SIGNATURE----- --zKP4caOJkrTJMMD/--