From patchwork Sun Feb 14 13:07:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 61918 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp550192lbl; Sun, 14 Feb 2016 05:07:22 -0800 (PST) X-Received: by 10.66.226.238 with SMTP id rv14mr16251623pac.41.1455455242231; Sun, 14 Feb 2016 05:07:22 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id uj7si35504645pab.111.2016.02.14.05.07.21; Sun, 14 Feb 2016 05:07:22 -0800 (PST) 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; 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; dkim=pass header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751496AbcBNNHS (ORCPT + 30 others); Sun, 14 Feb 2016 08:07:18 -0500 Received: from mail-lf0-f53.google.com ([209.85.215.53]:36706 "EHLO mail-lf0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751312AbcBNNHP (ORCPT ); Sun, 14 Feb 2016 08:07:15 -0500 Received: by mail-lf0-f53.google.com with SMTP id 78so75001569lfy.3 for ; Sun, 14 Feb 2016 05:07:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=YpY88epz3daKh6jP3r4ezUCpJZ/pZFIhZm7uddByFcE=; b=HbrGn84Sa1BqYdyYPBxSwm0kuvyW4WKH0Er9vRHNWtHR2faMlEgbrxyVHyapCm5OHG oh9pDvmWFtqW3EeFfydOStXME07ScLmOhjTuF+66mWhZqOORKnmt0MzrGmN9TIl8Oc5X 55ya6RhfpDNTD/JQOyDKf4wkdAXRw/I8pEeu0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=YpY88epz3daKh6jP3r4ezUCpJZ/pZFIhZm7uddByFcE=; b=PbXXazLwHE1SMe2z6hHNMyScfU3WkBV3U1ivOWqlpAlYENP9sKz6nsS2DHYSYJsD84 jFaP4qHPT/AMffMMTHix/fmfQqLKcyKKM5u3PfWgVYYfQMIihmdK07O8G4rHG+8aUBJq rrkStcwI3Yaqc8fMIYcRua/7/4T79r3G2nj0WoVMIfM6SXti7klfP9viojHMluoZhkGf 1/6wBGpTojjpMHsCVARvVmPHQSD/lWP7Ct3BYO2CvMBoDiTG0A2vzCUwo7g/yEo1zLZz tpHK5uAfDOlvn/cu0XQfAyw+haEQpP+qCxAhVdhke2HQneQK7R5ePpjIiPqonBs/Jnsp 8qVA== X-Gm-Message-State: AG10YOTpdvMmIkuoaU8hwvnVduD+O03eNVoDaizm/ApqX70V/qihSRHQom9bWhgF8ElEF2Vz X-Received: by 10.25.169.82 with SMTP id s79mr2381420lfe.47.1455455234010; Sun, 14 Feb 2016 05:07:14 -0800 (PST) Received: from localhost.localdomain.localdomain (c-3d95db54.01-192-6c756e10.cust.bredbandsbolaget.se. [84.219.149.61]) by smtp.gmail.com with ESMTPSA id g74sm3049273lfi.1.2016.02.14.05.07.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Feb 2016 05:07:12 -0800 (PST) From: Linus Walleij To: Samuel Ortiz , Lee Jones , linux-kernel@vger.kernel.org Cc: Linus Walleij , linux-pwm@vger.kernel.org, Thierry Reding Subject: [PATCH] mfd: stmpe: add the proper PWM resources Date: Sun, 14 Feb 2016 14:07:07 +0100 Message-Id: <1455455227-16848-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.4.3 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This adds the PWM resources to the STMPE MFD driver, so that it can properly grab and use them. Cc: linux-pwm@vger.kernel.org Cc: Thierry Reding Signed-off-by: Linus Walleij --- ChangeLog: split this patch off from the PWM driver and sent separately. This can be merged separately too so we need no criss-cross between MFD and PWM anymore, Lee: this one is for you if it looks all right, excess newlines are gone too. --- drivers/mfd/stmpe.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) -- 2.4.3 diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c index 8222e374e4b1..fb8f9e8b75df 100644 --- a/drivers/mfd/stmpe.c +++ b/drivers/mfd/stmpe.c @@ -334,6 +334,31 @@ static const struct mfd_cell stmpe_keypad_cell = { }; /* + * PWM (1601, 2401, 2403) + */ +static struct resource stmpe_pwm_resources[] = { + { + .name = "PWM0", + .flags = IORESOURCE_IRQ, + }, + { + .name = "PWM1", + .flags = IORESOURCE_IRQ, + }, + { + .name = "PWM2", + .flags = IORESOURCE_IRQ, + }, +}; + +static const struct mfd_cell stmpe_pwm_cell = { + .name = "stmpe-pwm", + .of_compatible = "st,stmpe-pwm", + .resources = stmpe_pwm_resources, + .num_resources = ARRAY_SIZE(stmpe_pwm_resources), +}; + +/* * STMPE801 */ static const u8 stmpe801_regs[] = { @@ -537,6 +562,11 @@ static struct stmpe_variant_block stmpe1601_blocks[] = { .irq = STMPE1601_IRQ_KEYPAD, .block = STMPE_BLOCK_KEYPAD, }, + { + .cell = &stmpe_pwm_cell, + .irq = STMPE1601_IRQ_PWM0, + .block = STMPE_BLOCK_PWM, + }, }; /* supported autosleep timeout delay (in msecs) */ @@ -771,6 +801,11 @@ static struct stmpe_variant_block stmpe24xx_blocks[] = { .irq = STMPE24XX_IRQ_KEYPAD, .block = STMPE_BLOCK_KEYPAD, }, + { + .cell = &stmpe_pwm_cell, + .irq = STMPE24XX_IRQ_PWM0, + .block = STMPE_BLOCK_PWM, + }, }; static int stmpe24xx_enable(struct stmpe *stmpe, unsigned int blocks,