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 C6E99C6FD1C for ; Thu, 23 Mar 2023 11:24:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231243AbjCWLYz (ORCPT ); Thu, 23 Mar 2023 07:24:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231228AbjCWLYz (ORCPT ); Thu, 23 Mar 2023 07:24:55 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 072D5193ED for ; Thu, 23 Mar 2023 04:24:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679570649; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bElMb8tRd400aVPGEdqHySnfBygLanMFOxdRzx2RmHY=; b=i7QL5IRSsJh2uZnO7rAOuBSMyar4bC0vWXdsjyn6CasigbYIAq5Aw94ZpqkhX77Qk/xn2y era1s8N5me5UZgpI/XZ4ysBP06EWvuy6WsI0SWoVaM3rB7msGLe6vVddwLMQXpd6vWovbn ah9WrnZ5id4W6SEgQj04ZBvyBG1Z6Yc= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-106-pks-hWISOKyMKWVl1b9tEg-1; Thu, 23 Mar 2023 07:24:07 -0400 X-MC-Unique: pks-hWISOKyMKWVl1b9tEg-1 Received: by mail-ed1-f71.google.com with SMTP id i42-20020a0564020f2a00b004fd23c238beso31695232eda.0 for ; Thu, 23 Mar 2023 04:24:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679570647; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=bElMb8tRd400aVPGEdqHySnfBygLanMFOxdRzx2RmHY=; b=KqHQ9p0b2v17MX7FFlXPd+D5hXOPaFR0LrNV5URucqeCZvqMv1Kc2niWV28x5Im+Rn HnjIrm/Raf5TcYkMRjo9c4ZBuUl3UMm+arDyjYfuM3dTbQZL7gMqaehFJ+fhKd5MDdR5 oHhYiemrPADlvhehO13MmNztDLKiyI15v9lPa4koaoLXka0zvOLM0NIuwj5OMsgks4J+ BOjVWTfs5/1BZVh3NmdGcW/PHSaip57+LIlgpPQLJvLQ8cSvVODhl/pgl2gUIKe4jJIJ zNy970heFnsPehFQPQ9gSMg+vKl/ShVifB4OIKMbDmrAnHidB10muKjWY15Kg3i3seTQ zsNQ== X-Gm-Message-State: AO0yUKWtQApLqC6BtKY6ogxgXRiz4CH6fr2uEAlYzJwNKFg0/03i50Fp 5XMPPSjgu0RJfcs+uH1TSRWjFAWgizIJwjzr8/3/FRKjlORzBurq53nek6MkX3euDtYKisRS/bM OmVrUzYfSwoqMkP+xy/BWMDc4PKYDdHRcow== X-Received: by 2002:a17:906:314c:b0:933:4556:d1cd with SMTP id e12-20020a170906314c00b009334556d1cdmr5722871eje.33.1679570646882; Thu, 23 Mar 2023 04:24:06 -0700 (PDT) X-Google-Smtp-Source: AK7set/qbV2U20xLJrdSX7bwVjb3H7386kZEseQhYAyoNi+gZqE4olFNwYVYU2DgCFw6C/uNMw42PA== X-Received: by 2002:a17:906:314c:b0:933:4556:d1cd with SMTP id e12-20020a170906314c00b009334556d1cdmr5722850eje.33.1679570646573; Thu, 23 Mar 2023 04:24:06 -0700 (PDT) Received: from ?IPV6:2001:1c00:c32:7800:5bfa:a036:83f0:f9ec? (2001-1c00-0c32-7800-5bfa-a036-83f0-f9ec.cable.dynamic.v6.ziggo.nl. [2001:1c00:c32:7800:5bfa:a036:83f0:f9ec]) by smtp.gmail.com with ESMTPSA id z16-20020a170906715000b00930894eb708sm8552017ejj.223.2023.03.23.04.24.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 23 Mar 2023 04:24:06 -0700 (PDT) Message-ID: Date: Thu, 23 Mar 2023 12:24:05 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH v3 3/3] leds: tps68470: Add LED control for tps68470 Content-Language: en-US, nl To: Pavel Machek , Kate Hsuan Cc: Lee Jones , linux-leds@vger.kernel.org, platform-driver-x86@vger.kernel.org, Daniel Scally , Mark Gross References: <20230321153718.1355511-1-hpa@redhat.com> <20230321153718.1355511-4-hpa@redhat.com> From: Hans de Goede In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Hi Pavel, On 3/23/23 12:15, Pavel Machek wrote: > Hi! > >> There are two LED controllers, LEDA indicator LED and LEDB flash LED for >> tps68470. LEDA can be enabled by setting TPS68470_ILEDCTL_ENA. Moreover, >> tps68470 provides four levels of power status for LEDB. If the >> properties called "ti,ledb-current" can be found, the current will be >> set according to the property values. These two LEDs can be controlled >> through the LED class of sysfs (tps68470-leda and tps68470-ledb). > > If the LED can have four different currents, should it have 4 > brightness levels? No this was already discussed with an earlier version. This is in indicator LED output. The current setting is a one time boot configure thing after which the indicator LED is either on or off. > >> +++ b/drivers/leds/Kconfig >> @@ -827,6 +827,18 @@ config LEDS_TPS6105X >> It is a single boost converter primarily for white LEDs and >> audio amplifiers. >> >> +config LEDS_TPS68470 >> + tristate "LED support for TI TPS68470" >> + depends on LEDS_CLASS >> + depends on INTEL_SKL_INT3472 >> + help >> + This driver supports TPS68470 PMIC with LED chip. >> + It provides two LED controllers, with the ability to drive 2 >> + indicator LEDs and 2 flash LEDs. >> + >> + To compile this driver as a module, choose M and it will be >> + called leds-tps68470 > > . at end of line. > >> +static const char *tps68470_led_names[] = { >> + [TPS68470_ILED_A] = "tps68470-iled_a", >> + [TPS68470_ILED_B] = "tps68470-iled_b", > > No. See Documentation/leds/well-known-leds.txt . We want the LEDs to > be named after their function. > >> +static int tps68470_ledb_current_init(struct platform_device *pdev, >> + struct tps68470_device *tps68470) >> +{ >> + int ret = 0; >> + unsigned int curr; >> + >> + /* configure LEDB current if the properties can be got */ > > english? > >> + if (!device_property_read_u32(&pdev->dev, "ti,ledb-current", &curr)) { >> + if (curr > CTRLB_16MA) { > > We'll need device tree binding documentation, right? For now this PMIC is only used for the camera in some x86/acpi designs, so no we don't need dt binding documentation (the dt binding maintainers have explicitly asked to not add dt binding documentation for things not actually used with dt). Or I guess we should simply add this to the platform_data which one of Daniel's later patches introduces and drop the initializing of the LEDB current setting from the initial driver addition. I think that that (moving this to the later added platform_data) would be best. Since now after Daniel's patches we have a mix of platform_data + the 1 device-property for this. Daniel, what do you think about moving the LEDB current setting to your "[PATCH 2/8] leds: tps68470: Init LED registers using platform data" patch ? Regards, Hans