Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1538482imm; Sat, 2 Jun 2018 03:22:18 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL5LxXtIeC+n2m0g2ULMZM94jghhG9MrXUjc82oMOVGwoW17sZBjFO6igqhtohZgCEh3iZ2 X-Received: by 2002:a62:4708:: with SMTP id u8-v6mr14228335pfa.89.1527934938102; Sat, 02 Jun 2018 03:22:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527934938; cv=none; d=google.com; s=arc-20160816; b=Rl1GhVHROfLenCHcj4BR2nzh+BkD8XD11Qqsyb9SRhTNNcJj9m2RpzywZ0pXVqP4Ot G5Y7qs4tNzux9paoCToSediTfra6gPqSRdTskI1wD1wQIz3oRwwZ6Po3rFTcR7PPyTHJ swPG7gjnZVy6re00j+kAvV0Xk2fEukqLoP5fox3IEarO57vhKOxaQfFGJnCfGwz7f+Kb QMi4WKAa01QEfeb/Mf7bBMu5FCbZjIEeSVcnify44OvLE41hwBrjBQ5jTycKCgHNvoea gWt5InT364pqZOm6893MKtQL+nsgt9Mcp8XN9DG0Ix4shuqErd5EM3e2e9FOE2X3Wu44 eAlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=fdyomJblYrOTFoyZCSjxbaYQzD3gnpw3VcmygjQM/QY=; b=vSOCFuUEheb6a7q8X06VpwJYHrTgekUdRLkRmek6wgk6SF5WEJj4akPBJI6LsvkiO1 YFZAjQRI/0GZICpFQ2If0IVAuE5wHFYdEy91qU1ZkNnp96GfGD0VR7nDYefn3sIWBqdb TquQE2ID9RWmzUC2RHwGrZxMZ3RQm5tybh0RaPXZEk7TdRXKL3t7mk8woxOP+dJdMTov Nw5j/t2LKYj3qpc+Nmt0EXlbwaM47jHMQ6+5CvNnUdlwSg7WVH9Ig++w21DmM6XybIuS a/Eol5bPmue1kiyRtuUi1X5Ki1LBRYIgUXsBxZYC9HARWOIb/7jo9ZV3UDpL6SvU78Uy NVCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=h22V4nka; 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 a12-v6si42038062plp.225.2018.06.02.03.21.33; Sat, 02 Jun 2018 03:22: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=h22V4nka; 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 S1751934AbeFBKMp (ORCPT + 99 others); Sat, 2 Jun 2018 06:12:45 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:39121 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751553AbeFBKMX (ORCPT ); Sat, 2 Jun 2018 06:12:23 -0400 Received: by mail-wm0-f67.google.com with SMTP id p11-v6so5895628wmc.4; Sat, 02 Jun 2018 03:12:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=fdyomJblYrOTFoyZCSjxbaYQzD3gnpw3VcmygjQM/QY=; b=h22V4nkaEKAbSDIU+L1FhpVK2AglRj/LI4fk/6oac3lH9cBxmuH7q2lOxMpMJZS3lz R3PD7cXFOmNS5z40ywXThFOHm/GEdlYcM2dHUvcZYvcc3plrPYVFQkzsSGYoLT/prq36 o/iHxOtjf6nASSoUhTQbhWixU9idEH5NFvFNOTX5HqlIMkpQt83abDXyX48yM6kcg1HU XeoaBt5171q0/jj8FsbKN/IxG9rQQ2skj9yCRnBjEyMgJb5KjpeM+L0Y9e3y4nIruoLJ x5ub/pMCrC/JObxcLyQ27NaGCVvy7Oswy+6Wtw9CxkiJHmcViky1ZoptJP/+RAeRjAIu kDig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=fdyomJblYrOTFoyZCSjxbaYQzD3gnpw3VcmygjQM/QY=; b=TF+9jIdC/ciNAuI5MFQD6jjShPai9j/010s15KZD4GFT3lHbIl2+QGV+XvWkukaEoh 6ScFdhXHU+kdUI3isB6UgvrSsvhCgegc6wbxlFPLehpXyJJjpP5BWwnfUbforNRJE/CD iygOgH5PNkt1GqF5hS3wWgxVjsm2OR7pIkYPUP9AawFb7s2XTCkFcxt0MVKebUR+e3MD EZ+X4W1uZwpdTA+6vdxW1YojVNQti99PTG4w34FBVe1XukUmgXLIT+CmHa+6PEVl5Nzl EZ+OE7zJiO3SbwGnT03vLoB2Fg7km/4mJamy1QybwFt3AknB1ON6sWLCL7NLFfc6FxL/ OrUQ== X-Gm-Message-State: APt69E32cr1lu/wVnZwfPIh7qIkfvZJXY954t4BrEA19ZkAx55cdiUf2 5J9Rhl6Fz/nW5w8cCHmf90YhPlZ0 X-Received: by 2002:a1c:928c:: with SMTP id u134-v6mr2829644wmd.106.1527934341808; Sat, 02 Jun 2018 03:12:21 -0700 (PDT) Received: from kurokawa.lan (ip-86-49-107-50.net.upcbroadband.cz. [86.49.107.50]) by smtp.gmail.com with ESMTPSA id b16-v6sm38624797wrm.89.2018.06.02.03.12.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 02 Jun 2018 03:12:21 -0700 (PDT) From: Marek Vasut X-Google-Original-From: Marek Vasut 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 v3 07/10] mfd: da9063: Add custom IRQ map for DA9063L Date: Sat, 2 Jun 2018 12:11:52 +0200 Message-Id: <20180602101155.26375-7-marek.vasut+renesas@gmail.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180602101155.26375-1-marek.vasut+renesas@gmail.com> References: <20180602101155.26375-1-marek.vasut+renesas@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org While the datasheet for DA9063L (2v1, 23-Mar-2017) lists the RTC register block, the DA9063L does not have an RTC. Add custom IRQ map for DA9063L to ignore the Alarm and Tick IRQs from the PMIC. Signed-off-by: Marek Vasut Cc: Geert Uytterhoeven Cc: Lee Jones Cc: Mark Brown Cc: Steve Twiss Cc: Wolfram Sang Cc: linux-renesas-soc@vger.kernel.org --- V3: New patch --- drivers/mfd/da9063-irq.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/drivers/mfd/da9063-irq.c b/drivers/mfd/da9063-irq.c index 5b406ecfc14a..b6a88861cc2e 100644 --- a/drivers/mfd/da9063-irq.c +++ b/drivers/mfd/da9063-irq.c @@ -74,8 +74,55 @@ static const struct regmap_irq_chip da9063_irq_chip = { .init_ack_masked = true, }; +static const struct regmap_irq da9063l_irqs[] = { + /* DA9063 event A register */ + REGMAP_IRQ_REG(DA9063_IRQ_ONKEY, DA9063_REG_EVENT_A_OFFSET, DA9063_M_ONKEY), + REGMAP_IRQ_REG(DA9063_IRQ_ADC_RDY, DA9063_REG_EVENT_A_OFFSET, DA9063_M_ADC_RDY), + REGMAP_IRQ_REG(DA9063_IRQ_SEQ_RDY, DA9063_REG_EVENT_A_OFFSET, DA9063_M_SEQ_RDY), + /* DA9063 event B register */ + REGMAP_IRQ_REG(DA9063_IRQ_WAKE, DA9063_REG_EVENT_B_OFFSET, DA9063_M_WAKE), + REGMAP_IRQ_REG(DA9063_IRQ_TEMP, DA9063_REG_EVENT_B_OFFSET, DA9063_M_TEMP), + REGMAP_IRQ_REG(DA9063_IRQ_COMP_1V2, DA9063_REG_EVENT_B_OFFSET, DA9063_M_COMP_1V2), + REGMAP_IRQ_REG(DA9063_IRQ_LDO_LIM, DA9063_REG_EVENT_B_OFFSET, DA9063_M_LDO_LIM), + REGMAP_IRQ_REG(DA9063_IRQ_REG_UVOV, DA9063_REG_EVENT_B_OFFSET, DA9063_M_UVOV), + REGMAP_IRQ_REG(DA9063_IRQ_DVC_RDY, DA9063_REG_EVENT_B_OFFSET, DA9063_M_DVC_RDY), + REGMAP_IRQ_REG(DA9063_IRQ_VDD_MON, DA9063_REG_EVENT_B_OFFSET, DA9063_M_VDD_MON), + REGMAP_IRQ_REG(DA9063_IRQ_WARN, DA9063_REG_EVENT_B_OFFSET, DA9063_M_VDD_WARN), + /* DA9063 event C register */ + REGMAP_IRQ_REG(DA9063_IRQ_GPI0, DA9063_REG_EVENT_C_OFFSET, DA9063_M_GPI0), + REGMAP_IRQ_REG(DA9063_IRQ_GPI1, DA9063_REG_EVENT_C_OFFSET, DA9063_M_GPI1), + REGMAP_IRQ_REG(DA9063_IRQ_GPI2, DA9063_REG_EVENT_C_OFFSET, DA9063_M_GPI2), + REGMAP_IRQ_REG(DA9063_IRQ_GPI3, DA9063_REG_EVENT_C_OFFSET, DA9063_M_GPI3), + REGMAP_IRQ_REG(DA9063_IRQ_GPI4, DA9063_REG_EVENT_C_OFFSET, DA9063_M_GPI4), + REGMAP_IRQ_REG(DA9063_IRQ_GPI5, DA9063_REG_EVENT_C_OFFSET, DA9063_M_GPI5), + REGMAP_IRQ_REG(DA9063_IRQ_GPI6, DA9063_REG_EVENT_C_OFFSET, DA9063_M_GPI6), + REGMAP_IRQ_REG(DA9063_IRQ_GPI7, DA9063_REG_EVENT_C_OFFSET, DA9063_M_GPI7), + /* DA9063 event D register */ + REGMAP_IRQ_REG(DA9063_IRQ_GPI8, DA9063_REG_EVENT_D_OFFSET, DA9063_M_GPI8), + REGMAP_IRQ_REG(DA9063_IRQ_GPI9, DA9063_REG_EVENT_D_OFFSET, DA9063_M_GPI9), + REGMAP_IRQ_REG(DA9063_IRQ_GPI10, DA9063_REG_EVENT_D_OFFSET, DA9063_M_GPI10), + REGMAP_IRQ_REG(DA9063_IRQ_GPI11, DA9063_REG_EVENT_D_OFFSET, DA9063_M_GPI11), + REGMAP_IRQ_REG(DA9063_IRQ_GPI12, DA9063_REG_EVENT_D_OFFSET, DA9063_M_GPI12), + REGMAP_IRQ_REG(DA9063_IRQ_GPI13, DA9063_REG_EVENT_D_OFFSET, DA9063_M_GPI13), + REGMAP_IRQ_REG(DA9063_IRQ_GPI14, DA9063_REG_EVENT_D_OFFSET, DA9063_M_GPI14), + REGMAP_IRQ_REG(DA9063_IRQ_GPI15, DA9063_REG_EVENT_D_OFFSET, DA9063_M_GPI15), +}; + +static const struct regmap_irq_chip da9063l_irq_chip = { + .name = "da9063l-irq", + .irqs = da9063l_irqs, + .num_irqs = DA9063_NUM_IRQ, + + .num_regs = 4, + .status_base = DA9063_REG_EVENT_A, + .mask_base = DA9063_REG_IRQ_MASK_A, + .ack_base = DA9063_REG_EVENT_A, + .init_ack_masked = true, +}; + int da9063_irq_init(struct da9063 *da9063) { + struct regmap_irq_chip *irq_chip; int ret; if (!da9063->chip_irq) { @@ -83,10 +130,14 @@ int da9063_irq_init(struct da9063 *da9063) return -EINVAL; } + if (da9063->type == PMIC_TYPE_DA9063) + irq_chip = &da9063_irq_chip; + else + irq_chip = &da9063l_irq_chip; + ret = regmap_add_irq_chip(da9063->regmap, da9063->chip_irq, IRQF_TRIGGER_LOW | IRQF_ONESHOT | IRQF_SHARED, - da9063->irq_base, &da9063_irq_chip, - &da9063->regmap_irq); + da9063->irq_base, irq_chip, &da9063->regmap_irq); if (ret) { dev_err(da9063->dev, "Failed to reguest IRQ %d: %d\n", da9063->chip_irq, ret); -- 2.16.2