Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp969265pxj; Fri, 21 May 2021 03:28:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwd7WsVGJ5qafEfgewH+FSAfHjq/YneNWaaKyEFPPG8LcTmVu+vrfC1Z8wWJCR5JlWucUWr X-Received: by 2002:a05:6e02:1a49:: with SMTP id u9mr11068743ilv.306.1621592917055; Fri, 21 May 2021 03:28:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621592917; cv=none; d=google.com; s=arc-20160816; b=CERuh6+6O4lpdBFrEOviCVhn2dj3EFfmAj/FIv+Cm/6oeKU2vIo+ZEueT80PCQ898t d7AyoovGjC91W5zZydPFC2kKfkF+rvDjZxIjncywxSqw+8NXe/gImipd8kg7tajtPhVN A/2t2+xaDBF7/C3DR0+UgL5HhKkh9+NMqOMpm6xfR1iKIg6MR1ViLuTaBr86GkflIF7o A/oHUE3NFCzMdNsvA2K/CePrjPTToGQIrLOZYDEUTSYTxl/NIDStOlpOeSYO7ThhTuh1 mPJs1nLn6rdxF65vx8O/QQ5EUayUNHrCxAX+XOQgMkszb9hZWApx7ONVvIiN3UyiPQQy ikxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=crfUFGTPalD4yXSTJwQEUnL2QL5B6TGLL3FiBmjfI84=; b=yOFjGzGTqEgUcIkP02R7HNWW1RafZtBd3BJ7lYnOUyQSjRdDHPcOYuihgTBBhyn9gS D0PkhtSU1LtLwnv0E3xWmNow3WJ2ARkb1iXTsd82tkM4MShCt+0i/8ZKT8B61flGHDUL UzRpwiaRXRV1umgvH+86UOv+HuorGYjs1WQa+SzhE84WvMV2cU6a0/GnOdxMZl+YhPBB 7cJbFaA30cxH1Qsx6NzlAHwPzsgD5U70H6H6wawSS3BN/HY4Lfi8hKBRMrV0Uuut0YUh cqI++gUl1ZXx23TvPFiiEGtqzZt3l/hbju21Yo5ka3CZUcqRJdiUre4VoecUj8f96fxn VmfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sartura-hr.20150623.gappssmtp.com header.s=20150623 header.b=2JogOMKu; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t7si5879763ilm.97.2021.05.21.03.28.24; Fri, 21 May 2021 03:28:37 -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=@sartura-hr.20150623.gappssmtp.com header.s=20150623 header.b=2JogOMKu; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230440AbhEUIVY (ORCPT + 99 others); Fri, 21 May 2021 04:21:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230437AbhEUIVW (ORCPT ); Fri, 21 May 2021 04:21:22 -0400 Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4462FC061763 for ; Fri, 21 May 2021 01:20:00 -0700 (PDT) Received: by mail-il1-x133.google.com with SMTP id j30so17527549ila.5 for ; Fri, 21 May 2021 01:20:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sartura-hr.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=crfUFGTPalD4yXSTJwQEUnL2QL5B6TGLL3FiBmjfI84=; b=2JogOMKudm0mxROFyquyt69B7PYnzHPTbHOAOutNWuvHCNn3QO0xdo4kQDYulHhLJO bd9nIYQCpwjSqq5ZmRwFZnPgIjBvEhZcFWUYbveq4WRMu/1K6tf9Wb0rVi8I0OiQjpdb mDjDZfv4zp2qkyHlwvtnjEg65lJ7IbEGBUX12YnRbEnC6xkpISPNmTK07uryUQKrpRPx SmlQDd/Yyd345vY+kPP3ZDHS+nooBiXHiJkq/TggzOh7sNsJpHOWi9LOdKozkfNVzHUY Q0TE/wsQlGuHq0/FOAfoViEwMoyKOwrVcZ8EGTth3Xgrr1WJX/0H1bUdlPKbZvXvsQka ehfg== 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:content-transfer-encoding; bh=crfUFGTPalD4yXSTJwQEUnL2QL5B6TGLL3FiBmjfI84=; b=OdL4mkJBb3GKEBiYqNMbk9N11ChdG0XZE87RYw6R91Q5EUuPSYQQ+XX7oVn37YRVnM a3qa5jf0ftXiwDCQYeS1A/+suH4FMTkD/Qe2IqPVoy6LrmI3D43YwDnAfeS0R7tKr1bK Mf6HKzpmLxUqfkyCjE9Qp9OL0xewHjKIgCJwn6MveVsWRwU0XgvNBtZJRYgjRpRB1aDj YhkAmAlXQErotKJU+VJY1OuC8MGGCJg2rlAovKAOPGU9fwGdXS7HpErSibFI46ifZVmC uPJcU8oSd7xz31i+vvG3Hi7qpKtbPsRHMZZO9/XHa9AaaBuyvTvgb7OhAobxIN8apDxe 1mJA== X-Gm-Message-State: AOAM533Gm52L+9hA9/nrNGI4yNKSu2HjFLFaIrWbGw2XtXVuwHcUa7rk ZU10Q2XbesWsTgcHZ4LrQUPr9UE5wP/TH6at8fRMyg== X-Received: by 2002:a92:4b08:: with SMTP id m8mr9882070ilg.183.1621585199636; Fri, 21 May 2021 01:19:59 -0700 (PDT) MIME-Version: 1.0 References: <20210430123511.116057-1-robert.marko@sartura.hr> <0f28cabf858154842819935000f32bc2@walle.cc> <20210520064929.GM2549456@dell> In-Reply-To: <20210520064929.GM2549456@dell> From: Robert Marko Date: Fri, 21 May 2021 10:19:49 +0200 Message-ID: Subject: Re: [PATCH 1/6] mfd: Add Delta TN48M CPLD driver To: Lee Jones Cc: Michael Walle , robh+dt@kernel.org, Linus Walleij , bgolaszewski@baylibre.com, jdelvare@suse.com, Guenter Roeck , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-hwmon@vger.kernel.org, Luka Perkov , jmp@epiphyte.org, Paul Menzel , Donald Buczek Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 20, 2021 at 8:49 AM Lee Jones wrote: > > On Wed, 19 May 2021, Michael Walle wrote: > > > Hi, > > > > Am 2021-05-19 13:53, schrieb Robert Marko: > > > On Thu, May 6, 2021 at 6:34 PM Michael Walle wrote= : > > > > Am 2021-04-30 14:35, schrieb Robert Marko: > > > > > Delta TN48M switches have a Lattice CPLD that serves > > > > > multiple purposes including being a GPIO expander. > > > > > So lets add the MFD core driver for it. > > > > > > > > Did you have a look at mfd/simple-mfd-i2c.c? > > > > > > Yes, that was my first idea but we have a requirement to expose CPLD > > > information via debugfs as there are userspace applications using it. > > > And simple-mfd-i2c does not allow us to do so. > > > > Mh, last time Lee wasn't very fond of having a driver that just populat= es > > sub-drivers while doing almost nothing itself. See > > https://lore.kernel.org/lkml/20200605065709.GD3714@dell/ > > Right. I still feel that way. > > > That being said, I'd also like to expose our CPLD version, but until no= w > > haven't found a good solution. > > Why though? Does S/W *need* it? Because we have userspace S/W that uses it as the same CPLD is in multiple variants of the board but the correct board model is set during manufacturing and we can read it from the CPLD. We also have information about PSU1 and PSU2(Some models only) power good, whether they are present and some other info that I need to expose as these are monitored in userspace. I planned to do that via the hwmon driver but according to Guenther they are not hwmon attributes and I agree. Would it be possible to have a dedicated driver that would only expose the required information via debugfs? Then I could simply use the simple I2C MFD driver with only a GPIO driver on top of it. Regards, Robert > > -- > Lee Jones [=E6=9D=8E=E7=90=BC=E6=96=AF] > Senior Technical Lead - Developer Services > Linaro.org =E2=94=82 Open source software for Arm SoCs > Follow Linaro: Facebook | Twitter | Blog --=20 Robert Marko Staff Embedded Linux Engineer Sartura Ltd. Lendavska ulica 16a 10000 Zagreb, Croatia Email: robert.marko@sartura.hr Web: www.sartura.hr