Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4282695pxf; Tue, 30 Mar 2021 04:06:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5SpTY+dNC+02mgsVC7S6L7zXzkLNpRMI4UbtddNi5oZ6Y4zE5zZuj7c4n/NJ4NX7jJhEL X-Received: by 2002:a17:906:400b:: with SMTP id v11mr32615211ejj.194.1617102401240; Tue, 30 Mar 2021 04:06:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617102401; cv=none; d=google.com; s=arc-20160816; b=U3UXNOPsJsgBxAdTR4hd9YfLvDx0ut4VooTE6Aj0ejnS02E1phXQNPoL1nQPvAMPVD GD38ji1YsKsN6PlX74ei1INU06ViN3p+ewrAA6sL/rfK6ou/xi/taEc8Ik4KEAQg7G2H U/hvk0GsVKixOpSedSMmPVDl/mvPHASmFciOJy831GerMeFEgC/50UP6lQFFzh58AFgf 7gPOfByzvOFuHC9qAqTkqFa6LP9sS7YVAAMPdi5Fn++uiI1gNIBliLPtOb3XrAiRDmuB pdIpDT5kxasvMo03Kc5xQjzTR5GRvt+RI2FKEE9ojHSgqkLdxbURi/1rvaIgHaJUYGbj AsWg== 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=MLBeoULdugcCnUPIfdbDs+A8k9dizPk/RhGEW8FH4qI=; b=yQRZCVHbMnU8GsEpZUF1ovlU5ONnFWwBC5cFA5fjhvP38DUD7szxnB7A7hZffCuz5v NrZWJ/6gzwXP0SQ9VuY5sGatDk69jiI61I3FvMNvbmR5gCl0Hep2eY9SgzYCcFCWaFp2 O+4WDJl9w+y8iGW7j/nWI4nwcb6xvXuWVd8GoOKybC2wIsHcS72X0hQy2u0b+69zM7iP kThYJrLhi25Mb3yLMzeM8vLf3War6aqDaz/IDSMIOJuQcIFalnHArAed7kigm3VeG2do waUgthuk2B4ZlO6X5u1og+zItttnI6WBB3U1fve6K8KKZqIO8bbLszmQM37q5xKWwa8/ nZ/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZY2H8JjG; 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 q8si15414030ejy.320.2021.03.30.04.06.18; Tue, 30 Mar 2021 04:06:41 -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=ZY2H8JjG; 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 S231858AbhC3LFM (ORCPT + 99 others); Tue, 30 Mar 2021 07:05:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231761AbhC3LEw (ORCPT ); Tue, 30 Mar 2021 07:04:52 -0400 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67913C061574; Tue, 30 Mar 2021 04:04:52 -0700 (PDT) Received: by mail-pg1-x536.google.com with SMTP id l76so11460058pga.6; Tue, 30 Mar 2021 04:04:52 -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=MLBeoULdugcCnUPIfdbDs+A8k9dizPk/RhGEW8FH4qI=; b=ZY2H8JjGdzPSlsPLMpktphd4H2J8L1GzUZCBlFCNBZFB3VLKxP0qGA4K1+sm+g/cN9 DyubWtZkl2gL+3UolES1JuoIYhCg7XUUpx5adse/HTlBfoiRDXFWit/MUqQ2ZNrtVx1Z Tk4M7YxnU4SFpxLtn/7jH3IVurPR1ZrkdmPQH9hxEFEAZBR21NGyxiwIOoPkIG6ubroS /ihOldBcfihI2sHottMzTg1v3O+0y2zDY6F62uCII8E5n9012CIIddIXy0x3vLZ5RuvN n4WGK0+3QZtg8nfZ8HXmy110rUjX1gjnF+IFM1TOJqRZjr4y7xUetDMRMiH0EPHXR+7J QOqQ== 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=MLBeoULdugcCnUPIfdbDs+A8k9dizPk/RhGEW8FH4qI=; b=kz/efTzcNnoaRaSJOybbwcPSZtO7dlN3YF+iYT2Z5MhGb0K1yCILPlaFCYTPTpTQbh tUPNP4eX1/TmDimzeoTuJS/DtFAp+ESyP2kABDLToNzpkHUQy5UY8LjIoHqK5GnoTzoq T/PK2gRNsTJoHA1VIUcZeOJWr17y7RBoPvQl7AJzsbEbBNkisEdo1XtC3gN0tC6to1l1 lFJjVej6yLbWGgm/VdgHnmD7MUd4wMKjxUD3q8dbAQAARwS3On8HgIQ/HXPXcloue2Ak jTKn2RXC+CaTgYwaFSFpfZdceEGc9ktBk8htiZhvFSONmvd8jSESAq7C+PWP3w4HR5cZ 0IYA== X-Gm-Message-State: AOAM531G7g3BCnPuzn3Ax3fkdcbTCRylbQffG9TiYrrCmj0WdYWEwzRW 6nKNDip26W3AOjqUfdkXgq6Y+vaxYB/ZyEUxeNs= X-Received: by 2002:a63:cb44:: with SMTP id m4mr5367809pgi.4.1617102291959; Tue, 30 Mar 2021 04:04:51 -0700 (PDT) MIME-Version: 1.0 References: <20210329174928.18816-1-henning.schild@siemens.com> <20210329174928.18816-3-henning.schild@siemens.com> In-Reply-To: <20210329174928.18816-3-henning.schild@siemens.com> From: Andy Shevchenko Date: Tue, 30 Mar 2021 14:04:35 +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 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? -- With Best Regards, Andy Shevchenko