Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp302772ybh; Wed, 11 Mar 2020 01:15:34 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt+T1O56VCW2HqVF5PtNW93XWceHit1HljFUX0HfHj317/oh1JugRImzjeRHuFbp9bh6BsH X-Received: by 2002:a9d:7358:: with SMTP id l24mr1331513otk.228.1583914534544; Wed, 11 Mar 2020 01:15:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583914534; cv=none; d=google.com; s=arc-20160816; b=TM0VE913PRIHfiOv9n/zNNZrEpEEPHrsnsBavJHULfqTqt6XICe6As5jPdlLWsoOAh KIayrURoMmMbXRRlLobFigZiDVx0UTkInXYZHNnAyHKYo0F8jY0j+4QNB+lLYLKIQvDG 3MqmFV7W67PDeTrKCwMxzGBz3UZM1gOLSVl6dz8Ci5Blh5qF74c1PSs+3ZCW5P3AbnJm xegtVwihUj2JQg1IuSzxU34x/enRxGMzXeVy19+a2CRlM1LQhgpltpYAAtPJQ2zVtw8W mnlQFpLnWUygmxv/cXERUaFA+TdPdYk5KN+6vVK9w5Pc1i0cyyo8ozTMGn11KyOOSHQy Jdnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=A5dGwoKl88PPMtiopaH/Dzc9lZz2wbHhYiW0wNxWWO8=; b=ObKvKMfyrkbFTOGQ4uWjtzcO9OiKQkryxqQJ4/SMyvvbJxlLjP6jkTv2nFfAm3PDtH fkT6GoJUN4RHcwxEPLoCl16pvtTA5oYseptW6AlVHFnet8eZRGm/BTHNcfObx0od5+EK +MoOZIUn/jFSeXIjaJ7kB0t/+nOa1kLFSD8Di8XrV2Jok64GjN+pREgZzTHaXQKBNAr0 y4MBrdYBLiQ1X3r+YngjomNrCscz/Y2vbL6Mj1+rNwLRvm/wjMkHTUZ4Jwud8PvvcG1n qjJNKsJr83hrHimuhrcHmSYoTyvpSNGREJRwJQjwQLofAcoFA4D9pUMWtLpBguH1DjJL KEGg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c15si752172otr.206.2020.03.11.01.15.21; Wed, 11 Mar 2020 01:15:34 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728255AbgCKIOw (ORCPT + 99 others); Wed, 11 Mar 2020 04:14:52 -0400 Received: from mga11.intel.com ([192.55.52.93]:11849 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726362AbgCKIOv (ORCPT ); Wed, 11 Mar 2020 04:14:51 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Mar 2020 01:14:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,540,1574150400"; d="scan'208";a="236215354" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga008.fm.intel.com with ESMTP; 11 Mar 2020 01:14:48 -0700 Received: from andy by smile with local (Exim 4.93) (envelope-from ) id 1jBwVu-008gZ3-U2; Wed, 11 Mar 2020 10:14:50 +0200 Date: Wed, 11 Mar 2020 10:14:50 +0200 From: Andy Shevchenko To: Tobias Schramm Cc: Sebastian Reichel , Rob Herring , Mark Rutland , Mauro Carvalho Chehab , "David S. Miller" , Greg Kroah-Hartman , Jonathan Cameron , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] power: supply: add CellWise cw2015 fuel gauge driver Message-ID: <20200311081450.GZ1922688@smile.fi.intel.com> References: <20200309160346.2203680-1-t.schramm@manjaro.org> <20200309160346.2203680-3-t.schramm@manjaro.org> <20200310101050.GG1922688@smile.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 10, 2020 at 07:55:42PM +0100, Tobias Schramm wrote: > >> +static int cw_read_word(struct cw_battery *cw_bat, u8 reg, u16 *val) > >> +{ > >> + u8 reg_val[2]; > >> + int ret; > >> + > >> + ret = regmap_raw_read(cw_bat->regmap, reg, reg_val, 2); > >> + *val = (reg_val[0] << 8) + reg_val[1]; > >> + return ret; > >> +} > > > > NIH BE type of readings? Can REGMAP_ENDIAN_BIG help? > > Not really, or can it? Registers on the cw2015 are a wild mix of single > bytes and words. There does not seem to be a per register override for > reg_/val_bits. I see. Perhaps __be16 value; ret = regmap(..., (...)value, sizeof(value)); if (ret) return ret; // note, you missed this in above. *val = be16_to_cpu(value); return 0; -- With Best Regards, Andy Shevchenko