From patchwork Mon Nov 28 21:44:05 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: 629100 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 41C0FC46467 for ; Mon, 28 Nov 2022 21:46:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234170AbiK1VqG (ORCPT ); Mon, 28 Nov 2022 16:46:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232966AbiK1VqF (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 9D0602F396 for ; Mon, 28 Nov 2022 13:44:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669671862; 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=lDSk/YotiMAVVVz5IFNCek4sXkrxUKeZgip3PiiCKEk=; b=SGEPVM0/oZKJ2ToW0Y9bMne/gJ6ebRkgLYB0D5I85p7nTaKS0o+Qvc4stJbIr/AABurOj0 DPAsZG9VYWg5M3UMESt2Sx9kL2hi8yWwZ2QsrVNIP1ykLI8f69Ze5yta90GYVLppM554fR z1qjjMwUyQ4Lk1y6eGUEmKb+YhAmHYU= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-169-THRlshcIPleqsWkBH0l2Vg-1; Mon, 28 Nov 2022 16:44:17 -0500 X-MC-Unique: THRlshcIPleqsWkBH0l2Vg-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 7943429DD989; Mon, 28 Nov 2022 21:44:16 +0000 (UTC) Received: from shalem.redhat.com (unknown [10.39.192.115]) by smtp.corp.redhat.com (Postfix) with ESMTP id E162B40C6EC2; Mon, 28 Nov 2022 21:44:14 +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 2/5] gpio: tps68470: Make tps68470_gpio_output() always set the initial value Date: Mon, 28 Nov 2022 22:44:05 +0100 Message-Id: <20221128214408.165726-3-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-media@vger.kernel.org Make tps68470_gpio_output() call tps68470_gpio_set() for output-only pins too, so that the initial value passed to gpiod_direction_output() is honored for these pins too. Signed-off-by: Hans de Goede Reviewed-by: Andy Shevchenko Reviewed-by: Daniel Scally Tested-by: Daniel Scally --- drivers/gpio/gpio-tps68470.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpio/gpio-tps68470.c b/drivers/gpio/gpio-tps68470.c index 778a72cf800c..2ca86fbe1d84 100644 --- a/drivers/gpio/gpio-tps68470.c +++ b/drivers/gpio/gpio-tps68470.c @@ -91,13 +91,13 @@ static int tps68470_gpio_output(struct gpio_chip *gc, unsigned int offset, struct tps68470_gpio_data *tps68470_gpio = gpiochip_get_data(gc); struct regmap *regmap = tps68470_gpio->tps68470_regmap; + /* Set the initial value */ + tps68470_gpio_set(gc, offset, value); + /* rest are always outputs */ if (offset >= TPS68470_N_REGULAR_GPIO) return 0; - /* Set the initial value */ - tps68470_gpio_set(gc, offset, value); - return regmap_update_bits(regmap, TPS68470_GPIO_CTL_REG_A(offset), TPS68470_GPIO_MODE_MASK, TPS68470_GPIO_MODE_OUT_CMOS);