Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp4062093pxb; Tue, 10 Nov 2020 07:06:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJxE+aDq0kg7Zwbj3/6ZpwwLTI2SeXSKWn1kTCAe77JDdenoWbcIV/TpNhdK/oc2qZGInFwe X-Received: by 2002:a50:bf07:: with SMTP id f7mr3621041edk.10.1605020761953; Tue, 10 Nov 2020 07:06:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605020761; cv=none; d=google.com; s=arc-20160816; b=eMYFwJ4R5VsMzgLWy7AnqJOWuu14/afmoQki/zHyQNCr/suv9dr1f4qXVe5wE52xK2 HzLQ+LwUKWMn44KncWEyyz9ZjT++eovGqfnPxDILtt1sMPeGnnXEgirVnS6JXGhdnglw Z2scz2GyXImOEhI69Qe9YSSNlyMPgL61lSzdwkXjsxZzRfKpHFwcvs5Sjm6+xMlboqE0 ammJZchuJLWjH44qqkDYl7PutC2vzu6Na4qeosRDm8+JMNlBr55w+Q7FTm78uxSQaL5q os1oZALORgTrM+GmkWsqsaSD1e3ofUC5FErRW/bct/xrLlFLZ5w5PbakSsItUCVQc3e4 g6yQ== 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=pJbL0QTfQADJh+x5muXKG41M9uscinG8wdJZEdWwmXQ=; b=ryQRxSVghBUaa0fgbG6yW9ir2bB9ujW0j8CmZDu6PICui37C6CxCS5L4zDYFhp1t8Z twijsyzfT/cMvKiPmVMEqa0Q1I0BmEqsbQ+q6Mhmgdpgn95byvplVZJLQp9N1xOUfXkL z2Som1HSGeIHu91tEBAjvi729NqY6o5yoTYVQuETpdXJCo6xxQqD/fvkLkKPZTWWkb5o alP1ZpHTmxCu/BYM6BNGwVTSh28D9YoODQGS4wbSyKS36PYBkRxIj4XkcDvUcTq4MNwH sUh7IYAdqP+HshirHT8fCIkATBwZGGk0rVb+tRub4cp/hLBwzg5K9rp+EOq+nsrEqACt n6hw== 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 cc8si3897903edb.163.2020.11.10.07.05.35; Tue, 10 Nov 2020 07:06:01 -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 S1731090AbgKJPD4 (ORCPT + 99 others); Tue, 10 Nov 2020 10:03:56 -0500 Received: from mga17.intel.com ([192.55.52.151]:32055 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730070AbgKJPDz (ORCPT ); Tue, 10 Nov 2020 10:03:55 -0500 IronPort-SDR: N6IaCDI6l/LE+xY/tDc2XXT06qidxv9n0VUcf8bZj1NJZfRqTif4UhvQ5WyhWQBrspRCUINX94 AnTxsjOU7DpQ== X-IronPort-AV: E=McAfee;i="6000,8403,9801"; a="149834997" X-IronPort-AV: E=Sophos;i="5.77,466,1596524400"; d="scan'208";a="149834997" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2020 07:03:47 -0800 IronPort-SDR: VtbmLZyuJi9EZhCKNVLenExelxhc/iqjz98xbD9qIWA/ep5GV4/h65e6kCQ4WYJ4LlBZMCFPRR G9aKfaeNA35g== X-IronPort-AV: E=Sophos;i="5.77,466,1596524400"; d="scan'208";a="531236636" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2020 07:03:45 -0800 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1kcVCR-005VPO-5F; Tue, 10 Nov 2020 17:04:47 +0200 Date: Tue, 10 Nov 2020 17:04:47 +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: <20201110150447.GW4077@smile.fi.intel.com> References: <20201110145552.23024-1-brgl@bgdev.pl> <20201110145552.23024-7-brgl@bgdev.pl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201110145552.23024-7-brgl@bgdev.pl> 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 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. -- With Best Regards, Andy Shevchenko