Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp86979rwl; Fri, 24 Mar 2023 21:34:12 -0700 (PDT) X-Google-Smtp-Source: AK7set+5RY1FBRaSsxIAiFy6FaH32bzQsX8GHoOn3xtYXiSKMV9jMZ2gSvTvOCdOHKaESJbiBhUp X-Received: by 2002:a05:6a20:baa2:b0:d5:1863:fe5f with SMTP id fb34-20020a056a20baa200b000d51863fe5fmr4272333pzb.2.1679718852053; Fri, 24 Mar 2023 21:34:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679718852; cv=none; d=google.com; s=arc-20160816; b=JifUkGkm7mozL8eEr04HPchVBVrW1/060N5BLFWUoenTaxdfORolJEiN/OfCZe6hb5 7e7S5t5OUFbYwEGhCZF30zx1uLhoCNLEO6bC50J7FF4HKejjP6FSlcIi918thbapx50h RQpm2Oc+BLani7hRp04xK5l+KO7KDTfN1E2nHWaeOSfsCfu88+g4FtTuIe8xJg3WLxjM EuNhcUPIwANNh4MWex1DF4DEKU7OSQt1GqF5uPgwu4up8YbbveuB6alW8I7JDRy4E1rc f/Arhwu+y6PmkEhZbyV1ERwQt37l/CpbK8OLO3fXcew0RZEzDE2d8rZmHwTPO+mfveWr elgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=+FwD1qe1aEhxGQwbkfsAcs59fzQAp+267YsErGDwRDQ=; b=p7TfB5ybSb+dFAukPIZRi72DCQRpXZTO8HIRXWYiBFXhBIuWmZXFr8g1uX8qePk3VW d8sbMF9+TRz8c8aYcpCbJPzrAHaMKm5MQWW4wq8NqCGC2DFVmrymE1lvL8eU/HIubcyz fFbfQpmANezHIeNDB6beHXmXKrFm/pCKk8ejAOg/cnCry61wuRMDRxgxXFH2DpyW7GhD CBNP44TAR+OtiQXrFwFLla87rMe+X/TcDegdub1pFP0UODWUXEVyDAzFEUzTmirqQbZk jzUF32Z+7XgbClAGwL0QbJEHuxgBc/truYMm8ms8Y8H9SUUyuimbNN73MTCs6UMqbEK+ J3Rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=iOFPi2Ep; 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=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n10-20020a056a0007ca00b00627d5397423si19177175pfu.145.2023.03.24.21.34.00; Fri, 24 Mar 2023 21:34:12 -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=@chromium.org header.s=google header.b=iOFPi2Ep; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231308AbjCYEdi (ORCPT + 99 others); Sat, 25 Mar 2023 00:33:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229674AbjCYEdg (ORCPT ); Sat, 25 Mar 2023 00:33:36 -0400 Received: from mail-ua1-x92d.google.com (mail-ua1-x92d.google.com [IPv6:2607:f8b0:4864:20::92d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C11510F5 for ; Fri, 24 Mar 2023 21:33:35 -0700 (PDT) Received: by mail-ua1-x92d.google.com with SMTP id h34so2790959uag.4 for ; Fri, 24 Mar 2023 21:33:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1679718814; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=+FwD1qe1aEhxGQwbkfsAcs59fzQAp+267YsErGDwRDQ=; b=iOFPi2EpJxYYxobOHGqjcpDoFg3I0Cf9cCiHsWV6gSJJ/2aZpe6HW9DB/PQLkXxGzN qj2kCyi+v1dUPETrWiILCcrZHHflu9iCIqKBzkAHRMM9GRgZ/m/uLOtcWmX4mAJDumVZ UNpPB7YoMkihR/Bvc44JXgVgX8VjDhAwXtAfY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679718814; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+FwD1qe1aEhxGQwbkfsAcs59fzQAp+267YsErGDwRDQ=; b=4CkZPQBTnz6W8iSa02St2DKCeETWaSSJ4Esj2IM1g2YkoorrXTDBVOm7CuUmJwZTKI xYVeriA1fWHDe0OmpPsA6raOqTjt9LHF33IG9DcsoG13cp5pf6RxESB0wOtvRHgT+IuY Jt2utr9WNj2ejK35S3EEZLu+6KCLd8/Wo/PDMORR1El3r/bW8RfO0RkyUeBHZc5bcyu1 W/nSMKlPH93fPAkOZf1qCVpDU+4UIsLdTWX7Nn3hPYfTiUdfCFtUCsTEQSz+xuC1ATc7 8OMYelyV45n//UhoY2ccQA8lCPfOK9ihTiK3qMWZDFfMjutY0YCyaXsI8peG121P/okn Hiyw== X-Gm-Message-State: AO0yUKVvhFLWCCtmwQPTg6CXPFImOKSP1424eVYOlUhUBBoj3DkRIumN vVQcON8IPBJCzztLNrnR39uCSYB5t1nMS8boEXQaYg== X-Received: by 2002:a05:6122:7c9:b0:401:7625:e9e3 with SMTP id l9-20020a05612207c900b004017625e9e3mr7173590vkr.1.1679718814257; Fri, 24 Mar 2023 21:33:34 -0700 (PDT) MIME-Version: 1.0 References: <20230307163413.143334-1-bchihi@baylibre.com> In-Reply-To: From: Chen-Yu Tsai Date: Sat, 25 Mar 2023 12:33:23 +0800 Message-ID: Subject: Re: [PATCH 0/4] Add LVTS support for mt8192 To: Balsam CHIHI Cc: daniel.lezcano@linaro.org, angelogioacchino.delregno@collabora.com, rafael@kernel.org, amitk@kernel.org, rui.zhang@intel.com, matthias.bgg@gmail.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, rdunlap@infradead.org, ye.xingchen@zte.com.cn, p.zabel@pengutronix.de, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, khilman@baylibre.com, james.lo@mediatek.com, rex-bc.chen@mediatek.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 On Wed, Mar 22, 2023 at 8:48=E2=80=AFPM Balsam CHIHI = wrote: > > Hi Chen-Yu, > > I suspect the bug comes from incorrect calibration data offsets for AP > Domain because you confirm that MCU Domain probe runs without issues. > Is it possible to test something for us to confirm this theory (i > don't have an mt8192 board on hand now), when you have the time of > course? > We would like to test AP Domain's calibration data offsets with a > working one, for example : > > static const struct lvts_ctrl_data mt8192_lvts_ap_data_ctrl[] =3D { > { > - .cal_offset =3D { 0x25, 0x28 }, > + .cal_offset =3D { 0x04, 0x04 }, > .lvts_sensor =3D { > { .dt_id =3D MT8192_AP_VPU0 }, > { .dt_id =3D MT8192_AP_VPU1 } > @@ -1336,7 +1336,7 @@ static const struct lvts_ctrl_data > mt8192_lvts_ap_data_ctrl[] =3D { > .hw_tshut_temp =3D LVTS_HW_SHUTDOWN_MT8192, > }, > { > - .cal_offset =3D { 0x2e, 0x31 }, > + .cal_offset =3D { 0x04, 0x04 }, > .lvts_sensor =3D { > { .dt_id =3D MT8192_AP_GPU0 }, > { .dt_id =3D MT8192_AP_GPU1 } > @@ -1346,7 +1346,7 @@ static const struct lvts_ctrl_data > mt8192_lvts_ap_data_ctrl[] =3D { > .hw_tshut_temp =3D LVTS_HW_SHUTDOWN_MT8192, > }, > { > - .cal_offset =3D { 0x37, 0x3a }, > + .cal_offset =3D { 0x04, 0x04 }, > .lvts_sensor =3D { > { .dt_id =3D MT8192_AP_INFRA }, > { .dt_id =3D MT8192_AP_CAM }, > @@ -1356,7 +1356,7 @@ static const struct lvts_ctrl_data > mt8192_lvts_ap_data_ctrl[] =3D { > .hw_tshut_temp =3D LVTS_HW_SHUTDOWN_MT8192, > }, > { > - .cal_offset =3D { 0x40, 0x43, 0x46 }, > + .cal_offset =3D { 0x04, 0x04, 0x04 }, > .lvts_sensor =3D { > { .dt_id =3D MT8192_AP_MD0 }, > { .dt_id =3D MT8192_AP_MD1 }, > > This example is tested and works for mt8195, > (all sensors use the same calibration data offset for testing purposes). > > Thank you in advance for your help. The MCU ones are still tripping though. If I change all of them to 0x04, then nothing trips. There's also a bug in the interrupt handling code that needs to be dealt with. AFAICT the calibration data is stored differently. If you look at ChromeOS'= s downstream v5.10 driver, you'll see mt6873_efuse_to_cal_data() for MT8192, and mt8195_efuse_to_cal_data() for MT8195. The difference sums up to: MT8195 has all data sequentially stored, while MT8192 has most data stored in lower 24 bits of each 32-bit word, and the highest 8 bits are then used to pack data for the remaining sensors. Regards ChenYu