Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2932234imm; Thu, 24 May 2018 19:19:18 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoXffWTt7E1eWeKqx1+I0YQ1ItSEzEz7qbNd/M+AYlkY+tURieVS6qBtMzrU6j5OJtc1WhF X-Received: by 2002:a63:ad09:: with SMTP id g9-v6mr433650pgf.74.1527214758113; Thu, 24 May 2018 19:19:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527214758; cv=none; d=google.com; s=arc-20160816; b=X27i3s8E7n6QCYIhqlP4E99Prkk+MNU72aATrjo0YzRnwywk//v+lgUNC/mk+pw09j YjCr8whVPxqcLPdZ42zBtnFQzZcaAfm0TEUJNYIBI3ytNmEJ57w6fh/ZPP7D2pSgLGQb 47Xdazjp7BUc+Ibauszm3kh3A7sx7RQVkBfuo7NTrznG1keAwVUsOKEUrURcT/1bhHd3 V3wJhB7dLJiwEbpg6btfrDEM4xSX8KN9uO5W1O4hpTFKj+t3C2vZzYQxOD5ABgft97RM jNiE98d/WpcK/Uup+J1+P5eDoqGhV3i5reuHIM6Y19XLaFLqKyvzeynodZXb82xhmfq7 fl4g== 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=NTmGKIHFHpI6D6y9sLPRMCuS3fl0zY5xkKZM+cmrjGk=; b=q/0XWDQYbUaxQxijLV2H1oMaTVT4Eno42XwkGGoR5KbfW4v3ehk1IkeLFWd7PPSMnP B9qjYkgkPnzM8+zIssur4/XiQZuXbUNCzXqIQtWfrWAjiinIYZ6M3UkFCSDjJFILn14z L6PWtupvPzuuoYcDscTCSfJYJ3yxqqS6o+ixpsIxd7cNz1mcsPN5WGWqaHkXicnrhDb7 UqzWEpb2NT3d2cH0LgK8nhHBbpf8S9snA9xgpsxGCuzGBWnmlTtZWvfzo+llciUUxwyB 2u5PaoIq3nS6jyURSW8IvQna1vmj2xguOjMrCu9v8EkzkSk04XunfE6XqZhjrMSJVX8Q 9BmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=URM1FKXO; 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 n125-v6si22603186pfn.352.2018.05.24.19.19.03; Thu, 24 May 2018 19:19:18 -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=URM1FKXO; 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 S970744AbeEXPIL (ORCPT + 99 others); Thu, 24 May 2018 11:08:11 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:55808 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S970724AbeEXPID (ORCPT ); Thu, 24 May 2018 11:08:03 -0400 Received: by mail-wm0-f67.google.com with SMTP id a8-v6so6069714wmg.5; Thu, 24 May 2018 08:08:02 -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=NTmGKIHFHpI6D6y9sLPRMCuS3fl0zY5xkKZM+cmrjGk=; b=URM1FKXO+7gmJ7HMOKxuyr7oOdBMCSDrMzNRzCga2RPjOuX5LYwFEaQqMnM10yNt0R mqDqLOdO2Ih3Vz7hKmSZMs47Hxy3Wnwhx39XFAUYH6Rwou12LMtH+qQxICSUyLdWa7wx XII4Bhkw9NmqqVIpqvb7tJ55ayyExNi7kV/HklW//N3dQHy1XeGQBBNy+gP2tdrQPqtm 51Amf6Mn8QdWQiuas/t1gyU+Mmc3MShMisuH6h0JGxgKeAJdUYgzbeEYxeXbp13XuTLf ZxkaeKUuURn6A7mpjsnWHsllPBZBska0ShY7iDytWLEcxweDHkBnFQBXMwbd/NIQbzRS GOow== 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=NTmGKIHFHpI6D6y9sLPRMCuS3fl0zY5xkKZM+cmrjGk=; b=R0axTd2Paj0Ici/ld9KNWkPncQRuJfHpR4r8gnh9PclnVI2OT2k2c8yMhX+wKxmJ7O r5uwb6rRt0kcssPc/ia4EYn0Ixdd4oG/4DyZTFpqPELqvnaCjWTcgz6iNnZ5aTzL9Sjz FyFjjnhhQFsJzkgsAtVsYMjyz9s8l8Tv5h/yUar9glErUXxtaEnstT0gSh7D+qT4tZ/2 SWSfzOq0oXZGu9KbzcrfV8jy2462Jpl1Y0jQzG8WJ4OWQ+H/N0pdoV9YzkdMlx/yB0ZP yZddUNcHhAr3/DxYNnNt5B2Ly5PPuBKZAn1bUUwTkC/NP8mmzVSI/c8SC53Vui5kcPla zHVg== X-Gm-Message-State: ALKqPwd/0tKEZCnO3vTvpE24BTVtTIxn1rdch8SkvLjWa/I8fyXEkGwy gn003JLxp4/JKTiAdX+MJU5CTkwa X-Received: by 2002:a1c:8851:: with SMTP id k78-v6mr45547wmd.99.1527174481545; Thu, 24 May 2018 08:08:01 -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 60-v6sm7895596wrc.42.2018.05.24.08.08.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 May 2018 08:08:00 -0700 (PDT) Subject: Re: [PATCH 6/6] mfd: da9063: Add DA9063L support To: Steve Twiss , "linux-kernel@vger.kernel.org" Cc: Marek Vasut , Geert Uytterhoeven , Lee Jones , Mark Brown , Wolfram Sang , "linux-renesas-soc@vger.kernel.org" References: <20180523114230.10109-1-marek.vasut+renesas@gmail.com> <20180523114230.10109-6-marek.vasut+renesas@gmail.com> <6ED8E3B22081A4459DAC7699F3695FB701941A47F0@SW-EX-MBX02.diasemi.com> <6ED8E3B22081A4459DAC7699F3695FB701941A4866@SW-EX-MBX02.diasemi.com> From: Marek Vasut Message-ID: <3d81a469-e54f-953d-7600-7ddf3d026ca1@gmail.com> Date: Thu, 24 May 2018 16:50:32 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <6ED8E3B22081A4459DAC7699F3695FB701941A4866@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 05/24/2018 02:32 PM, Steve Twiss wrote: > Hi Marek, > > On 24 May 2018 @ 12:49 Steve Twiss wrote: > >> To: Marek Vasut ; linux-kernel@vger.kernel.org >> Cc: Marek Vasut ; Geert Uytterhoeven ; Lee Jones ; Mark Brown ; Steve Twiss ; Wolfram Sang ; linux-renesas-soc@vger.kernel.org >> Subject: RE: [PATCH 6/6] mfd: da9063: Add DA9063L support >> >> Thanks Marek, >> >>> On 23 May 2018 12:43 Marek Vasut wrote, >>> >>> To: linux-kernel@vger.kernel.org >>> Cc: Marek Vasut ; Geert Uytterhoeven ; Lee Jones ; >>> Mark Brown ; Steve Twiss ; Wolfram Sang ; linux-renesas-soc@vger.kernel.org >>> Subject: [PATCH 6/6] mfd: da9063: Add DA9063L support >>> >>> Add support for DA9063L, which is a reduced variant of the DA9063 with less regulators and without RTC. >>> >> >> There's potentially more to this file. Without an RTC the regmap access tables would change >> and the usual DA9063 (BB silicon) tables would become invalid. >> The tables for da9063_bb_readable_ranges, da9063_bb_writeable_ranges, da9063_bb_volatile_ranges, >> would need to be updated for DA9063L, if a new chip model was needed. >> >> The new ranges would be this (see below), and would remove any RTC accesses in the new chip model. >> >> static const struct regmap_range da9063l_bb_readable_ranges[] = { >> { >> .range_min = DA9063_REG_PAGE_CON, >> .range_max = DA9063_REG_MON_A10_RES, >> }, { >> .range_min = DA9063_REG_SEQ, >> .range_max = DA9063_REG_ID_32_31, >> }, { >> .range_min = DA9063_REG_SEQ_A, >> .range_max = DA9063_REG_AUTO3_LOW, >> }, { >> .range_min = DA9063_REG_T_OFFSET, >> .range_max = DA9063_BB_REG_GP_ID_19, >> }, { >> .range_min = DA9063_REG_CHIP_ID, >> .range_max = DA9063_REG_CHIP_VARIANT, >> }, >> }; >> >> static const struct regmap_range da9063l_bb_writeable_ranges[] = { >> { >> .range_min = DA9063_REG_PAGE_CON, >> .range_max = DA9063_REG_PAGE_CON, >> }, { >> .range_min = DA9063_REG_FAULT_LOG, >> .range_max = DA9063_REG_VSYS_MON, >> }, { >> .range_min = DA9063_REG_SEQ, >> .range_max = DA9063_REG_ID_32_31, >> }, { >> .range_min = DA9063_REG_SEQ_A, >> .range_max = DA9063_REG_AUTO3_LOW, >> }, { >> .range_min = DA9063_REG_CONFIG_I, >> .range_max = DA9063_BB_REG_MON_REG_4, >> }, { >> .range_min = DA9063_BB_REG_GP_ID_0, >> .range_max = DA9063_BB_REG_GP_ID_19, >> }, >> }; >> >> static const struct regmap_range da9063l_bb_volatile_ranges[] = { >> { >> .range_min = DA9063_REG_PAGE_CON, >> .range_max = DA9063_REG_EVENT_D, >> }, { >> .range_min = DA9063_REG_CONTROL_A, >> .range_max = DA9063_REG_CONTROL_B, >> }, { >> .range_min = DA9063_REG_CONTROL_E, >> .range_max = DA9063_REG_CONTROL_F, >> }, { >> .range_min = DA9063_REG_BCORE2_CONT, >> .range_max = DA9063_REG_LDO11_CONT, >> }, { >> .range_min = DA9063_REG_DVC_1, >> .range_max = DA9063_REG_ADC_MAN, >> }, { >> .range_min = DA9063_REG_ADC_RES_L, >> .range_max = DA9063_REG_MON_A10_RES, >> }, { >> .range_min = DA9063_REG_SEQ, >> .range_max = DA9063_REG_SEQ, >> }, { >> .range_min = DA9063_REG_EN_32K, >> .range_max = DA9063_REG_EN_32K, >> }, { >> .range_min = DA9063_BB_REG_MON_REG_5, >> .range_max = DA9063_BB_REG_MON_REG_6, >> }, >> }; >> >> However this is a larger and more wide-ranging change compared to the one proposed by Marek, >> and would require other alterations to fit this in. Also I'm undecided to what it would really add >> apart from a new chip model: I have been told accessing the DA9063 RTC register locations has no >> effect in the DA9063L. > > Looking at this further, there is also a new IRQ regmap. > Again this comes down to whether a full chip model is needed or not. If not, then the IRQ map does not > need to be changed as given. Otherwise the removal of the following: > > [DA9063_IRQ_ALARM] = { > .reg_offset = DA9063_REG_EVENT_A_OFFSET, > .mask = DA9063_M_ALARM, > }, > [DA9063_IRQ_TICK] = { > .reg_offset = DA9063_REG_EVENT_A_OFFSET, > .mask = DA9063_M_TICK, > }, > > prior to registering the IRQs in the chip model would be needed. > The new regmap_irq would be: > > static const struct regmap_irq da9063l_irqs[] = { > /* DA9063 event A register */ > [DA9063L_IRQ_ONKEY] = { > .reg_offset = DA9063_REG_EVENT_A_OFFSET, > .mask = DA9063_M_ONKEY, > }, > [DA9063L_IRQ_ADC_RDY] = { > .reg_offset = DA9063_REG_EVENT_A_OFFSET, > .mask = DA9063_M_ADC_RDY, > }, > [DA9063L_IRQ_SEQ_RDY] = { > .reg_offset = DA9063_REG_EVENT_A_OFFSET, > .mask = DA9063_M_SEQ_RDY, > }, > /* DA9063 event B register */ > [DA9063L_IRQ_WAKE] = { > .reg_offset = DA9063_REG_EVENT_B_OFFSET, > .mask = DA9063_M_WAKE, > }, > [DA9063L_IRQ_TEMP] = { > .reg_offset = DA9063_REG_EVENT_B_OFFSET, > .mask = DA9063_M_TEMP, > }, > [DA9063L_IRQ_COMP_1V2] = { > .reg_offset = DA9063_REG_EVENT_B_OFFSET, > .mask = DA9063_M_COMP_1V2, > }, > [DA9063L_IRQ_LDO_LIM] = { > .reg_offset = DA9063_REG_EVENT_B_OFFSET, > .mask = DA9063_M_LDO_LIM, > }, > [DA9063L_IRQ_REG_UVOV] = { > .reg_offset = DA9063_REG_EVENT_B_OFFSET, > .mask = DA9063_M_UVOV, > }, > [DA9063L_IRQ_DVC_RDY] = { > .reg_offset = DA9063_REG_EVENT_B_OFFSET, > .mask = DA9063_M_DVC_RDY, > }, > [DA9063L_IRQ_VDD_MON] = { > .reg_offset = DA9063_REG_EVENT_B_OFFSET, > .mask = DA9063_M_VDD_MON, > }, > [DA9063L_IRQ_WARN] = { > .reg_offset = DA9063_REG_EVENT_B_OFFSET, > .mask = DA9063_M_VDD_WARN, > }, > /* DA9063 event C register */ > [DA9063L_IRQ_GPI0] = { > .reg_offset = DA9063_REG_EVENT_C_OFFSET, > .mask = DA9063_M_GPI0, > }, > [DA9063L_IRQ_GPI1] = { > .reg_offset = DA9063_REG_EVENT_C_OFFSET, > .mask = DA9063_M_GPI1, > }, > [DA9063L_IRQ_GPI2] = { > .reg_offset = DA9063_REG_EVENT_C_OFFSET, > .mask = DA9063_M_GPI2, > }, > [DA9063L_IRQ_GPI3] = { > .reg_offset = DA9063_REG_EVENT_C_OFFSET, > .mask = DA9063_M_GPI3, > }, > [DA9063L_IRQ_GPI4] = { > .reg_offset = DA9063_REG_EVENT_C_OFFSET, > .mask = DA9063_M_GPI4, > }, > [DA9063L_IRQ_GPI5] = { > .reg_offset = DA9063_REG_EVENT_C_OFFSET, > .mask = DA9063_M_GPI5, > }, > [DA9063L_IRQ_GPI6] = { > .reg_offset = DA9063_REG_EVENT_C_OFFSET, > .mask = DA9063_M_GPI6, > }, > [DA9063L_IRQ_GPI7] = { > .reg_offset = DA9063_REG_EVENT_C_OFFSET, > .mask = DA9063_M_GPI7, > }, > /* DA9063 event D register */ > [DA9063L_IRQ_GPI8] = { > .reg_offset = DA9063_REG_EVENT_D_OFFSET, > .mask = DA9063_M_GPI8, > }, > [DA9063L_IRQ_GPI9] = { > .reg_offset = DA9063_REG_EVENT_D_OFFSET, > .mask = DA9063_M_GPI9, > }, > [DA9063L_IRQ_GPI10] = { > .reg_offset = DA9063_REG_EVENT_D_OFFSET, > .mask = DA9063_M_GPI10, > }, > [DA9063L_IRQ_GPI11] = { > .reg_offset = DA9063_REG_EVENT_D_OFFSET, > .mask = DA9063_M_GPI11, > }, > [DA9063L_IRQ_GPI12] = { > .reg_offset = DA9063_REG_EVENT_D_OFFSET, > .mask = DA9063_M_GPI12, > }, > [DA9063L_IRQ_GPI13] = { > .reg_offset = DA9063_REG_EVENT_D_OFFSET, > .mask = DA9063_M_GPI13, > }, > [DA9063L_IRQ_GPI14] = { > .reg_offset = DA9063_REG_EVENT_D_OFFSET, > .mask = DA9063_M_GPI14, > }, > [DA9063L_IRQ_GPI15] = { > .reg_offset = DA9063_REG_EVENT_D_OFFSET, > .mask = DA9063_M_GPI15, > }, > }; We can probably do the same trick with the regmaps and irqmaps as with the rest, that is, reorder them and register only a smaller portion ? -- Best regards, Marek Vasut