Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp176364pxf; Wed, 17 Mar 2021 19:13:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyD/mTUIzxtxGFvLC9++6x3EO7IrarpsdcqbLv8myHE++P6azNjl9xbWTbV+FyI01JeLQYT X-Received: by 2002:a05:6402:17d5:: with SMTP id s21mr762585edy.65.1616033602242; Wed, 17 Mar 2021 19:13:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616033602; cv=none; d=google.com; s=arc-20160816; b=xj81JLJY5UZbT6oFbjEMBZ0NERyViwgW8bqv3iAanfoIGJ2JqjdFCWISS5+N/P85c+ FMmsCpcmrCA+ButA7SaB8P+D8sGzGO2hgV3y9PU6RsqIT4nnN6CTf2QDmQ/4Wk/YlTxb QR7eqLGYzZCTZrBzdzW4vfUM+nvWEKKifhViNCDOjN7RqIhKHUAl0U+AZvda81ohRGvt HOI78HOpYFScAKGgjAGtshthFt14WIbDtJYOHNACZsY3dzzqhzJEaIPrM6yehBPb5uNG vWFsbI4VFYOB+dVqMII85oKoLiPy7tjwEI7iKmd/KsIWAIBxsRHB8U9di49b/7EpU4FM 3gIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=79JSNtFL9rJhQrhCSR7TSC+YDAGv+A8hVh/ky4qOLNI=; b=UTLrJZ4o2QgRKM555sQSZ5Nv5U4JWjy7wDvobWSDrVj7MzK/b8CbrzBb2LzWZHo4YF JL6cd3mAelW8MPm0RYhdMQjJ3A8g91Xj/lZ7C1tLSDqkNaHeVi873P4HhBkdJ9dYgbNj wUCsseriK88yfoywvC7uJdqK9UaKzmHaUfiighT2SgYl92L74RdMOuQpuJ6J76Gx2iGR DIeLhe5C30lje+FtIAtFZAwteskamEOo6Syv+66MRfdw+8In5q5myKL+g3Pu+iPbXWa8 qjnqN18HkXGuq8he6mPPgMdEJdY4GZEHXwGqUyCUm97VDUyXRDXUB0iwpDmztlMHKKum 3Ddg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@axis.com header.s=axis-central1 header.b=fbXRvepN; 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=axis.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cb23si471361ejb.496.2021.03.17.19.13.00; Wed, 17 Mar 2021 19:13:22 -0700 (PDT) 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 (test mode) header.i=@axis.com header.s=axis-central1 header.b=fbXRvepN; 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=axis.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230434AbhCRCLx (ORCPT + 99 others); Wed, 17 Mar 2021 22:11:53 -0400 Received: from smtp2.axis.com ([195.60.68.18]:39726 "EHLO smtp2.axis.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230486AbhCRCLn (ORCPT ); Wed, 17 Mar 2021 22:11:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1616033503; x=1647569503; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=79JSNtFL9rJhQrhCSR7TSC+YDAGv+A8hVh/ky4qOLNI=; b=fbXRvepNIABmiTus012nyXOPpYIP7EH48DTcKk1Tj2p6qO1VSGUts7K7 po0vFXBMeONjpNTmzkMvYEwXnnU78HfTeb/f7/5/pbXD835fbEgTOOPxM 6aJVbVmhil4/xAImSiaU0Bg1gvrcF7vEwWmBQx77/nlaRbMws5j4DT70+ fo+XcE4q0wN27DgMnU6oFs0sGCd57j67qO9gwjyViYBWtgJifEhm/7J7Q 9lLSTVcPRDPmKvSmux+B1Daywf3LvdQFuQH61VC9ESF2Zg4N7OxmtHtNz v6ZQ5PVeXqonI2DXR1EDL0AvlDmaLayM7i5OkW8U6Qt/qtd6zO7zHpIye A==; From: Hermes Zhang To: Pavel Machek , Marek Behun CC: Dan Murphy , kernel , "linux-kernel@vger.kernel.org" , "linux-leds@vger.kernel.org" Subject: RE: [PATCH] leds: leds-dual-gpio: Add dual GPIO LEDs driver Thread-Topic: [PATCH] leds: leds-dual-gpio: Add dual GPIO LEDs driver Thread-Index: AQHXFnc53ECqmB4gek68ETSLZV586Kp/A6+AgAoFnGA= Date: Thu, 18 Mar 2021 02:11:42 +0000 Message-ID: References: <20210311130408.10820-1-chenhui.zhang@axis.com> <20210311180225.GA11650@duo.ucw.cz> In-Reply-To: <20210311180225.GA11650@duo.ucw.cz> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.0.5.60] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > + priv =3D devm_kzalloc(dev, sizeof(struct gpio_dual_leds_priv), > GFP_KERNEL); > > + if (!priv) > > + return -ENOMEM; > > + > > + priv->low_gpio =3D devm_gpiod_get(dev, "low", GPIOD_OUT_LOW); > > + ret =3D PTR_ERR_OR_ZERO(priv->low_gpio); > > + if (ret) { > > + dev_err(dev, "cannot get low-gpios %d\n", ret); > > + return ret; > > + } > > + > > + priv->high_gpio =3D devm_gpiod_get(dev, "high", GPIOD_OUT_LOW); > > + ret =3D PTR_ERR_OR_ZERO(priv->high_gpio); > > + if (ret) { > > + dev_err(dev, "cannot get high-gpios %d\n", ret); > > + return ret; > > + } >=20 > Actually... I'd call it led-0 and led-1 or something. Someone may/will co= me > with 4-bit GPIO LED one day, and it would be cool if this could be used w= ith > minimal effort. >=20 > Calling it multi_led in the driver/bindings would bnot be bad, either. >=20 Hi all, I have try to use leds-regulator to implement my case, most works. But the = only thing doesn't work is the enable-gpio. In my case, we don't have a rea= l enable gpio, so when we set LED_OFF, it could not off the LED as we expec= ted.=20 So I think I will back to the new multi LED driver, but make it more generi= c.=20 Best Regards, Hermes