From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752310AbbCKW4H (ORCPT ); Wed, 11 Mar 2015 18:56:07 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:51337 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750939AbbCKW4F (ORCPT ); Wed, 11 Mar 2015 18:56:05 -0400 Date: Wed, 11 Mar 2015 16:55:59 -0600 From: Gilad Avidov To: "Ivan T. Ivanov" Cc: sdharia@codeaurora.org, mlocke@codeaurora.org, linux-arm-msm@vger.kernel.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, galak@codeaurora.org, agross@codeaurora.org Subject: Re: [PATCH V4 2/2] spmi: pmic_arb: add support for hw version 2 Message-ID: <20150311165559.29d6cfe4@gavidov-lnx.qualcomm.com> In-Reply-To: <1424707570.2340.9.camel@mm-sol.com> References: <1424386453-18092-1-git-send-email-gavidov@codeaurora.org> <1424386453-18092-3-git-send-email-gavidov@codeaurora.org> <1424707570.2340.9.camel@mm-sol.com> Organization: Qualcomm Innovation Center, Inc. X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.10; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ivan, On Mon, 23 Feb 2015 18:06:10 +0200 "Ivan T. Ivanov" wrote: > > Hi Gilad, > > On Thu, 2015-02-19 at 15:54 -0700, Gilad Avidov wrote: > > > > > + > > +static u32 pmic_arb_fmt_cmd_v1(u8 opc, u8 sid, u16 addr, u8 bc) > > +{ > > + return (opc << 27) | ((sid & 0xf) << 20) | (addr << 4) | > > (bc & 0x7); +} > > + > > +static u32 pmic_arb_fmt_cmd_v2(u8 opc, u8 sid, u16 addr, u8 bc) > > +{ > > + return (opc << 27) | ((addr & 0xff) << 4) | (bc & 0x7); > > This one is looking suspicious. Address could be only 8 bits? Slave > ID is not used? > > Is this correct? Yes it is correct. On HW v2 we are writing the command directly to a channel which is specific (already configured) to an SID and the upper 8 bits of the address. This is how we get the channel: u32 offset = pmic_arb->ver_ops->offset(pmic_arb, sid, addr); The lower 8 bits of the address is all that we need to have the entire 20bits of SPMI addressing. Thanks, Gilad > > Ivan > -- > To unsubscribe from this list: send the line "unsubscribe > linux-arm-msm" in the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html