Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3260613pxf; Mon, 15 Mar 2021 05:42:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJI+sefBlzqBGdK7sxgb4pI0Dyq19uKfZCRqvuPdxDb6tWRN2JPG3F1gw0ry4WjYsQzHsu X-Received: by 2002:a17:906:ad4:: with SMTP id z20mr22801446ejf.496.1615812177078; Mon, 15 Mar 2021 05:42:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615812177; cv=none; d=google.com; s=arc-20160816; b=jRoTcvw2TvC06tPLWOEXn9Vp2ieozkIBe01h2a4pUf6d6bnBydvf3MWuC+3cipVpn0 qAyjEg7cxyymD4bfFgrpsK+HeCHllAtaLEuQM3a90Ike8oIPK+K3+onAy2NiqMym8mHQ Nj8oaKzyb7kbs69/s4rBdwqxzVkXbC865ONStmuphFLlBd7drSqKMyMmT1R5oI4K/oNy J3v2y+derKM15Lf39jxXQfziRsVaIGvtV4+x1PcfgXvBAjkSwtsHEai5zVg0z1YOdjbz 5vkw+F/jBy21OUBmK5p6mDvcZZBHsHbhDtYOfXM4joGL/pF3RGFGM0pE/aTJAi3Qo8x/ AKnA== 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 :references:in-reply-to:message-id:subject:cc:to:from:date; bh=41bB9xp4x/RHFTgNZKUQL0dVun7Y1R+d3Z/d4OLZsf0=; b=CiBTxg3Y1eRhBClzxLW4e/63R32jSI910wG7fn+7YaYfJN1xovWY+NcqvTPvCaW5+k CDj0fefiQEo38M32YnP3ybcHtR/4ipSZF7CXsbYN840He0sFkO/Q64yYIc2UjqGC10aW C68QoLtnDo5CyuKpnAOu7mEj+sJjN/VM6knNQb3KBCEtS7qG1xEPBdOptgu97zhwsRwc nxayeAoRVRGWymSSgknSgyrYC24epyQGhCp4d1PMQN+5X7dx+f+5huc9YdlpZAyRErvQ 426qOtjZS7xl1nH2FJTyEbIIqz3tDbGBmjwAjfe/4j+lkC2y2ZSgrTR+3fSXLsDhYCoM C61g== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i21si10477097ejv.334.2021.03.15.05.42.34; Mon, 15 Mar 2021 05:42:57 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229681AbhCOMlk (ORCPT + 99 others); Mon, 15 Mar 2021 08:41:40 -0400 Received: from gecko.sbs.de ([194.138.37.40]:40361 "EHLO gecko.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229588AbhCOMlO (ORCPT ); Mon, 15 Mar 2021 08:41:14 -0400 Received: from mail1.sbs.de (mail1.sbs.de [192.129.41.35]) by gecko.sbs.de (8.15.2/8.15.2) with ESMTPS id 12FCeq9G000457 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 15 Mar 2021 13:40:53 +0100 Received: from md1za8fc.ad001.siemens.net ([139.22.41.172]) by mail1.sbs.de (8.15.2/8.15.2) with ESMTP id 12FCeqwf001749; Mon, 15 Mar 2021 13:40:52 +0100 Date: Mon, 15 Mar 2021 13:40:50 +0100 From: Henning Schild To: Pavel Machek Cc: Andy Shevchenko , Linux Kernel Mailing List , Linux LED Subsystem , Platform Driver , , Srikanth Krishnakar , Jan Kiszka , Gerd Haeussler , Guenter Roeck , Wim Van Sebroeck , Mark Gross , Hans de Goede Subject: Re: [PATCH v2 2/4] leds: simatic-ipc-leds: add new driver for Siemens Industial PCs Message-ID: <20210315134037.7f8529e7@md1za8fc.ad001.siemens.net> In-Reply-To: <20210315111915.GA14857@duo.ucw.cz> References: <20210315095710.7140-1-henning.schild@siemens.com> <20210315095710.7140-3-henning.schild@siemens.com> <20210315111915.GA14857@duo.ucw.cz> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Mon, 15 Mar 2021 12:19:15 +0100 schrieb Pavel Machek : > > > + struct led_classdev cdev; > > > +}; > > > + > > > +static struct simatic_ipc_led simatic_ipc_leds_io[] = { > > > + {1 << 15, "simatic-ipc:green:" LED_FUNCTION_STATUS "-1" }, > > > + {1 << 7, "simatic-ipc:yellow:" LED_FUNCTION_STATUS "-1" > > > }, > > > + {1 << 14, "simatic-ipc:red:" LED_FUNCTION_STATUS "-2" }, > > > + {1 << 6, "simatic-ipc:yellow:" LED_FUNCTION_STATUS "-2" > > > }, > > > + {1 << 13, "simatic-ipc:red:" LED_FUNCTION_STATUS "-3" }, > > > + {1 << 5, "simatic-ipc:yellow:" LED_FUNCTION_STATUS "-3" > > > }, > > > > Can you use BIT() macro here? And can it be sorted by the bit > > order? > > There's nothing wrong with << and this order is fine. > > But I still don't like the naming. simantic-ipc: prefix is > useless. Having 6 status leds is not good, either. You asked about a picture before, so here is one example https://support.industry.siemens.com/cs/document/67235073/simatic-ipc427d?dti=0&pnid=16756&lc=en-WW page 19 shows how the box looks like page 135 it what the implementation is based on Externally human visible are 3 "lights", which can be off, red, green, yellow. Internally every single "light" has two leds and yellow is a mix when red and green are on. Unfortunately hw does not allow all 4 states for all 3 lights. Some boxes implement "yellow" mixing in hw. That is why the same name is used with two colors. maybe those LEDs qualify for multi-color? "status" was the best name i found in the dt-bindings header i guess i can be creative with the names and take ie "status", "fault", and "indicator" i will also drop that prefix "simatic-ipc" that was inspired by "tpacpi", or should it be "platform::"? regards, Henning > > > + struct simatic_ipc_led *led = > > > + container_of(led_cd, struct simatic_ipc_led, > > > cdev); > > > > One line? > > 80 columns. It is fine as it is. > > Best regards, > > Pavel