From patchwork Mon Nov 28 21:44:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 629083 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0055C4321E for ; Mon, 28 Nov 2022 21:46:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233977AbiK1VqG (ORCPT ); Mon, 28 Nov 2022 16:46:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233396AbiK1VqF (ORCPT ); Mon, 28 Nov 2022 16:46:05 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B15062ED6F for ; Mon, 28 Nov 2022 13:44:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669671860; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HYgpL2606mVfO+98npo7eaosHXY5I8deinLTWhiViEE=; b=BcHcgx/1YvkblQqc7QnXEX4eW7cFsprZsOPjZhWId9ioOQVpW0EPSwVLbCZ3xv4p/nuOiW +c1739FGfZlKFRPKqWr+0Ak+Zorv1+lSDiYnq5TZQVnTQa2ICHuMLmmXr0gRnyACp754jy aVFDyHrZYCJFJ3OpOOS8H9Y/W44Grg8= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-197-XIfB4YCLNIye0mUOA4KgEA-1; Mon, 28 Nov 2022 16:44:15 -0500 X-MC-Unique: XIfB4YCLNIye0mUOA4KgEA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AD33286C177; Mon, 28 Nov 2022 21:44:14 +0000 (UTC) Received: from shalem.redhat.com (unknown [10.39.192.115]) by smtp.corp.redhat.com (Postfix) with ESMTP id 23AFD40C6EC2; Mon, 28 Nov 2022 21:44:13 +0000 (UTC) From: Hans de Goede To: Mark Gross , Andy Shevchenko , Bartosz Golaszewski , Linus Walleij , Daniel Scally , Laurent Pinchart Cc: Hans de Goede , platform-driver-x86@vger.kernel.org, linux-gpio@vger.kernel.org, Sakari Ailus , Kate Hsuan , linux-media@vger.kernel.org Subject: [PATCH 1/5] gpio: tps68470: Fix tps68470_gpio_get() reading from the wrong register Date: Mon, 28 Nov 2022 22:44:04 +0100 Message-Id: <20221128214408.165726-2-hdegoede@redhat.com> In-Reply-To: <20221128214408.165726-1-hdegoede@redhat.com> References: <20221128214408.165726-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org For the regular GPIO pins the value should be read from TPS68470_REG_GPDI, so that the actual value of the pin is read, rather then the value the pin would output when put in output mode. Signed-off-by: Hans de Goede --- drivers/gpio/gpio-tps68470.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-tps68470.c b/drivers/gpio/gpio-tps68470.c index aaddcabe9b35..778a72cf800c 100644 --- a/drivers/gpio/gpio-tps68470.c +++ b/drivers/gpio/gpio-tps68470.c @@ -30,7 +30,7 @@ static int tps68470_gpio_get(struct gpio_chip *gc, unsigned int offset) { struct tps68470_gpio_data *tps68470_gpio = gpiochip_get_data(gc); struct regmap *regmap = tps68470_gpio->tps68470_regmap; - unsigned int reg = TPS68470_REG_GPDO; + unsigned int reg = TPS68470_REG_GPDI; int val, ret; if (offset >= TPS68470_N_REGULAR_GPIO) {