Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1395120pxj; Fri, 21 May 2021 13:11:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4CUBAYnbbVL520O7FGGSg9MWf/WlhMtl0aaeoIf62pHHC9Y6wLg3g6mFohVefOtwgMprL X-Received: by 2002:a17:906:ccdd:: with SMTP id ot29mr11992024ejb.72.1621627860693; Fri, 21 May 2021 13:11:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621627860; cv=none; d=google.com; s=arc-20160816; b=Y51A/HP+MK4+VRI/lB11Vss/c23r+xJxEYGGcq4pgrshJWGvuZ28MuSqYWyhqKsaxO FD1tfNAwXddtTfgOlmfm7AGFCKYmgM4b0jwpSFJN7z2MhD1CE/fiLoA1foTFs2gDHT7H lYtubhWhmPRExwkEOqwoEkTk+oCQxzbHgYhImnMUNpyZYHMnhH3o3X564sp4ABhsLAIE evOk/srsNEkFtQSvm5xGYAgG4sbHR3s+j07U5uIz15mGz+vPfQjEm9BIaD1LeYTAUEH1 wQItv0Up54BBDY2HJPm6Luou0dXfy7FyjoHzO6pFoUS/A2aoFniaDdI5Y+7zxv17w3mt Ialw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=NVeFvnslJm0NrUQoEG65cVcipY5NIH0ZF36v3zq0FTg=; b=Dv2qSYB58TbVAcVI8rCoDR5c19T7aMp51HQvvoW04spA9AJ4216AtuDdZJTPP5ETHi X82xHkwRHSphgyCx0+iZNmCJQ1emqGwP7xyxK5VjXOkLE4B7ox35ZHJpfoXDHCBdu4Ug 4gvTLk5t+fi51ybNvdDVFKBs/knOBudRCxduvGCmzdQZklxK7JysHZzylz/h57LhslNP jk9w6+3QZ64nnbqy55EvpCecJQZXLwsYx8QBzBFHLiZRF4KVOxxDE1xdEfO+hXUC54Pd /zqbr5EJx36jziA7zhRAtpezRaNoGAoJVvP3gGriL0xx6wbYRjpExtjpls7wWSwMprJo 3xog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="og2k8/CL"; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e14si6566130edc.52.2021.05.21.13.10.37; Fri, 21 May 2021 13:11:00 -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=@linaro.org header.s=google header.b="og2k8/CL"; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235256AbhEUJF0 (ORCPT + 99 others); Fri, 21 May 2021 05:05:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233884AbhEUJFY (ORCPT ); Fri, 21 May 2021 05:05:24 -0400 Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63A72C0613CE for ; Fri, 21 May 2021 02:04:01 -0700 (PDT) Received: by mail-wr1-x42e.google.com with SMTP id x8so20265116wrq.9 for ; Fri, 21 May 2021 02:04:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=NVeFvnslJm0NrUQoEG65cVcipY5NIH0ZF36v3zq0FTg=; b=og2k8/CLk2k/C88E/bMpECPEveew+ihVAZE8yefd7VEVD6xcfUaGDOwdZzpdgLH1kf BeEQy5oj++ccKoLUpvj7ToMHYdPUh0JfHZW7djmv4yUAlGLKRHyyFb62n4kT49s7iCiN PTPT1m4f2VYtK2k7wWHcUyV9D1wsRu3SrC7ziGkG33pSquRv64HnYxqU3mvPu9t+/VNF yG74Ob9PIhSkuY0hPGgLCofWkjFQW7ghmIrmkyLcB6xEQpZHJltAPRAGUeaph+NcPB7y nsVCtYr4y7srRTBBGgZjeYMca2NCUq2Db1O+GEdSLovs/gsmVwIi8qv8PiMOE/2EQ+hq uzbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=NVeFvnslJm0NrUQoEG65cVcipY5NIH0ZF36v3zq0FTg=; b=Ia6yj5bqhrUdPMsQFDVMKgFi7+CYrNTy27AtWpPWBBJc9rPfiYhqvDfm5I3puRN9PX 7Wsf10gxWT17OSmEnRDpT9q3JOJU2RRJvu0jcQZ2LlYG8vGRb2eQcBLmy2vCssAWzo3w gumu/aQwUwEXGkOYOcK9eYRskJKH7HkBILVPe5VgtO98TaAiy8Dml6ZDvGrUJAC53KPL doUdcrkKo3OMOpDtv+e8UTx7WdLqFhVJCNLEUF2flIzHqcm8hSYlVGeo2Y2K+ZYxOXNO URTFJ0/s4DCBaCNljEtXVpx13Z6nz3GKhyEJEVcjKtkJX7NtAUafVtjIvmAZrIZhyFbY lyrQ== X-Gm-Message-State: AOAM530Ey5iYgxiUDKGhxmU8aFkd/NkrF7CupuUOKJDlx6LxM/j8JRHS ntnvUCDmbAkesleIHJfsWY7BjA== X-Received: by 2002:a5d:58d0:: with SMTP id o16mr8407362wrf.420.1621587839871; Fri, 21 May 2021 02:03:59 -0700 (PDT) Received: from dell ([91.110.221.215]) by smtp.gmail.com with ESMTPSA id k7sm1349133wro.8.2021.05.21.02.03.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 02:03:59 -0700 (PDT) Date: Fri, 21 May 2021 10:03:57 +0100 From: Lee Jones To: Robert Marko 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 Subject: Re: [PATCH 1/6] mfd: Add Delta TN48M CPLD driver Message-ID: <20210521090357.GD2549456@dell> References: <20210430123511.116057-1-robert.marko@sartura.hr> <0f28cabf858154842819935000f32bc2@walle.cc> <20210520064929.GM2549456@dell> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 21 May 2021, Robert Marko wrote: > 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 populates > > > 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 now > > > 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. Yes, I was going to suggest that. It should probably live in drivers/misc. -- Lee Jones [李琼斯] Senior Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog