Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp7638881ybl; Thu, 16 Jan 2020 03:08:07 -0800 (PST) X-Google-Smtp-Source: APXvYqwYsfdmUIZuj/zZRZ/5/5Jku5CflSGfILq86prF3YpIpNZNDuJ1XnjKWiHt1EAxUcNd25bY X-Received: by 2002:a05:6830:2110:: with SMTP id i16mr1438580otc.337.1579172887714; Thu, 16 Jan 2020 03:08:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579172887; cv=none; d=google.com; s=arc-20160816; b=q5ecmS1SiwANy+J3lfDTdwWJ2bdN7ylfg5NtTrThBgjaEKv1qnxF4iu8uKALqwNkdu HSUa4mklqQYjmiV3kg9te9+jL+2qGpcOX5jlRpkhZ2C+6ZGtQxLRGGDxu2DBMEBj3IAl qz7aTRBU+CawCuWKAdvyu3Y8wWeToEdc7WoJT6BeoTHQ161mt+wNQtkEdkVNGcnPNiEG +VHi3zisYcuIJr3VNmMz/wH68cgrSSqKeEvt4y8kdR5f98kkVdwubWRx1v1L/aG/Qt+H ufXD1qybAySueAB5HifrxBPRlF2IHaLO8Bwn/LYgKxbIJclrugnvUoSjD0E7jalgfkzp Mzyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=aZ33LLwcxY87+AqHZtou2DOAAwrQai24pOpP9FDDJ7g=; b=rCKmyBPMoZRg/E1mH1+NucvrQwEfBg+WMeSqc3+RsEhb3cf+eCfP7YtTo6en2bTzFm 5hy5vv2oHw/clymvkl0jmmF2kxWbIUjRD4wqAoyUGOe2MDRuzfC2zwsR0YmzetDDXdnI J9l+4UWEB4vqAy+zPM1peny8JLhg/lozRDTTKPgB7kQlTuOu+jkRyJlAKQOSCdDKrQ3Z MsVkHamr6NzT5Q0Py6GTNvOC6gMg1jxjxQR7SMsUH128h0RETL34eeinrQBRpnw3hqgj IOGM1YAhXTLt4ieCJVpmsuWwln4BE9Id3Jh4I97EYDfbYZ0102drtdeIvBQu5LRpYqET 7JSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d17si11447158oib.174.2020.01.16.03.07.55; Thu, 16 Jan 2020 03:08:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726189AbgAPLFs convert rfc822-to-8bit (ORCPT + 99 others); Thu, 16 Jan 2020 06:05:48 -0500 Received: from mx2.suse.de ([195.135.220.15]:56806 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725800AbgAPLFs (ORCPT ); Thu, 16 Jan 2020 06:05:48 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 734F8AEF9; Thu, 16 Jan 2020 11:05:46 +0000 (UTC) Date: Thu, 16 Jan 2020 12:05:45 +0100 From: Thomas Bogendoerfer To: Dan Murphy Cc: Jacek Anaszewski , Pavel Machek , , Subject: Re: [PATCH] leds: add SGI IP30 led support Message-Id: <20200116120545.2f4a907b9ddda84e76e445e1@suse.de> In-Reply-To: References: <20200115130536.11453-1-tbogendoerfer@suse.de> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.32; x86_64-suse-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 15 Jan 2020 07:46:13 -0600 Dan Murphy wrote: > Thomas > > On 1/15/20 7:05 AM, Thomas Bogendoerfer wrote: > > This patch implemenets a driver to support the front panel LEDs of > > SGI Octane (IP30) workstations. > > Thanks for the patch > > Some nitpicks below > > > > Signed-off-by: Thomas Bogendoerfer > > --- > > drivers/leds/Kconfig | 11 ++++++ > > drivers/leds/Makefile | 1 + > > drivers/leds/leds-ip30.c | 82 ++++++++++++++++++++++++++++++++++++++++ > > 3 files changed, 94 insertions(+) > > create mode 100644 drivers/leds/leds-ip30.c > > > > diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig > > index 4b68520ac251..8ef0fe900928 100644 > > --- a/drivers/leds/Kconfig > > +++ b/drivers/leds/Kconfig > > @@ -836,6 +836,17 @@ config LEDS_LM36274 > > Say Y to enable the LM36274 LED driver for TI LMU devices. > > This supports the LED device LM36274. > > > > +config LEDS_IP30 > > + tristate "LED support for SGI Octane machines" > > + depends on LEDS_CLASS > > + depends on SGI_MFD_IOC3 > What is the dependency on the MFD? the gpio lines where the leds are connected are managed by the mfd ioc3 driver. So without that driver this led driver will not be started. > > + > > + > > + if (num == 0) { > > + data->cdev.name = "ip30:white"; > This also needs a function as defined in dt-bindings/common.h > > + data->cdev.default_trigger = "default-on"; > > The name, color, function and trigger can be pulled from the DT or Firmware. > > The firmware should contain a node for each LED to be configured. SGI Octanes don't have DT and the firmware just toggles some of the leds, but doesn't provide informations about it. That's why this is hardcoded in the driver. The MFD driver detects the ioc3 chip and knows it's a SGI Octane mainboard and creates the led platform device. How is the correct way to this without DT ? > > > + } else { > > + data->cdev.name = "ip30:red"; > Same as above > > + data->cdev.default_trigger = "panic"; > > + writel(0, data->reg); > > Is the LED on by default? Depends on the hardware state. If PROM firmware detects some hardware issues, it turns on the red LED. Otherwise it's off. Thomas. -- SUSE Software Solutions Germany GmbH HRB 36809 (AG N?rnberg) Gesch?ftsf?hrer: Felix Imend?rffer