Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp49545iof; Sun, 5 Jun 2022 20:45:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyuyC1J3hp/M6MCc+CKwxX6/hBxwizqnFEUlBYqnROhAVCbJ/NYygMPzHfpMTNysGNVH7Si X-Received: by 2002:a17:902:bd8e:b0:167:6f86:7862 with SMTP id q14-20020a170902bd8e00b001676f867862mr7123442pls.15.1654487128237; Sun, 05 Jun 2022 20:45:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654487128; cv=none; d=google.com; s=arc-20160816; b=fY/8eCIf77JD6WDIn/kyjW3kxpvv2ETAYkTbWHoQLST/aZ8FrcHBKKMkvXQew2ebkJ f/pJPkESoQ5fDyBb7PBiXPjERAGVZMOv4atEA+M4CoLe0p92gK0H4dMVXrxDBSST1gPJ YWMBLgoYWb3KV2Ijtfd135za/2CY3DZaO2Sbb+u6XRVPwcOsNl7teiHhJNvc/a129DZ3 ukQWeA7rwfepxZxxpehAdcG5gVC6c28+5qizB2bPaNuLtKURhQxTT0X8NDlcgYWfp8jX t3JEyhl/61qFRQgqiliN2iW+/EpB97Es+B4Dx8UlC41xKZRuMi5naWIV+2F3YuH9QMLf Tptg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=P9L3jd1wFqqDpL/WBpBtq37f6JI5Vu/7PI/TWemHrJ0=; b=zdSB0KxOGmd9WWiXcpqFLSiKIrjsH/LHqdIruW1Meb5p0T53aW5dRESRaO1NHXZ97N WF3x0V+XL/0RfPwukzu0ZtSlhckqOTOk2hPwMmLiG+yJsDNf9Cag9ivEOWbyUR+8Di51 MVwTcCGhTk+xmdp8TLHdoM2ZeHEso971DgY+25rMDNBgnxlExiNI4/srXQs+ixB/K//U kJBKGJboQYrqrOPZtl4UXLP1uxwLOgYyXG5gA7tD44iG6eOp9NNw5pkhiT7mHavWbWZ6 I20qYo6n4ROK2a9H106e14aXUAfKI8pOszsZAdgnRQUVqZ8mRiFuBMVcPJhEI9u8MOEI 1g1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IL56xaMX; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 12-20020aa7914c000000b0051bc5d81fa3si14947482pfi.16.2022.06.05.20.45.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 20:45:28 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IL56xaMX; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 75D385A08F; Sun, 5 Jun 2022 20:39:18 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346299AbiFCSC0 (ORCPT + 99 others); Fri, 3 Jun 2022 14:02:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347244AbiFCRwK (ORCPT ); Fri, 3 Jun 2022 13:52:10 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE14C6447; Fri, 3 Jun 2022 10:51: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 ams.source.kernel.org (Postfix) with ESMTPS id 60D72B82419; Fri, 3 Jun 2022 17:51:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95C12C385A9; Fri, 3 Jun 2022 17:51:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654278670; bh=Cd2X9X9D1pUtLT7Y22U/EmbcPT8vW5ZoQ885p5Z6CdU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IL56xaMX4vBATDXb5YNy7SfNGubanyD8zImDwk30NWqzuBe0gwcsokPQM5QRFqT3U gB1dS4/IsVPMyjvydHozwgLQXdTKvnPk87dPMauS9J7kaEYEKBEw84F1lVMHbS/m4h Q6bMJ6wS3ruoMlKspwCzswCRx+T3WZ1UBcUXqjpU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Bryan ODonoghue , Jacopo Mondi , Daniele Alessandrelli , Sakari Ailus , Mauro Carvalho Chehab Subject: [PATCH 5.15 55/66] media: i2c: imx412: Fix reset GPIO polarity Date: Fri, 3 Jun 2022 19:43:35 +0200 Message-Id: <20220603173822.250099138@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603173820.663747061@linuxfoundation.org> References: <20220603173820.663747061@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, 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: Bryan O'Donoghue commit bb25f071fc92d3d227178a45853347c7b3b45a6b upstream. The imx412/imx577 sensor has a reset line that is active low not active high. Currently the logic for this is inverted. The right way to define the reset line is to declare it active low in the DTS and invert the logic currently contained in the driver. The DTS should represent the hardware does i.e. reset is active low. So: + reset-gpios = <&tlmm 78 GPIO_ACTIVE_LOW>; not: - reset-gpios = <&tlmm 78 GPIO_ACTIVE_HIGH>; I was a bit reticent about changing this logic since I thought it might negatively impact @intel.com users. Googling a bit though I believe this sensor is used on "Keem Bay" which is clearly a DTS based system and is not upstream yet. Fixes: 9214e86c0cc1 ("media: i2c: Add imx412 camera sensor driver") Cc: stable@vger.kernel.org Signed-off-by: Bryan O'Donoghue Reviewed-by: Jacopo Mondi Reviewed-by: Daniele Alessandrelli Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/media/i2c/imx412.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/media/i2c/imx412.c +++ b/drivers/media/i2c/imx412.c @@ -1011,7 +1011,7 @@ static int imx412_power_on(struct device struct imx412 *imx412 = to_imx412(sd); int ret; - gpiod_set_value_cansleep(imx412->reset_gpio, 1); + gpiod_set_value_cansleep(imx412->reset_gpio, 0); ret = clk_prepare_enable(imx412->inclk); if (ret) { @@ -1024,7 +1024,7 @@ static int imx412_power_on(struct device return 0; error_reset: - gpiod_set_value_cansleep(imx412->reset_gpio, 0); + gpiod_set_value_cansleep(imx412->reset_gpio, 1); return ret; } @@ -1040,7 +1040,7 @@ static int imx412_power_off(struct devic struct v4l2_subdev *sd = dev_get_drvdata(dev); struct imx412 *imx412 = to_imx412(sd); - gpiod_set_value_cansleep(imx412->reset_gpio, 0); + gpiod_set_value_cansleep(imx412->reset_gpio, 1); clk_disable_unprepare(imx412->inclk);