From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753073AbbHMPZM (ORCPT ); Thu, 13 Aug 2015 11:25:12 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:57357 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751820AbbHMPZK (ORCPT ); Thu, 13 Aug 2015 11:25:10 -0400 X-Listener-Flag: 11101 Message-ID: <1439479505.32674.43.camel@mtksdaap41> Subject: Re: [PATCH] regmap: Add function check before called format_val From: Henry Chen To: Daniel Kurtz CC: Matthias Brugger , Mark Brown , Sascha Hauer , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , , "Eddie Huang =?UTF-8?Q?=28=E9=BB=83=E6=99=BA=E5=82=91=29?=" , Kevin Hilman Date: Thu, 13 Aug 2015 23:25:05 +0800 In-Reply-To: References: <1437396110-5192-1-git-send-email-henryc.chen@mediatek.com> <20150720150254.GC11162@sirena.org.uk> <1437458845.30329.51.camel@mtksdaap41> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2015-08-12 at 22:20 +0800, Daniel Kurtz wrote: > > Since I didn't see it elsewhere in this discussion, I'll point out > that the "regression" here was introduced by commit [0], which added > the call to map->format.format_val from regmap_bulk_read() when > map->bus == NULL. > > [0] commit 15b8d2c41fe5839582029f65c5f7004db451cc2b > Author: Arun Chandran > regmap: Fix regmap_bulk_read in BE mode > > Perhaps the easiest work around to unbreak v4.2 is, as Henry mentions, > for mtk_pmic_wrap to define its own regmap_bus, with .read() & > .write() handlers. This way they will inherit the default built-in > format_val() from the regmap core. > > Making mtk_pmic-wrap into a regmap_bus makes a bit of sense > architecturally, too, since it is essentially just a bus for accessing > the registers of an off-chip PMIC. The CPU sees a platform bus, but > the registers of the remote PMIC are accessed over a dedicated SPI > bus. > > WDYT? > > Henry, can you try to implement this? Hi Daniel, I can try to create a regmap_bus for pmic wrap. But I'm not sure if it was the good solution for this problem. Hi Mark, Sorry, I'm afraid that I cannot do this right on init as you said last time. What do you think about regmap_bus, can you accept that way? Thanks, Henry > > Thanks, > -Dan