Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp41509imm; Fri, 31 Aug 2018 16:32:24 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbhZF/9f3jI7X/ybcIWKOTswtHi2kPhxaHIQzKBfsbxoYVw3zwsfvBrB98uacvmIvevZrVX X-Received: by 2002:a63:d90b:: with SMTP id r11-v6mr16624668pgg.315.1535758344410; Fri, 31 Aug 2018 16:32:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535758344; cv=none; d=google.com; s=arc-20160816; b=PprGk9wlsHsh87XaQ7eHXqP69JdAYumR5PX0LdggoX/Ea8Q4Zau/ScG8yNRVsIHwl+ Kil+Srm9RNVIfO4kLmr89oVKDIkWpC9wSixZ77vTwlkIuvfFkkmRqjknw9RyanauFE2s WRb4ARpiS3T8VHXoqbWqF8fLIa+oFbQp0bR4JTlHvQMup18FVHbivHFDSId+QlPlaYRk wHa4uMZB5Cbl1QOVs38nZzLxUBHDmlBboZ3PlY+V/y/bMnq6EBgvFciyP8r5G3KNtpE1 eKymfHGGdSA7SLWtP4GbpoKVDxa0uKZF9nt/M6gHTzaBCsmaItVu8IFpS/YYMBrV9xHf iuqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=XVxUJjJRuUL5forqmG7x086nVxqj/jr4sQMt84QM6pA=; b=m+ZlXgBuQ5YneFm9Y+dZ76EmZNGlSKcRMte9Nx2PSgfJrqVmUWCK2nRYX116TJj9Th G8SNc2UdFHgusCqVT6/yT8v3OG0m57GhGG9Y34M/9ZqKKU2xL8N9/jAGN9KkQTb/xBdX Mw+b0pyTaAv/d0lmRZ7K/PVFKvd7sN///A2NzRevVMdpD2Ft+BFnWzK9lTAfQb0YOsQY YV6A8shLYPbdOTUP8GZ+GvjTUBr/Npjjo4j9wt3CZHdw+WNtQf2rFGgHVst7ofUoNWHD I6PtL4lCAT350NzO5UEQkUbLcmGi9EmpglweZUW+mdg+y6WHaCWawhs5DVljtwAv2X0O X27w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OdSfHVpl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j91-v6si11197081pld.474.2018.08.31.16.31.54; Fri, 31 Aug 2018 16:32:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OdSfHVpl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727589AbeIADjw (ORCPT + 99 others); Fri, 31 Aug 2018 23:39:52 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:46995 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726869AbeIADjv (ORCPT ); Fri, 31 Aug 2018 23:39:51 -0400 Received: by mail-pf1-f193.google.com with SMTP id u24-v6so6150742pfn.13 for ; Fri, 31 Aug 2018 16:30:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=XVxUJjJRuUL5forqmG7x086nVxqj/jr4sQMt84QM6pA=; b=OdSfHVplU/W55AyhBHcDfC1YHarFXLTH8h6s2B3vTtFvsugUtOExYMlnO4+bSpL5cl NMM2QcobAUNKKIrTREWmgnzu1zG2ZxkUVjtIEW3rYP7NQAn3W+07KSFWOS1bI6qKynfw Q4L+IJ+SrUOAXsq1MVgf7oHig7kzxPLKT6iZYs3n+Hqh2HhzperQaJiUha20ibi6c+eB jK7OTnIsfcmsIvKJ4bD4dFSKxHS2aopj1aWay9Os1M/8Lqqa+FOuI69KLof12b8Odqma Z1P8KC+LyqxiwGVyMh8K7mmGD1cVLt97IyFoily31DYiRoLqKc1iOJon7EPrzDVvTrUn iWyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=XVxUJjJRuUL5forqmG7x086nVxqj/jr4sQMt84QM6pA=; b=pWLXV/xbKuDWuRVYy5ZBuFVchunrIyKPTY73Q3H8HiaBAoQQier9spTWiQdrHCgAnr ZJctCg666sEyYrzLBxiXR1aTwUuoSjUHZEZml5TIEdFKFYRo8yke75PzlktQrvSP4fD8 DDRa+OJB4WEWNUKeToCIeT1UquNc8/te6KGyMlTCeqm68/dtxtoLtpcw6HO1/EBnlJ7U Qz9flciyvMkFfrLC7aAZF080tmSIq4p0SCp1q0P41FZ6vy5HJBPPC9DDdWAdlnFEfPF0 y8lnyrxBd7ySgHePROvLmXtV0gaXQoKDpiuzYLKv5+LY3+sKghQh/lCybzwLaBQmDEUH 9aWA== X-Gm-Message-State: APzg51C6Skq2XqcGuo8u4ljiPalp/ywjmiuh5Dg6d7PQL8HOssL6kMuG Ty0eqplwRbsmUFXHbmcDE2vZlv5W X-Received: by 2002:a63:c245:: with SMTP id l5-v6mr16588617pgg.255.1535758204122; Fri, 31 Aug 2018 16:30:04 -0700 (PDT) Received: from dfrey-debian-linux.sierrawireless.local (carmd-fwm01.sierrawireless.com. [208.81.120.1]) by smtp.gmail.com with ESMTPSA id o21-v6sm19462637pfa.54.2018.08.31.16.30.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Aug 2018 16:30:03 -0700 (PDT) From: David Frey To: linux-kernel@vger.kernel.org Cc: broonie@kernel.org, David Frey Subject: [PATCH 2/3] regmap: split up regmap_config.use_single_rw Date: Fri, 31 Aug 2018 16:33:32 -0700 Message-Id: <20180831233333.17223-3-dpfrey@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180831233333.17223-1-dpfrey@gmail.com> References: <20180831233333.17223-1-dpfrey@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Split regmap_config.use_single_rw into use_single_read and use_single_write. This change enables drivers of devices which only support bulk operations in one direction to use the regmap_bulk_*() functions for both directions and have their bulk operation split into single operations only when necessary. Signed-off-by: David Frey --- drivers/base/regmap/regmap.c | 4 ++-- include/linux/regmap.h | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index 0360a90ad6b6..78a778c08f92 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c @@ -762,8 +762,8 @@ struct regmap *__regmap_init(struct device *dev, map->reg_stride_order = ilog2(map->reg_stride); else map->reg_stride_order = -1; - map->use_single_read = config->use_single_rw || !bus || !bus->read; - map->use_single_write = config->use_single_rw || !bus || !bus->write; + map->use_single_read = config->use_single_read || !bus || !bus->read; + map->use_single_write = config->use_single_write || !bus || !bus->write; map->can_multi_write = config->can_multi_write && bus && bus->write; if (bus) { map->max_raw_read = bus->max_raw_read; diff --git a/include/linux/regmap.h b/include/linux/regmap.h index 379505a53722..6ea9bf9377cb 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h @@ -315,9 +315,12 @@ typedef void (*regmap_unlock)(void *); * masks are used. * @zero_flag_mask: If set, read_flag_mask and write_flag_mask are used even * if they are both empty. - * @use_single_rw: If set, converts the bulk read and write operations into - * a series of single read and write operations. This is useful - * for device that does not support bulk read and write. + * @use_single_read: If set, converts the bulk read operation into a series of + * single read operations. This is useful for a device that + * does not support bulk read. + * @use_single_write: If set, converts the bulk write operation into a series of + * single write operations. This is useful for a device that + * does not support bulk write. * @can_multi_write: If set, the device supports the multi write mode of bulk * write operations, if clear multi write requests will be * split into individual write operations @@ -380,7 +383,8 @@ struct regmap_config { unsigned long write_flag_mask; bool zero_flag_mask; - bool use_single_rw; + bool use_single_read; + bool use_single_write; bool can_multi_write; enum regmap_endian reg_format_endian; -- 2.11.0