Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760778Ab2EWTck (ORCPT ); Wed, 23 May 2012 15:32:40 -0400 Received: from mail-bk0-f46.google.com ([209.85.214.46]:46997 "EHLO mail-bk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758769Ab2EWTcj convert rfc822-to-8bit (ORCPT ); Wed, 23 May 2012 15:32:39 -0400 MIME-Version: 1.0 In-Reply-To: <20120523173617.GC4064@opensource.wolfsonmicro.com> References: <201205221053.21792.marc@cpdesign.com.au> <20120523084945.GA4085@opensource.wolfsonmicro.com> <20120523173617.GC4064@opensource.wolfsonmicro.com> Date: Wed, 23 May 2012 16:32:37 -0300 Message-ID: Subject: Re: mc13xxx-core: kernel hangs after 'regmap_read' From: Fabio Estevam To: Mark Brown Cc: marc@cpdesign.com.au, Samuel Ortiz , Sascha Hauer , =?UTF-8?Q?Philippe_R=C3=A9tornaz?= , linux-kernel Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1242 Lines: 33 On Wed, May 23, 2012 at 2:36 PM, Mark Brown wrote: > The data sent should be however many bits of register address are > specified, followed by however many padding bits are specified, followed > by the data.  The shift there will be some combination of the padding > and register address. Ok, from the mc13783 datasheet: "Both SPI ports are configured to utilize 32-bit serial data words, using 1 read/write bit, 6 address bits, 1 null bit, and 24 data bits. The SPI ports’ 64 registers correspond to the 6 address bits." ,and we have the struct regmap_config as: .reg_bits = 7, .pad_bits = 1, .val_bits = 24, >From the bootloader I read PMIC register 0 as 0x00081000. In the kernel all the PMIC registers accesses are read as: 0x00000810 So it looks when I read a register via SPI through regmap the register address field is not being updated correctly (like as it was always reading from register 0) and there is also a shift by 8 in there. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/