From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-20.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1CE8AC64E7B for ; Wed, 2 Dec 2020 13:07:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B3A2E217A0 for ; Wed, 2 Dec 2020 13:07:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727850AbgLBNGz (ORCPT ); Wed, 2 Dec 2020 08:06:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730099AbgLBNGy (ORCPT ); Wed, 2 Dec 2020 08:06:54 -0500 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C8E6BC0613D6 for ; Wed, 2 Dec 2020 05:06:13 -0800 (PST) Received: by mail-wm1-x344.google.com with SMTP id d3so7005938wmb.4 for ; Wed, 02 Dec 2020 05:06:13 -0800 (PST) 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=7bzhGlEDs3RVzaSNxmlfokQcY9/nLGPy3zIRO283eDU=; b=hoUlgFcojtGx5MWR+uH0MtOMHiRv4HBtzmnVHFXTJOTubmJGqCwD+erZkS0kUu9Ww+ HPzUPepiFQ4rB6N8rM4XqGYA/zGW/SHTvumDI6Cl9fZl6JP6NmFZTPhL4ioeOKpcQzhd ymo8qOrFVkO1qG1joUwaT3f+D4Xzz7PjqfshDvctduRl4zUeDFSG2UCB8zDwksUMnbkP g5Z73nZjsc1qRqzFS5YvP92HlUpx2kC51PYaLy3dcMtdgAb47sm84n3LXCzgZaUP+J82 wX86L/38M1NIwYOllJXJddHMFgn6uQXDxixe4J8weDtJNzegT4PRQgQVnHB7j88TGjsW nN+w== 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=7bzhGlEDs3RVzaSNxmlfokQcY9/nLGPy3zIRO283eDU=; b=ZfLubpeFby8iKklKtuN4sSFrterBgbYoBo3i1b9M+ZgRDRtz290DdsU3jVeqXsgX7S NVv56aCEsB6yu8Wk79ub4bRVZebe6pyhsFDDy521TpDmqIpyELYOkzcF9qXxymzx3x/n Ec79yNgcRZtmpJwNFvV2DWySN0ZKvDJbCWh90We5hQp9SQoJkABCpOS+IM4KOdjoksxJ ZTqxYViFA+h/qIKoVntcQPIn0uf2WK6mbV1bsQY33W1TiJawf3c9bGNCH96ngz9+04Jy IbQaZTQJMlTEofE8EozkRjylJVLLPBOZqA+rjnCMJxH8AZecEEGZQWIBarCWonkNEJlN YSwQ== X-Gm-Message-State: AOAM5306iBdqAtKhJQc9rMDNHIjQWPgK3/NxtZQpCeu2DwIB4E1EZxxN aMkl3ATaPXO7AeuY+Lkrk5BDCg== X-Google-Smtp-Source: ABdhPJxGawSFJDcD4PpSw5SstbEcGDeQR9jU6qHm7uM9dlQbOvte5ZrJEXWIXJfUg22zIA3A0lGfmw== X-Received: by 2002:a05:600c:208:: with SMTP id 8mr3096055wmi.146.1606914372431; Wed, 02 Dec 2020 05:06:12 -0800 (PST) Received: from dell ([91.110.221.235]) by smtp.gmail.com with ESMTPSA id 35sm1986863wro.71.2020.12.02.05.06.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2020 05:06:11 -0800 (PST) Date: Wed, 2 Dec 2020 13:06:09 +0000 From: Lee Jones To: Jonathan =?iso-8859-1?Q?Neusch=E4fer?= Cc: linux-kernel@vger.kernel.org, Rob Herring , Thierry Reding , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Alessandro Zummo , Alexandre Belloni , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Sam Ravnborg , Linus Walleij , Heiko Stuebner , Stephan Gerhold , Lubomir Rintel , Mark Brown , allen , Mauro Carvalho Chehab , "David S. Miller" , devicetree@vger.kernel.org, linux-pwm@vger.kernel.org, linux-rtc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Heiko Stuebner , Josua Mayer , Andreas Kemnade , Arnd Bergmann , Daniel Palmer , Andy Shevchenko Subject: Re: [PATCH v4 3/7] mfd: Add base driver for Netronix embedded controller Message-ID: <20201202130609.GM4801@dell> References: <20201122222739.1455132-1-j.neuschaefer@gmx.net> <20201122222739.1455132-4-j.neuschaefer@gmx.net> <20201202130520.GL4801@dell> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20201202130520.GL4801@dell> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Wed, 02 Dec 2020, Lee Jones wrote: > On Sun, 22 Nov 2020, Jonathan Neuschäfer wrote: > > > The Netronix embedded controller is a microcontroller found in some > > e-book readers designed by the original design manufacturer Netronix, > > Inc. It contains RTC, battery monitoring, system power management, and > > PWM functionality. > > > > This driver implements register access and version detection. > > > > Third-party hardware documentation is available at: > > > > https://github.com/neuschaefer/linux/wiki/Netronix-MSP430-embedded-controller > > > > The EC supports interrupts, but the driver doesn't make use of them so > > far. > > > > Signed-off-by: Jonathan Neuschäfer > > --- > > > > v4: > > - include asm/unaligned.h after linux/* > > - Use put_unaligned_be16 instead of open-coded big-endian packing > > - Clarify that 0x90=0xff00 causes an error in downstream kernel too > > - Add commas after non-sentinel positions > > - ntxec.h: declare structs device and regmap > > - Replace WARN_ON usage and add comments to explain errors > > - Replace dev_alert with dev_warn when the result isn't handled > > - Change subdevice registration error message to dev_err > > - Declare ntxec_reg8 as returning __be16 > > - Restructure version detection code > > - Spell out ODM > > > > v3: > > - https://lore.kernel.org/lkml/20200924192455.2484005-4-j.neuschaefer@gmx.net/ > > - Add (EC) to CONFIG_MFD_NTXEC prompt > > - Relicense as GPLv2 or later > > - Add email address to copyright line > > - remove empty lines in ntxec_poweroff and ntxec_restart functions > > - Split long lines > > - Remove 'Install ... handler' comments > > - Make naming of struct i2c_client parameter consistent > > - Remove struct ntxec_info > > - Rework 'depends on' lines in Kconfig, hard-depend on I2C, select REGMAP_I2C and > > MFD_CORE > > - Register subdevices via mfd_cells > > - Move 8-bit register conversion to ntxec.h > > > > v2: > > - https://lore.kernel.org/lkml/20200905133230.1014581-4-j.neuschaefer@gmx.net/ > > - Add a description of the device to the patch text > > - Unify spelling as 'Netronix embedded controller'. > > 'Netronix' is the proper name of the manufacturer, but 'embedded controller' > > is just a label that I have assigned to the device. > > - Switch to regmap, avoid regmap use in poweroff and reboot handlers. > > Inspired by cf84dc0bb40f4 ("mfd: rn5t618: Make restart handler atomic safe") > > - Use a list of known-working firmware versions instead of checking for a > > known-incompatible version > > - Prefix registers with NTXEC_REG_ > > - Define register values as constants > > - Various style cleanups as suggested by Lee Jones > > - Don't align = signs in struct initializers [Uwe Kleine-König] > > - Don't use dev_dbg for an error message > > - Explain sleep in poweroff handler > > - Remove (struct ntxec).client > > - Switch to .probe_new in i2c driver > > - Add .remove callback > > - Make CONFIG_MFD_NTXEC a tristate option > > --- > > drivers/mfd/Kconfig | 11 ++ > > drivers/mfd/Makefile | 1 + > > drivers/mfd/ntxec.c | 216 ++++++++++++++++++++++++++++++++++++++ > > include/linux/mfd/ntxec.h | 34 ++++++ > > 4 files changed, 262 insertions(+) > > create mode 100644 drivers/mfd/ntxec.c > > create mode 100644 include/linux/mfd/ntxec.h [...] > > + /* Bail out if we encounter an unknown firmware version */ > > + switch (version) { > > + case 0xd726: /* found in Kobo Aura */ > > No magic numbers. > > Please submit a subsequent patch to define this. > > > + break; > > + default: > > + dev_err(ec->dev, > > + "Netronix embedded controller version %04x is not supported.\n", > > + version); > > + return -ENODEV; > > + } > > Applied, thanks. Sorry, that should have been: For my own reference (apply this as-is to your sign-off block): Acked-for-MFD-by: Lee Jones -- Lee Jones [李琼斯] Senior Technical Lead - Developer Services Linaro.org │ Open source software for Arm SoCs Follow Linaro: Facebook | Twitter | Blog