Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp111812iof; Sun, 5 Jun 2022 22:44:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZLKCBxejXVwgCKcWAcbg8phpobxEd3KC2mKfwEXqNnGocp0TWdPBZ3BorKU6KN3XVmxRM X-Received: by 2002:a62:d15c:0:b0:51b:b64d:fc69 with SMTP id t28-20020a62d15c000000b0051bb64dfc69mr22880693pfl.7.1654494275070; Sun, 05 Jun 2022 22:44:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654494275; cv=none; d=google.com; s=arc-20160816; b=1Gm1BsAm0eI9NIQL3oAoRYaPTqjHDKcO2/sUOfaXgF5R2NcMM8lWEgQWlSNnspVh7v PeOg9PFyUb20CtUEpWynx+TjQWvpX4XHUpo4a/ynYJ3PjDR4tlycbMcUPCDcGWZHKsZd JTt3djy704Cs4sj0MZHK6Lj60r3swpc9WNMzNnhE1tSQAS/n/r9TlNDs0HYnZ3ys+jb3 9WQzzXJ73W2MdctFmCo0qKlubgwo+vu6jIQNoocgyHxWvQRC6ygF0AxohPZ7bfdU2OLw IkFZyd7W4wWhVlpL06KXiSTTM3Ozx49gJhnLGg2mDE+cALcXGwIf1tTGO2VpgDHXfTq3 rNmg== 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=zgMcHIbtE13tcjLQvPjtBPUy+u90FpPK7Oe6nTAy1JnhcHOITqVrAKNhwIHbrOABzY YIFLf+DkW/AgmDrTl/s9zZ3gWqUtZSqWaD5T1fzUpW9vNnO6SS3cq2xTimS3d/M/eVwX D8V7U83H6zWj1cTedoTo4euvzzNBA5hTdGqVCI2xHCpZKINTAZf/pKnvqpqaU4N1ifpJ VC4ouHsWB1cW92f0UIILVqZeWGTS+STURWbr4Otj0lfAMqXqaCqsN/2qfBjcf1nbwhWC k4OG5UdvAJdlDIamfyzgN+dPYiTUTGv0NtXipolHiWNoCewSfqXVJFl6ut6DjCYOPCks Krzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=x2v4lypf; 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 j12-20020a170902da8c00b00161a06eb82asi21629081plx.314.2022.06.05.22.44.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jun 2022 22:44:35 -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=x2v4lypf; 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 7BD9C229B67; Sun, 5 Jun 2022 21:35:03 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242237AbiFCSRp (ORCPT + 99 others); Fri, 3 Jun 2022 14:17:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347611AbiFCSGK (ORCPT ); Fri, 3 Jun 2022 14:06:10 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 537A75C36A; Fri, 3 Jun 2022 10:59:08 -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 9956B6165B; Fri, 3 Jun 2022 17:58:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9C409C3411F; Fri, 3 Jun 2022 17:58:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654279096; bh=Cd2X9X9D1pUtLT7Y22U/EmbcPT8vW5ZoQ885p5Z6CdU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=x2v4lypfoo81qMJ7lOOa01X7x0YqUvcL/6htIuitQWLc7W/xwFc/Ps/xBs68otxvb LazbucnFvA4ahJ3srDIHcErCDbPAfWqAKvLwmVygQZOklwcec0/1veCaP1QcfOBhiT tdLH5ARYzGM/QlJmkH1Z3BXi6+bcup1ZUaBUfGGw= 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.18 52/67] media: i2c: imx412: Fix reset GPIO polarity Date: Fri, 3 Jun 2022 19:43:53 +0200 Message-Id: <20220603173822.227553579@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220603173820.731531504@linuxfoundation.org> References: <20220603173820.731531504@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);