Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753606AbcD0SzM (ORCPT ); Wed, 27 Apr 2016 14:55:12 -0400 Received: from hqemgate15.nvidia.com ([216.228.121.64]:16671 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753257AbcD0SzH (ORCPT ); Wed, 27 Apr 2016 14:55:07 -0400 X-PGP-Universal: processed; by hqnvupgp08.nvidia.com on Wed, 27 Apr 2016 11:54:43 -0700 Message-ID: <5721083E.8080805@nvidia.com> Date: Thu, 28 Apr 2016 00:13:10 +0530 From: Laxman Dewangan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: Lee Jones CC: , , , , , , , , , , Mallikarjun Kasoju Subject: Re: [PATCH V10 2/6] mfd: max77620: add core driver for MAX77620/MAX20024 References: <1459348188-11726-1-git-send-email-ldewangan@nvidia.com> <1459348188-11726-3-git-send-email-ldewangan@nvidia.com> <20160427151947.GD4892@dell> In-Reply-To: <20160427151947.GD4892@dell> X-Originating-IP: [10.19.65.30] X-ClientProxiedBy: DRHKMAIL102.nvidia.com (10.25.59.16) To bgmail102.nvidia.com (10.25.59.11) Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1367 Lines: 54 On Wednesday 27 April 2016 08:49 PM, Lee Jones wrote: > On Wed, 30 Mar 2016, Laxman Dewangan wrote: > > > What are 20 and 40? I think you're going to need a comment to > describe what's going on in this function. > >> + int x, i; >> + >> + for (i = 0; i < 0x7; i++) { > It's unsual to use hex values like this. > > I think it should be defined. > >> + x = base_fps_time * BIT(i); > 20 * (1 << {0..7}) > > So ... > > 20 * (1, 2, 4, 8, etc) > > What does that does that doe exactly? > >> + if (x >= tperiod) >> + return i; >> + } >> + >> + return i; >> +} >> + >> +static int max77620_config_fps(struct max77620_chip *chip, >> + struct device_node *fps_np) > Lots of mention of 'FPS' here, but noting to so what that is? > > What does FPS stand for and what does the FPS do? > > The chip support here the Flexible Power Sequence period (FPS period) as 40, 80, 160, 320, 640, 1280, 2560 and 5120 microseconds (for max77620) 20, 40, 80, 160, 320, 640, 1280, 2560 microseconds (for max77620) There is 3 bits in registers which defined as 000: 40us for max77620, 20us for max20024 001: 80us for max77620, 40us for max20024 010: 160us for max77620, 80us for max20024. :: From DT, I am getting the FPS period time as above and this loop is finding equivalent bit value (0 to 7) from period. The min fps time is 40us for MAX77620 and 20us for MAX20024.