From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fgw20-7.mail.saunalahti.fi (fgw20-7.mail.saunalahti.fi [62.142.5.81]) (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 ECBEF174EE1 for ; Tue, 28 May 2024 19:27:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.81 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716924465; cv=none; b=Ju7MRL/cW4XHsCv1dVS19Ygag9nvE31M2CW41hL2ReUb+gDVfKU7nMe2OXseO3Jv7oSrP5zZoDUsaY6F5Kd8sM6kENvw1C55ktulddyuk9zbCj+9XfZiZ00DUGZA/ynRItUsiMeSbglF6hLHsh4rkoKkOR81/B3OkZPfU0OLPpk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716924465; 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=kZI+rwyuI679bLk+WRy8KCAo27EO7n6mq9fGFdJ9WvkysvQhNKeZNYLdsnHVTX9vK6UtxmQe5BGP1YhUz3E36LYQeMTZwC08wEtcgZ4H4mSyXKJXleErUO97SuY+y7qwfJSa4nK7a4pxhR8yS6UViwXaWPG1Ew6fbDEwYSrJ3kA= 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.81 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-pwm@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