Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp118169imm; Tue, 5 Jun 2018 16:13:01 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ/a0e3gx1detGtj9tULJ2/zveQ/2Dy3PbWsVANh0PZbm6wkfHty6emfjNhNVd+2yjgtwLb X-Received: by 2002:a62:ca99:: with SMTP id y25-v6mr540912pfk.187.1528240381889; Tue, 05 Jun 2018 16:13:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528240381; cv=none; d=google.com; s=arc-20160816; b=sVUGWxvRP3f8GKRlcToZ2inMgzjKxSLCHANvWnCd1ysoOhv2GyNlQosHX9RwKwClct RsVkUS3CegaUsxzbFzrFyYBO8IcNOkh/Sf1j4WBKo5Ymmhx5zAWv5kcjkuy9UTrNd/AR +ZqD04OHf8lse685QnkBUoXHpZsd751oZlNdg5y4cxpKcDcASvr4xVPFl539UT4N1biY /+tox1Qi6qZ4tDpPKVAFvhb0uS67bA3b8FHeujDx4x54eKFTiugSGlYBdAE8A+3EbcRm W0gVpatqsOmQzUiAdrYSS5UsGYh3UIGXnCP4OJ9XcXlQBzutWQl5YkquInn6hW7hEhYR w30w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=Y/2PaL3ALYh3vvaLhslGX2X0zy5e//PZWP1PilzVWeE=; b=qodOlaes9xXEh8hPBGv7T105CfLTTWk75pTIsJbIOHa7I9H+zoo+5bLwxtoWpIbtCi 8JkascJHNxwssx+eKzRovtfT8y7InwH83LA2uMrRn1DZHLwGpqbnjAaZAQ8gn4gpNT0o GozPw6E90SluqmoqnW+9qPlRxmiqf/RFBWRZAe4maDLnSaPbpBxeoGvfs53D85WXZ7c5 TfjdcWFiHzHhqLwl3nliqwXX2aLuF4HUkPrmRq2mfP6LTWtXrW0MsQk25uH4j1d8rohV E364cUQcNWK/OVX2MaEdA8dlV1TzEVZ729uiXW8fg5i+CJgdSU/HEhuvKymR1EYtVodL XNOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BksqKoCr; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s6-v6si3369774pgp.603.2018.06.05.16.12.47; Tue, 05 Jun 2018 16:13:01 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BksqKoCr; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932114AbeFEXLH (ORCPT + 99 others); Tue, 5 Jun 2018 19:11:07 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:36062 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932069AbeFEXKz (ORCPT ); Tue, 5 Jun 2018 19:10:55 -0400 Received: by mail-wm0-f67.google.com with SMTP id v131-v6so8277505wma.1; Tue, 05 Jun 2018 16:10:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Y/2PaL3ALYh3vvaLhslGX2X0zy5e//PZWP1PilzVWeE=; b=BksqKoCr/jA+sX6qfUPx/tYOUUmp+HA/zNnoPcFVj9/zEhLCxQw3x9KrtEEAsYj8Sx c2Ha9PBgPNYpldqU4T/wKXJrWFLJ9Pz2hcLr+faWuam4PZDl4wP+QJxqQgSIYSrXxJD7 LA6F+vSdtZiRIcU4VKQwe+lHBUm5tH4ahif7WVynUv4WhwKV0rX5TSTOIfQXH2VjQFNv 9/dwtJnEMWw0hI1SnjoWbjAOIiBx0LtxuKlwsD+/i3ptoFknsNg0KqFdfx7a03KVDZzo I3oDPqz/Ihbj4w1jFfy2mSJgpqzPRH8Zh/7K9dnBtUFQKKAWr22YggEsR7yyOEn5RUvs AF1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Y/2PaL3ALYh3vvaLhslGX2X0zy5e//PZWP1PilzVWeE=; b=awogHicEz7xPhYeLp4QBqGmPYLH/u43EgwxDdm+v22orHY1ekzKcn2b3snOx9UcX9H 0mzx0BpKdIM880FtfnBu744mt3lDxCh69G3u7ZY2u0JtdWAnrgR2xKPoxCC7REB/p1wg ga3Vosj7o8TIUrZF3iYP9nep90BPiSazKkFengekGWXbEWc8bYUyP9UGTLRaBOSFM0/+ kBpkVmnD0vlN7/Uc9ArHA5CWR7AhBJO7X1i2qed3v/P7ElnBmp0NGqF0HY6RhN8/Zaf+ nRxLCxMH4Hslj9yf3vE2XHO/dfnz81siom/PA6URjVP0/FakTGf5W3zZculfjARmLhod 2krA== X-Gm-Message-State: APt69E24m+dHlUeasHYzV1GoXUiM4NyDFVi0GSZSWgHTUNti/e9WbcmP ietHZS2XW+XBs3adw4pBVqM= X-Received: by 2002:a1c:8fd5:: with SMTP id r204-v6mr122671wmd.77.1528240253491; Tue, 05 Jun 2018 16:10:53 -0700 (PDT) Received: from [192.168.1.4] (ip-86-49-107-50.net.upcbroadband.cz. [86.49.107.50]) by smtp.gmail.com with ESMTPSA id o16-v6sm32879484wri.67.2018.06.05.16.10.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Jun 2018 16:10:52 -0700 (PDT) Subject: Re: [PATCH v3 06/10] mfd: da9063: Add custom regmap for DA9063L To: Steve Twiss , Geert Uytterhoeven Cc: Linux Kernel Mailing List , Marek Vasut , Geert Uytterhoeven , Lee Jones , Mark Brown , Wolfram Sang , Linux-Renesas , Support Opensource References: <20180602101155.26375-1-marek.vasut+renesas@gmail.com> <20180602101155.26375-6-marek.vasut+renesas@gmail.com> <9acdc0af-4be9-91cb-ffed-25133bba73c3@gmail.com> <6ED8E3B22081A4459DAC7699F3695FB701941AD701@SW-EX-MBX02.diasemi.com> From: Marek Vasut Message-ID: Date: Wed, 6 Jun 2018 01:02:27 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <6ED8E3B22081A4459DAC7699F3695FB701941AD701@SW-EX-MBX02.diasemi.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/05/2018 10:17 PM, Steve Twiss wrote: > Hi Marek and Geert, > > On 04 June 2018 17:25 Marek Vasut wrote, > >> Subject: Re: [PATCH v3 06/10] mfd: da9063: Add custom regmap for DA9063L >> >> On 06/04/2018 09:39 AM, Geert Uytterhoeven wrote: >>> Hi Marek, Steve, >>> >>> On Sat, Jun 2, 2018 at 12:11 PM, Marek Vasut wrote: >>>> While the datasheet for DA9063L (2v1, 23-Mar-2017) lists the RTC register >>>> block, the DA9063L does not have an RTC. Add custom regmap for DA9063L to >>>> prevent access into that register block. > > Ok. I've said previously in [v3 07/10], but I'll copy again: > There is now an internal Dialog request to remove the RTC references from the DA9063L datasheet. > Adding that first part to the sentence in the commit log: "While the datasheet for DA9063L > (2v1, 23-Mar-2017) lists the RTC register block" -- it exists in error for the register map table > on page 91, but the datasheet also identifies those registers in Table 102 on page 126 as > "Reserved". > > Pointing out the ambiguity in this version of the datasheet seems redundant in the commit log. > Also Dialog do not store a history of Datasheets on their website so once this is updated (although > this update is not in my hands) the datasheet will be replaced. So, it seems this comment could > make the commit message just as misleading as the current datasheet. > > How about something simpler? > "The DA9063L does not have an RTC. Add custom regmap for DA9063L to prevent access > into that register block." > >>>> >>>> Signed-off-by: Marek Vasut >>> >>> Thanks for your patch! >>> >>>> --- a/drivers/mfd/da9063-i2c.c >>>> +++ b/drivers/mfd/da9063-i2c.c >>>> @@ -254,6 +341,10 @@ static int da9063_i2c_probe(struct i2c_client *i2c, >>> >>> Note that the line above doesn't check da9063->type, but da9063- >>> variant_code... >>> >>>> da9063_regmap_config.rd_table = &da9063_ad_readable_table; >>>> da9063_regmap_config.wr_table = &da9063_ad_writeable_table; >>>> da9063_regmap_config.volatile_table = &da9063_ad_volatile_table; >>>> + } else if (da9063->type == PMIC_TYPE_DA9063L) { >>> >>> ... so this may be slightly confusing. >> >> I know. >> >>>> + da9063_regmap_config.rd_table = &da9063l_bb_readable_table; >>>> + da9063_regmap_config.wr_table = &da9063l_bb_writeable_table; >>>> + da9063_regmap_config.volatile_table = &da9063l_bb_volatile_table; >>>> } else { >>>> da9063_regmap_config.rd_table = &da9063_bb_readable_table; >>>> da9063_regmap_config.wr_table = &da9063_bb_writeable_table; >>> >>> However, da9063->variant_code doesn't seem to have been filled in at this >>> point yet (the call to da9063_device_init() doing so is below, at the end >>> of the probe function!), so commit 9cb42e2a8ed06e91 ("mfd: da9063: Add >>> support for AD silicon variant") never actually handled the AD silicon variant >>> correctly? Or am I missing something? > > Okay ... No. You're not missing anything. I had noticed that. > The AD chip model is not referenced and by default only the BB chip model is used. > >> Ha, that is a good point. > > Yeah, it's a good point, but it's not an amusing point. > The device tree only distinguishes a "dlg,da9063", there is no AD type in the DT schema. > There is no datasheet listing AD registers supported by Dialog, only BB. > > But, AD registers were added back into the header file in commit 9cb42e2a8ed06e91 > and the RTC driver was updated to distinguish between the AD and BB according to > the type of variant detected at run-time during the da9063_device_init() call. > > The real problem is that this leads to two competing chip detection methods for the > DA9063. The function da9063_device_init() autodetects the chip variant, but > autodetection cannot define the chip model. It's circular: the chip model cannot be > autodetected because a chip model is needed to access the register used during > autodetection. > > Which leads me back to what I said two paragraphs up: >> The device tree only distinguishes a "dlg,da9063", there is no AD type in the DT schema. >> There is no datasheet listing AD registers supported by Dialog, only BB. > > This is not how it is done in the DA9062 and DA9061 driver: the variant code is only > used to print the information to the console during start-up and it is the DT that defines > the chip model based upon "dlg,da9062" or "dlg,da9061". So the AD was broken since forever and noone noticed ? :) Do you have an AD hardware and can you fix it ? -- Best regards, Marek Vasut