From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52608C433E6 for ; Mon, 15 Mar 2021 12:42:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 23FDB64EE8 for ; Mon, 15 Mar 2021 12:42:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229690AbhCOMll (ORCPT ); Mon, 15 Mar 2021 08:41:41 -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