From patchwork Wed Aug 20 06:26:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 35681 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f69.google.com (mail-qg0-f69.google.com [209.85.192.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5EA35202DD for ; Wed, 20 Aug 2014 06:27:17 +0000 (UTC) Received: by mail-qg0-f69.google.com with SMTP id a108sf22690476qge.0 for ; Tue, 19 Aug 2014 23:27:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=DMIoX3laSA2UicgHPIR4eSzaDzboRwlPBXizs2hPta4=; b=aKJgTa2mzBJBHjfq36xEOE9XpT7rWBnEixoiKTf75IuCWCcr+BVtlfFSx/tFRULRK2 Nr0LYRRn3zX2H8STU/fcwpNjw5iKDwASQIQSLv+a3K+ttZMO/vFe6VFbrgL8L2h5h0WO qnVNAHOmpwS6UNkOoHxuKlo5ID1g/PI2ux+IxeY0VMP569MXgbCgtDQ95fuUVSGD95xr i2LGRfBGYxVoyxdCQ6/05p5hEhlMZkq/0JKoL7h+AS8QsYMCSEuZwxHgf3l78b5///dr oxMjbTHpBWTJZWtq9ckyvq+l4TLLchSikukdVYUGQKwum6EB2/R1FFytmSE+2PF0oVh7 Ewjw== X-Gm-Message-State: ALoCoQnHaPVMWF0YfIOSM8p+Wal10fZpmzQzHuCRzkU/thxJDte03KsscJMIiLLA8ZlAXBiyeqMw X-Received: by 10.52.182.66 with SMTP id ec2mr6951948vdc.0.1408516037146; Tue, 19 Aug 2014 23:27:17 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.85.240 with SMTP id n103ls122720qgd.13.gmail; Tue, 19 Aug 2014 23:27:17 -0700 (PDT) X-Received: by 10.52.164.80 with SMTP id yo16mr4600000vdb.44.1408516037041; Tue, 19 Aug 2014 23:27:17 -0700 (PDT) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by mx.google.com with ESMTPS id n15si10214722vci.50.2014.08.19.23.27.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 19 Aug 2014 23:27:17 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.179 as permitted sender) client-ip=209.85.220.179; Received: by mail-vc0-f179.google.com with SMTP id hq11so8608941vcb.38 for ; Tue, 19 Aug 2014 23:27:17 -0700 (PDT) X-Received: by 10.52.164.199 with SMTP id ys7mr4959948vdb.42.1408516036955; Tue, 19 Aug 2014 23:27:16 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp29050vcb; Tue, 19 Aug 2014 23:27:16 -0700 (PDT) X-Received: by 10.66.155.2 with SMTP id vs2mr13519146pab.60.1408516036074; Tue, 19 Aug 2014 23:27:16 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fb7si30287405pab.27.2014.08.19.23.27.14 for ; Tue, 19 Aug 2014 23:27:15 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752060AbaHTG1N (ORCPT + 24 others); Wed, 20 Aug 2014 02:27:13 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:23344 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751607AbaHTG1L (ORCPT ); Wed, 20 Aug 2014 02:27:11 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NAL00EO9DX7L620@mailout3.w1.samsung.com> for linux-kernel@vger.kernel.org; Wed, 20 Aug 2014 07:27:07 +0100 (BST) X-AuditID: cbfec7f4-b7f156d0000063c7-29-53f43fbcd749 Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 4D.4B.25543.CBF34F35; Wed, 20 Aug 2014 07:27:08 +0100 (BST) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync2.samsung.com (Oracle Communications Messaging Server 7u4-23.01 (7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0NAL008DGDX4ZN80@eusync2.samsung.com>; Wed, 20 Aug 2014 07:27:08 +0100 (BST) From: Marek Szyprowski To: linux-kernel@vger.kernel.org Cc: Marek Szyprowski , linux-arm-kernel@lists.infradead.org, Lee Jones , Samuel Ortiz , Daniel Drake , Tobias Jakobi , Olof Johansson , Javier Martinez Canillas , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski Subject: [PATCH] mfd: max77686: make interrupts support optional Date: Wed, 20 Aug 2014 08:26:49 +0200 Message-id: <1408516009-22106-1-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpkluLIzCtJLcpLzFFi42I5/e/4Fd099l+CDSZ95rXYOGM9q8Wj+Y+Z LY7+LrB4/cLQ4v7Xo4wWmx5fY7W4vGsOm0XXz59sFmuP3GW3OHX9M5vF6W5WB26Pv8+vs3gs +p7lsXjTfjaPO9f2sHnMOxnosXlJvceVE02sHn1bVjF6fN4kF8AZxWWTkpqTWZZapG+XwJVx 9txRtoLpUhWfVm5jbWA8K9rFyMkhIWAisXb5WlYIW0ziwr31bF2MXBxCAksZJX6962OCcPqY JJoW32UEqWITMJToetvFBmKLCChIbO59xgpSxCywmVliWtcfFpCEsICDxOmZm8DGsgioSjzY MxsszivgIfG66RkjxDo5if8vVzBNYORewMiwilE0tTS5oDgpPddQrzgxt7g0L10vOT93EyMk 2L7sYFx8zOoQowAHoxIPr0L252Ah1sSy4srcQ4wSHMxKIrz1Zl+ChXhTEiurUovy44tKc1KL DzEycXBKNTAyRzlI7DgVInzhYJriokSZGENp/r3L7v45NTl6yXwVyfqJ/3+k5Mvw3PHp3dT6 T7xiww/uFKOrF0SiL1++verghX/F5k7qzP/8XNY0ilziO9XAY5C9TyLOSOBmaGJh4q1zFtpr l6/oPh7mwqSuqW24le37U+nMq9cydlxkPLnyp5OUzY+n4nFKLMUZiYZazEXFiQCrYgw0FAIA AA== Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: m.szyprowski@samsung.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Commit 6f1c1e71d93 ("mfd: max77686: Convert to use regmap_irq") broke support for boards, which provide no irq for MAX 77686 PMIC. In such case, not all functions of PMIC are available, but the driver still should at least handle voltage regulators instead of failing to init. This patch restores previous behavior. Signed-off-by: Marek Szyprowski --- Hello, This patch fixes booting issues with recently merged support for Exynos4412 based Odroid X2/U3 boards. See http://www.spinics.net/lists/linux-samsung-soc/msg35773.html thread for more details. Best regards Marek Szyprowski Samsung R&D Institute Poland --- drivers/mfd/max77686.c | 46 +++++++++++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/drivers/mfd/max77686.c b/drivers/mfd/max77686.c index 86e552348db4..525718c448c8 100644 --- a/drivers/mfd/max77686.c +++ b/drivers/mfd/max77686.c @@ -314,22 +314,26 @@ static int max77686_i2c_probe(struct i2c_client *i2c, } } - ret = regmap_add_irq_chip(max77686->regmap, max77686->irq, - IRQF_TRIGGER_FALLING | IRQF_ONESHOT | - IRQF_SHARED, 0, irq_chip, - &max77686->irq_data); - if (ret) { - dev_err(&i2c->dev, "failed to add PMIC irq chip: %d\n", ret); - goto err_unregister_i2c; - } + if (max77686->irq) { + ret = regmap_add_irq_chip(max77686->regmap, max77686->irq, + IRQF_TRIGGER_FALLING | IRQF_ONESHOT | + IRQF_SHARED, 0, irq_chip, + &max77686->irq_data); + if (ret) { + dev_err(&i2c->dev, "failed to add PMIC irq chip: %d\n", + ret); + goto err_unregister_i2c; + } - ret = regmap_add_irq_chip(*rtc_regmap, max77686->irq, - IRQF_TRIGGER_FALLING | IRQF_ONESHOT | - IRQF_SHARED, 0, rtc_irq_chip, - &max77686->rtc_irq_data); - if (ret) { - dev_err(&i2c->dev, "failed to add RTC irq chip: %d\n", ret); - goto err_del_irqc; + ret = regmap_add_irq_chip(*rtc_regmap, max77686->irq, + IRQF_TRIGGER_FALLING | IRQF_ONESHOT | + IRQF_SHARED, 0, rtc_irq_chip, + &max77686->rtc_irq_data); + if (ret) { + dev_err(&i2c->dev, "failed to add RTC irq chip: %d\n", + ret); + goto err_del_irqc; + } } ret = mfd_add_devices(max77686->dev, -1, cells, n_devs, NULL, 0, NULL); @@ -341,9 +345,11 @@ static int max77686_i2c_probe(struct i2c_client *i2c, return 0; err_del_rtc_irqc: - regmap_del_irq_chip(max77686->irq, max77686->rtc_irq_data); + if (max77686->irq) + regmap_del_irq_chip(max77686->irq, max77686->rtc_irq_data); err_del_irqc: - regmap_del_irq_chip(max77686->irq, max77686->irq_data); + if (max77686->irq) + regmap_del_irq_chip(max77686->irq, max77686->irq_data); err_unregister_i2c: if (max77686->type == TYPE_MAX77686) i2c_unregister_device(max77686->rtc); @@ -357,8 +363,10 @@ static int max77686_i2c_remove(struct i2c_client *i2c) mfd_remove_devices(max77686->dev); - regmap_del_irq_chip(max77686->irq, max77686->rtc_irq_data); - regmap_del_irq_chip(max77686->irq, max77686->irq_data); + if (max77686->irq) + regmap_del_irq_chip(max77686->irq, max77686->rtc_irq_data); + if (max77686->irq) + regmap_del_irq_chip(max77686->irq, max77686->irq_data); if (max77686->type == TYPE_MAX77686) i2c_unregister_device(max77686->rtc);