Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4326348pxf; Tue, 30 Mar 2021 05:17:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxM2qbpzLGzKwFmOqo8kcW/kLYB9sLKVP0EjtR7Mik9nzqvVo/NgMZZ0kI91Oncc3EF5nOA X-Received: by 2002:aa7:c957:: with SMTP id h23mr32890825edt.301.1617106644526; Tue, 30 Mar 2021 05:17:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617106644; cv=none; d=google.com; s=arc-20160816; b=WDn3vbk80hiut4yP6NrTEnZSx44/Km6wtTou5ut9OYt2bbvvBtwuzOGOKOJWKXs4yt DYZgTZJsTuLLfQr7LINYAa5PvR5LQSnwq9aY+52TurXG/15N3n2pm+pGzq3E4Sg+wsQo 0QG2w6alGbk733qMi6tfqKiZcsoDsV9wLWuYl0vo8Hdpk706hVS96jwl/+cq27pPssOF SM5fDIjuKPofMKAjEtY7rilq+Iqsko6R1tcDEH94hKZQrUDqdHr9JoqhIFxFzjXSB/zy 664clNyZ+EZD7JiN3N6lf9VYGIb6yBU4qH7OdSvlZAKJp/QZkdAToZvX5FaSo2e2OvkO Q+og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=VQL2oYFkG5vd+itMq4+E4VOAEnKIdQPKP6y6SbyqzVU=; b=GJkzuEUg7Ifsdp98D5sBwfkXzpY24PscpMrxmnvepQCsV1b2c8ht+oi8npwv0sVJ1h fpEpiSW7bITgAkJsOJ9M7PNDFCLk3VCXsA9h6/6RPe0g2qjGdhGFZK7MDOHrWkFesXth oQ/xyLTqAnqx6gsnJr1uXcbCX551/c1talNdlKX9Punx5Tqc1iiET8+aZmU8Ju9MEmDF AVh1zse8a39Gu0zhHb+UW+TTWEZHnXgpEA7Ub02fTbjVMV8aJgASwltaji2wX9ocUmPh czhulYcctfiweEeDFIww+CQ/td7525jS6LwX0fwtAseikmzPtQgUyUnIE+s0FY0nzfOh qtTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TYBQIVu8; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ju22si14157184ejc.514.2021.03.30.05.17.02; Tue, 30 Mar 2021 05:17:24 -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 header.i=@gmail.com header.s=20161025 header.b=TYBQIVu8; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231980AbhC3MP7 (ORCPT + 99 others); Tue, 30 Mar 2021 08:15:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231869AbhC3MPd (ORCPT ); Tue, 30 Mar 2021 08:15:33 -0400 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CFC0C061574; Tue, 30 Mar 2021 05:15:33 -0700 (PDT) Received: by mail-pg1-x52e.google.com with SMTP id p12so6937684pgj.10; Tue, 30 Mar 2021 05:15:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VQL2oYFkG5vd+itMq4+E4VOAEnKIdQPKP6y6SbyqzVU=; b=TYBQIVu8VRUdehT+Bv32TVbEb1GzNKohXeDDCWikLat3CPfvcJjENxP3cMSoG9umxY 5bfqf4/jHihULOio899alfoClGf+3rvm16+5SPIaz3WPfbX/nTSZ21Us9DDT1v1SV8x/ s0cYXSfno8zyT4Q3D615EAoJRohr57ciLJ6EUV40kqpaPIAkNu/trNtGz5n4t61nvTzk 45g5+7uy4haJkBYypZuKq5lRfA60uwPXexOOb0sdK7v9nvpPg87bBGIt9DRM7O4hqyeW 1QfaHdUSDGDHeKNa9i8wKZTKzwVCycdayeDMPv9NTlTqZtb/CqoWW4KYHTzhp6Tr+XX7 I4HQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VQL2oYFkG5vd+itMq4+E4VOAEnKIdQPKP6y6SbyqzVU=; b=jsg0NpE5V8oAUDzpfJdsTphcTLY+DIzJzUSdS5KRsU4xrfNYqj6fWUSL9IGiVIIzFR SFpdDG3KH3k6aZYB6xIGKqSpsSP0FDnWYTBAqlyG7HmT/ZqOM1tQzpXh9eqf9GsG66Pg StnhyVlATLx305WAR/rGhzpy1TaNLHwNEx8CVpPw4AXOhqudXmJTuLPin47cT1rHMwS/ LRBl6pwX3cZc9r8OQOx7KKQAPaVV7LcaBiCK2EjMCD1kvnTKgEhLOX9wc4HE+LdLZUb3 JSgy8qEKs6Q6Y8BXsabUDuQaovck9hZRTeCtcGzARCFG401f6WbJUvrsOLNa+MygGpwj mO5Q== X-Gm-Message-State: AOAM531XzHU6PjNsQKlozfGad2CEM3N26jSHsLPnpTBOOAX0sI26yJU5 TZRg1nAdXqg3MezFS0pZBSkqcllcfewVS6NhEmbXWQxms0CNmg== X-Received: by 2002:a62:e50f:0:b029:214:8e4a:ae46 with SMTP id n15-20020a62e50f0000b02902148e4aae46mr30125371pff.73.1617106532719; Tue, 30 Mar 2021 05:15:32 -0700 (PDT) MIME-Version: 1.0 References: <20210329174928.18816-1-henning.schild@siemens.com> <20210329174928.18816-3-henning.schild@siemens.com> <20210330135808.373c3308@md1za8fc.ad001.siemens.net> In-Reply-To: <20210330135808.373c3308@md1za8fc.ad001.siemens.net> From: Andy Shevchenko Date: Tue, 30 Mar 2021 15:15:16 +0300 Message-ID: Subject: Re: [PATCH v3 2/4] leds: simatic-ipc-leds: add new driver for Siemens Industial PCs To: Henning Schild Cc: Linux Kernel Mailing List , Linux LED Subsystem , Platform Driver , linux-watchdog@vger.kernel.org, Srikanth Krishnakar , Jan Kiszka , Gerd Haeussler , Guenter Roeck , Wim Van Sebroeck , Mark Gross , Hans de Goede , Pavel Machek , Enrico Weigelt Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 30, 2021 at 2:58 PM Henning Schild wrote: > Am Tue, 30 Mar 2021 14:04:35 +0300 > schrieb Andy Shevchenko : > > On Mon, Mar 29, 2021 at 8:59 PM Henning Schild > > wrote: > > > > > > This driver adds initial support for several devices from Siemens. > > > It is based on a platform driver introduced in an earlier commit. > > > > ... > > > > > +#define SIMATIC_IPC_LED_PORT_BASE 0x404E > > > > > +static struct simatic_ipc_led simatic_ipc_leds_io[] = { > > > + {1 << 15, "green:" LED_FUNCTION_STATUS "-1" }, > > > + {1 << 7, "yellow:" LED_FUNCTION_STATUS "-1" }, > > > + {1 << 14, "red:" LED_FUNCTION_STATUS "-2" }, > > > + {1 << 6, "yellow:" LED_FUNCTION_STATUS "-2" }, > > > + {1 << 13, "red:" LED_FUNCTION_STATUS "-3" }, > > > + {1 << 5, "yellow:" LED_FUNCTION_STATUS "-3" }, > > > + { } > > > +}; > > > > > +static struct simatic_ipc_led simatic_ipc_leds_mem[] = { > > > + {0x500 + 0x1A0, "red:" LED_FUNCTION_STATUS "-1"}, > > > + {0x500 + 0x1A8, "green:" LED_FUNCTION_STATUS "-1"}, > > > + {0x500 + 0x1C8, "red:" LED_FUNCTION_STATUS "-2"}, > > > + {0x500 + 0x1D0, "green:" LED_FUNCTION_STATUS "-2"}, > > > + {0x500 + 0x1E0, "red:" LED_FUNCTION_STATUS "-3"}, > > > + {0x500 + 0x198, "green:" LED_FUNCTION_STATUS "-3"}, > > > + { } > > > +}; > > > > It seems to me like poking GPIO controller registers directly. This > > is not good. The question still remains: Can we simply register a > > GPIO (pin control) driver and use an LED GPIO driver with an > > additional board file that instantiates it? > > I wrote about that in reply to the cover letter. My view is still that > it would be an abstraction with only one user, just causing work and > likely not ending up as generic as it might eventually have to be. > > The region is reserved, not sure what the problem with the "poking" is. > Maybe i do not understand all the benefits of such a split at this > point in time. At the moment i only see work with hardly any benefit, > not just work for me but also for maintainers. I sure do not mean to be > ignorant. Maybe you go into details and convince me or we wait for other > peoples opinions on how to proceed, maybe there is a second user that i > am not aware of? > Until i am convinced otherwise i will try to argue that a > single-user-abstraction is needless work/code, and should be done only > when actually needed. I have just read your messages (there is a cover letter and additional email which was sent lately). I would like to know what the CPU model number on that board is. Than we can continue to see what possibilities we have here. -- With Best Regards, Andy Shevchenko