Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp4068471pxb; Tue, 10 Nov 2020 07:13:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJzFRX+FpXI5DR3idNrXnkBBpmPaVIFziFn+iafgO3pMBcT94uqxjv0K0360JnyZx8u7kQzs X-Received: by 2002:a17:906:f186:: with SMTP id gs6mr21320677ejb.171.1605021236763; Tue, 10 Nov 2020 07:13:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605021236; cv=none; d=google.com; s=arc-20160816; b=T6WW6jjAuzFX+WMWZCfMd/p0T6bJYTRJe4QuSV4sStBrAo4pI+T1qR09MewilE44KN FZG0L5ctSseOwVJxBMKSfZin1Wen6l0c0fnL9nImxWp7i6BLe+g8F1fL0oLunFnrB+xi B/zHZvOZZNBSYSVZzfOft5nnClg+8ZgmKWtDFF5Yr5XiuMj4+uG/LaXx9VwyIfOnWVUA OJcNy9JQ1EhmXzpxbquiajvYJj1gxjpw5uVTO1r1Qv61wEzgKLfElEjpPZHNZ0ZgewCF espsq5ax1TOa1RMv/Cfx0ne/k5Vc8pgV5l5o6m7C+Ee0HSAFzXWcxTzmzpYBXu1Zxmi4 ibRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=RTwW0UcjYYoQ2DlxhH8MI21s6Oi4aUt300tAIXNCYRk=; b=w9ZWLdZLLQF/rN3JLduiFRKEpt+JPb/6Vqc/ui87AyFPCUuQiXYJny0To3TgPeVhGv 1vA+H+iY3RBfHIaxCdjkK9HZ3j6yYFfpHQYt2i5cP8JzC2gxc3QGg0kOg+PgVzobi3i9 4NtqHpn+23jQu2Ibw4IuUa8HWEBg5pk8Wqec26wQ6Ql+qe21xIkcQ/f/F/LkqPa2jDDI K9qz0kTBXsxjLjbu1J11ud886uvsg04J1eP3aaQszwO//XFZcZ2a4ryMV9m8vi2F00hx hOcRT+ZMznhXz+ICfmrmPlb00RSS+iXXMpUyt/CavAOJyItgZ7B2D0SXrV+XB+5W/oqx qCSw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n4si9513679ejk.692.2020.11.10.07.13.32; Tue, 10 Nov 2020 07:13:56 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731940AbgKJPJY (ORCPT + 99 others); Tue, 10 Nov 2020 10:09:24 -0500 Received: from mga05.intel.com ([192.55.52.43]:19863 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731353AbgKJPJY (ORCPT ); Tue, 10 Nov 2020 10:09:24 -0500 IronPort-SDR: nurg3yc4O8dpmVZFQ1k9ektZ2UAlK+JYBNm2IZR4YWM99SNc/yNsNQMNX8B7Rivnr6qbbahN4/ k5SVAMrC6KSA== X-IronPort-AV: E=McAfee;i="6000,8403,9801"; a="254699235" X-IronPort-AV: E=Sophos;i="5.77,466,1596524400"; d="scan'208";a="254699235" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2020 07:09:22 -0800 IronPort-SDR: TqSLfs/e1RpTETQ5GReLeg2RaHnNzer0gKK/Hok2R5iw56ymOZAq/W4WrQnxOj+XpS0r0096bI CvDDflTf9lgA== X-IronPort-AV: E=Sophos;i="5.77,466,1596524400"; d="scan'208";a="529829569" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2020 07:09:20 -0800 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1kcVHq-005VSQ-I9; Tue, 10 Nov 2020 17:10:22 +0200 Date: Tue, 10 Nov 2020 17:10:22 +0200 From: Andy Shevchenko To: Bartosz Golaszewski Cc: Linus Walleij , Jan Kiszka , David Laight , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: Re: [PATCH v4 6/7] gpio: exar: switch to using regmap Message-ID: <20201110151022.GY4077@smile.fi.intel.com> References: <20201110145552.23024-1-brgl@bgdev.pl> <20201110145552.23024-7-brgl@bgdev.pl> <20201110150447.GW4077@smile.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201110150447.GW4077@smile.fi.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 10, 2020 at 05:04:47PM +0200, Andy Shevchenko wrote: > On Tue, Nov 10, 2020 at 03:55:51PM +0100, Bartosz Golaszewski wrote: > > From: Bartosz Golaszewski > > > > We can simplify the code in gpio-exar by using regmap. This allows us to > > drop the mutex (regmap provides its own locking) and we can also reuse > > regmap's bit operations instead of implementing our own update function. > > ... > > > +static const struct regmap_config exar_regmap_config = { > > + .name = "exar-gpio", > > + .reg_bits = 16, > > As per previous version comment. > > Hold on, the registers are 16-bit wide, but their halves are sparsed! > So, I guess 8 and 8 with helpers to get hi and lo parts are essential. > > > TABLE 5: DEVICE CONFIGURATION REGISTERS SHOWN IN BYTE ALIGNMENT > > > + .val_bits = 8, > > +}; > > This is basically represents two banks out of 6 8-bit registers each. ...which makes me wonder if gpio-regmap can be utilized here... -- With Best Regards, Andy Shevchenko