Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp188856lqb; Tue, 28 May 2024 12:29:12 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWG4cjP5Zh7mDPCQmnb3r/zJdFaik0aIQ3d0Gs1NNdOop9xmHyoM/5GT+qM5ZF+JU5xszCSPblZi3uXdJsDhK8VmE445bHwcJxAOH1lSw== X-Google-Smtp-Source: AGHT+IGpuyd8k74wtUyk51QfkgJjzBz2rOU4IovqOP+7q3ecxb7eNS145dVl0GXNk3x4moWGnO80 X-Received: by 2002:a9d:75cf:0:b0:6f0:5ecc:9ddd with SMTP id 46e09a7af769-6f8d0ad4310mr13810353a34.15.1716924552375; Tue, 28 May 2024 12:29:12 -0700 (PDT) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43fb17ef61csi122772201cf.187.2024.05.28.12.29.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 12:29:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-192938-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-192938-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192938-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 478A21C244DE for ; Tue, 28 May 2024 19:27:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CCBBE172767; Tue, 28 May 2024 19:27:39 +0000 (UTC) Received: from fgw23-7.mail.saunalahti.fi (fgw23-7.mail.saunalahti.fi [62.142.5.84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D0975CA6B for ; Tue, 28 May 2024 19:27:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.84 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716924459; cv=none; b=m7T138XFGk16AT1tGgkCw/POB4n5etsAwzU9M6hCs1ATdQAsNThWhfBZzCSnsWmFhVdDBakfMjnr9feLQ3b3Yid84V69/frGnwEzHWQoXDEcp5xypLrdICnhizUXpEJGrBZuzqp6gmOxqjfqGgDXrUO0cLeZmpRZxPQKoqhj9sk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716924459; c=relaxed/simple; bh=cTKbpAhjrjCxOHCkBE9KZlU76K9Ysjv16xE/+1J9QZM=; h=From:Date:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=oSR4KsouX1gvV1Zh9Bbrh8RofNy3kNR28hb4YWEXvGhEtMlIImAB3X2P14v+JRD8U+39TMPTpzGqHmAZgB9VQr7yaV3dV4XjfZ+SpqkEtpUUyFc0GddjZq0T9fQFxcqnq7xeqLlvXsxaoJb9NgG35VXA8r3flkGwriKSU1ffyYc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.84 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-26-230.elisa-laajakaista.fi [88.113.26.230]) by fgw23.mail.saunalahti.fi (Halon) with ESMTP id 55c6fc82-1d28-11ef-80c1-005056bdfda7; Tue, 28 May 2024 22:27:35 +0300 (EEST) From: Andy Shevchenko Date: Tue, 28 May 2024 22:27:34 +0300 To: Laurent Pinchart Cc: linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-gpio@vger.kernel.org, linux-pwm@vger.kernel.org, Alexandru Ardelean , Bartosz Golaszewski , Conor Dooley , Krzysztof Kozlowski , Lee Jones , Linus Walleij , Rob Herring , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Haibo Chen Subject: Re: [PATCH v2 2/4] mfd: adp5585: Add Analog Devices ADP5585 core support Message-ID: References: <20240528190315.3865-1-laurent.pinchart@ideasonboard.com> <20240528190315.3865-3-laurent.pinchart@ideasonboard.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240528190315.3865-3-laurent.pinchart@ideasonboard.com> Tue, May 28, 2024 at 10:03:12PM +0300, Laurent Pinchart kirjoitti: > From: Haibo Chen > > The ADP5585 is a 10/11 input/output port expander with a built in keypad > matrix decoder, programmable logic, reset generator, and PWM generator. > This driver supports the chip by modelling it as an MFD device, with two > child devices for the GPIO and PWM functions. > > The driver is derived from an initial implementation from NXP, available > in commit 8059835bee19 ("MLK-25917-1 mfd: adp5585: add ADI adp5585 core > support") in their BSP kernel tree. It has been extensively rewritten. .. > + tristate "Analog Devices ADP5585 MFD driver" > + select MFD_CORE > + select REGMAP_I2C > + depends on I2C && OF Why OF? No COMPILE_TEST? .. + array_size.h + device.h // e.g., devm_kzalloc() > +#include > +#include > +#include > +#include > +#include > +#include > +#include You don't need them, instead of proxying... > +#include > +#include m is earlier than 'o', but with above drop no more issue :-) ..just include mod_devicetable.h. > +#include + types.h // e.g., u8 .. > + regmap_config = of_device_get_match_data(&i2c->dev); We have i2c_get_match_data(). .. > +#ifndef __LINUX_MFD_ADP5585_H_ > +#define __LINUX_MFD_ADP5585_H_ > + > +#include .. > +#define ADP5585_MAN_ID(v) (((v) & 0xf0) >> 4) GENMASK() .. > +#define ADP5585_Rx_PULL_CFG_MASK (3) GENMASK() Why parentheses in all of them, btw? .. > +#define ADP5585_C4_EXTEND_CFG_MASK (1U << 6) > +#define ADP5585_R4_EXTEND_CFG_MASK (1U << 5) > +#define ADP5585_R3_EXTEND_CFG_MASK (3U << 2) > +#define ADP5585_R0_EXTEND_CFG_MASK (1U << 0) > +#define ADP5585_OSC_FREQ_MASK (3U << 5) BIT() / GENMASK() > +#endif -- With Best Regards, Andy Shevchenko