Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp31929pxb; Wed, 30 Mar 2022 22:06:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwGb4+J1yBdrDmyciFN+9xoVGjzhxG+ohS8Fpq9wII8CVZX8XBjgzEt9uKRQjmnXMDvjz5k X-Received: by 2002:a05:6a00:4303:b0:4fa:c75b:f716 with SMTP id cb3-20020a056a00430300b004fac75bf716mr3550100pfb.29.1648703175806; Wed, 30 Mar 2022 22:06:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648703175; cv=none; d=google.com; s=arc-20160816; b=rJlKLiJfmxinu7eYpixOHR4UiAUnEPUKOIvy/2VkFhrgcw+JGno3fGQHn8tg6aMKuQ AGMsMqO2L9jt1DRcTPsbKW+2J3csuvpf6W40CkVFW1VNDPXveTh5kVg3lcIqQorh4/Tb u8YqfzotnItYvdeGOX9M+so24g3kB+xEe9Ov4oD735SHiiObkBeTs97Ennnz6/1vR6YX 5bLH373FOLUiKujEdpD18dFMAUjsCwlqywYHyAmT0A5/+yZM5ytvYBhHS8MoIOI+YyZ2 r8MwuuNVUhHzoTrTDE5LCG1nqf8HcfnyzXRKr3yNiJgH37Pu3XU8VZ8TXbfGtBU+rMzV YqiA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=lgWXWfHcEFuIjzKOAMnLUfFUyxB7ERtvXoDV+H2TzUI=; b=Na8IYey95xfHAPq4k9GLRxr3r4DBos06qr2olU/VzpuuRPU38sXjDrl5CEnspfKA35 bkKQt7DVFZz/F1T+8A+qBh/4l9gOSwCTH1na7sSwaSdfqu9oWMrRX29oKJQYYG6Z/tyD oNLFWb4FTXRmXc2Q8E0NxnWymjh/gMjgyELD/W36SWqyFUBhpoht0QHQjn2RgYYRqdmt WPFUVCOe9uXANdwouv5+sj6vi36RUTSMouR+2EgnfNonwxO4D/Q4nhMyh8YAv4kwNZVX sNTngh5JCGbxTIrDcBWKu2A3EMK4rFVgIUhN0E3JIOFpqd/mPbt2Yo21A0IPm3IQdAJf C0JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=h9mWYZJB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id p4-20020a170902e74400b00153b2d164d2si25346914plf.218.2022.03.30.22.06.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 22:06:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=h9mWYZJB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3F026278C60; Wed, 30 Mar 2022 20:40:51 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230199AbiC3MId (ORCPT + 99 others); Wed, 30 Mar 2022 08:08:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344562AbiC3LxR (ORCPT ); Wed, 30 Mar 2022 07:53:17 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E60D264806; Wed, 30 Mar 2022 04:49:10 -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 ams.source.kernel.org (Postfix) with ESMTPS id 0EC2DB81C3C; Wed, 30 Mar 2022 11:49:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0DF0C340F2; Wed, 30 Mar 2022 11:49:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648640946; bh=9kDFyJtz5aRFD1HOBnwM1kO3is+NlX0c7whwfOn5IIw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h9mWYZJBTyZkPr6nfbe1cM+4xo7ogYrgrRRAHmv/uE06SF4T75FyNLUtImi+b1M28 6dvbYKOv6ThPIaB/8C0pbVRlZ3EJ8xHoXMBRLnOPP2gg9i9QNIE1tzXPRHXl4NUSPV QbxYUiNSGy8Ti5DouMpgCXlK8pTVIGmo5ghmEEfiSub/y5eS2f45jMJjFbVj4dpnRU RHp07r2DtykDJymCQ3yWh/Aa+VEurqOWDeJcPeGaHQCiOvdVVZtlxEkRfnLG6ado56 fRmeMci8Kn76HUfUgFCiaYFp5bQgAoEhFhPPXgT1V4dmifbPDKya4RdfgXoTjPskB/ /YwX1okt34fiQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Hans de Goede , Mauro Carvalho Chehab , Sasha Levin , gregkh@linuxfoundation.org, linux-media@vger.kernel.org, devel@driverdev.osuosl.org Subject: [PATCH AUTOSEL 5.16 21/59] media: atomisp_gmin_platform: Add DMI quirk to not turn AXP ELDO2 regulator off on some boards Date: Wed, 30 Mar 2022 07:47:53 -0400 Message-Id: <20220330114831.1670235-21-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220330114831.1670235-1-sashal@kernel.org> References: <20220330114831.1670235-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE 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 From: Hans de Goede [ Upstream commit 2c39a01154ea57d596470afa1d278e3be3b37f6a ] The TrekStor SurfTab duo W1 10.1 has a hw bug where turning eldo2 back on after having turned it off causes the CPLM3218 ambient-light-sensor on the front camera sensor's I2C bus to crash, hanging the bus. Add a DMI quirk table for systems on which to leave eldo2 on. Note an alternative fix is to turn off the CPLM3218 ambient-light-sensor as long as the camera sensor is being used, this is what Windows seems to do as a workaround (based on analyzing the DSDT). But that is not easy to do cleanly under Linux. Link: https://lore.kernel.org/linux-media/20220116215204.307649-10-hdegoede@redhat.com Signed-off-by: Hans de Goede Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- .../media/atomisp/pci/atomisp_gmin_platform.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c index 62dc06e22476..cd0a771454da 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c +++ b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c @@ -729,6 +729,21 @@ static int axp_regulator_set(struct device *dev, struct gmin_subdev *gs, return 0; } +/* + * Some boards contain a hw-bug where turning eldo2 back on after having turned + * it off causes the CPLM3218 ambient-light-sensor on the image-sensor's I2C bus + * to crash, hanging the bus. Do not turn eldo2 off on these systems. + */ +static const struct dmi_system_id axp_leave_eldo2_on_ids[] = { + { + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "TrekStor"), + DMI_MATCH(DMI_PRODUCT_NAME, "SurfTab duo W1 10.1 (VT4)"), + }, + }, + { } +}; + static int axp_v1p8_on(struct device *dev, struct gmin_subdev *gs) { int ret; @@ -763,6 +778,9 @@ static int axp_v1p8_off(struct device *dev, struct gmin_subdev *gs) if (ret) return ret; + if (dmi_check_system(axp_leave_eldo2_on_ids)) + return 0; + ret = axp_regulator_set(dev, gs, gs->eldo2_sel_reg, gs->eldo2_1p8v, ELDO_CTRL_REG, gs->eldo2_ctrl_shift, false); return ret; -- 2.34.1