Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3642504pxb; Mon, 24 Jan 2022 14:13:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJy2+L8zxQ7tSkTVXjaVHsIViRz7WAMqMut1J9NxLqQ9Sd2wDarOTDIVms4Felfjz+YRBs4j X-Received: by 2002:aa7:8d02:0:b0:4c1:b464:9826 with SMTP id j2-20020aa78d02000000b004c1b4649826mr15858246pfe.67.1643062425045; Mon, 24 Jan 2022 14:13:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643062425; cv=none; d=google.com; s=arc-20160816; b=wd51304DCadigG8gWpQga8eLopnNHe1YfpaK7RWJyIK48Rt+T2j5imusvAsxYzFN/l Y0pZyBT3m6ba7S2NF2nGYqrAyTqY8J8Y5MOzWE2T/5pqGZSTxysughmnzd7KHqngqoQs XGcaPbfIpcoLLu1B0hallKr3LW4RhTYzO0CNztoFZ0HPPdIswwFyeYE3DFHSk8QudmCM L2PHu0pEqsRCQWOjnLYJGLlqQjratf2CF38jNL1tP+H14QHANt0emurjUcIsZi/oQuwu M770WoQs/xOxgW5fK3KUWU5yjne42pyBiFNW0kmgHNKSogAKZho6vbv5xN7pr9ka+zX8 sVCg== 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=ZR7CelKgdlbDjqwbp7gi3824nNhqMOMcS+9QPR9Cqsc=; b=IRpYSgTuTmm7biVRHahpVs5Ns1cFps4q/mUagcPGKr7Ax+Aj7psm/Kp6qcWKaRzeFG 8aeq4GIZbv6rFlDCqqvWbjMfjdJMVe2sd9FbyVXZy75h8tgfuiS50+oNtBV8VJ9oaIIj 773nwcRwgnZQnDoTwRkv6uHtwtzCl5tXYfYZBAzhiN6q1bGgnq7/dki32Acwr+78NQum o5lcboWRbw4wojgQc9UC0LLRU93KseHaWqpPDmftIQ6OH5UiaQojJmj54yPQf8pKecnE /PkqXpSGAq4+ZNgbucWNILqBihRs3OAbRJnMY++xil64fKfvEO+SHlRiNm2De42QpRbY GRlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=z7cn0C9B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g8si13171644plt.333.2022.01.24.14.13.32; Mon, 24 Jan 2022 14:13:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=z7cn0C9B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1578123AbiAXWBo (ORCPT + 99 others); Mon, 24 Jan 2022 17:01:44 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:38674 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1450269AbiAXVUJ (ORCPT ); Mon, 24 Jan 2022 16:20:09 -0500 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 03601B81142; Mon, 24 Jan 2022 21:20:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28BFEC340E4; Mon, 24 Jan 2022 21:20:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643059205; bh=Me67gsWeV+RFSnXE3+KumzwdeAVvLxMDCMedH2J8DJ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=z7cn0C9B4oaPvcEpHKzJc4Z9wtO8aRzYgUHHaedSfDR4r2jCGAZajiqGlbE6Hfm4f LgD/KOaNr3pZW3NvCYzpkIfbHo67m0Njbi7SVQ/3VPaoZP/RhcXmXE/93bt8Q9kQ3A k7+gOTNIvyZhcnTLOj3mixnbr+camGeyNdxP34TY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Merlijn Wajer , Linus Walleij , Pavel Machek , Sasha Levin Subject: [PATCH 5.16 0538/1039] leds: lp55xx: initialise output direction from dts Date: Mon, 24 Jan 2022 19:38:47 +0100 Message-Id: <20220124184143.361853911@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Merlijn Wajer [ Upstream commit 9e87a8da747bf72365abb79e6f64fcca955b4f56 ] Commit a5d3d1adc95f ("leds: lp55xx: Initialize enable GPIO direction to output") attempts to fix this, but the fix did not work since at least for the Nokia N900 the value needs to be set to HIGH, per the device tree. So rather than hardcoding the value to a potentially invalid value for some devices, let's set direction in lp55xx_init_device. Fixes: a5d3d1adc95f ("leds: lp55xx: Initialize enable GPIO direction to output") Fixes: 92a81562e695 ("leds: lp55xx: Add multicolor framework support to lp55xx") Fixes: ac219bf3c9bd ("leds: lp55xx: Convert to use GPIO descriptors") Signed-off-by: Merlijn Wajer Reviewed-by: Linus Walleij Signed-off-by: Pavel Machek Signed-off-by: Sasha Levin --- drivers/leds/leds-lp55xx-common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/leds/leds-lp55xx-common.c b/drivers/leds/leds-lp55xx-common.c index d1657c46ee2f8..9fdfc1b9a1a0c 100644 --- a/drivers/leds/leds-lp55xx-common.c +++ b/drivers/leds/leds-lp55xx-common.c @@ -439,6 +439,8 @@ int lp55xx_init_device(struct lp55xx_chip *chip) return -EINVAL; if (pdata->enable_gpiod) { + gpiod_direction_output(pdata->enable_gpiod, 0); + gpiod_set_consumer_name(pdata->enable_gpiod, "LP55xx enable"); gpiod_set_value(pdata->enable_gpiod, 0); usleep_range(1000, 2000); /* Keep enable down at least 1ms */ @@ -694,7 +696,7 @@ struct lp55xx_platform_data *lp55xx_of_populate_pdata(struct device *dev, of_property_read_u8(np, "clock-mode", &pdata->clock_mode); pdata->enable_gpiod = devm_gpiod_get_optional(dev, "enable", - GPIOD_OUT_LOW); + GPIOD_ASIS); if (IS_ERR(pdata->enable_gpiod)) return ERR_CAST(pdata->enable_gpiod); -- 2.34.1