Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp4027709ybx; Sat, 9 Nov 2019 07:47:57 -0800 (PST) X-Google-Smtp-Source: APXvYqzAb2saKNpo2TC9yHE5285t5qr8Ds7F4yUhOA+BCbs8YldfIAv7ZLF+1EdGdwf4yqsJ5SoM X-Received: by 2002:aa7:d147:: with SMTP id r7mr16810415edo.198.1573314477727; Sat, 09 Nov 2019 07:47:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573314477; cv=none; d=google.com; s=arc-20160816; b=r6vymatCDeq5DxCifXFRuSwEBpNYICs4ShTyyMJCdi75hzYCznEvUrkKkeNSYiS1Ee oORgf/MxMCpAOInaa0ndPGR0MHAP/bWKrWiXX5XbHa6QephdwzpzbtkVHqu7N8N03ZTj fvkmEeaNOwyXM/hxKDV82eKd6VkW+Ij8L6xxTATCfSPABpH/C7J+od+yVmfJCjpDyFzs TJQodDqcAEP54rUg41vFca4RBeOfYb87mR0N4/DCE5uqJ9ayzJhwAXKvC8JAAgLb6alV TPssVen/OWhkFWiJOWIoRwH5hiX8hpj9+XwkYdJ+FxPQRR7kyjzJsbf51CUc3UlPdE9n DKWA== 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:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=X2MNWyYxDIwl5/Y9DLOD0SRUpFh0800mLWYZQrn0cFw=; b=l7e2LGDVrA6TvtC45gc6kjbi7rxlukMbb+XAkX9W1SO3yCZ5eePaFQb+tEGSXmVXV+ aGEVvz07SjhtahW5NU88/IJT+AxODnbADIZaGkVdee2QXLAAGVDJlG/bBg+nwI8D8tgS pox2Je9bzedKRNU0BATe64IB9fOTqtL68ieFzRaXbBGDbOeprQZvq42PCKCUG7iGkhWH kIAmk0/H64Pfv6xbyLGmxCaVp47jx8nSEikB/quk/0yXsw2xpwY84YX96dqMxFFctvnB tUbbFvhK/XzBUP7Jc4qeSIYXizeqouvs7rcRwY7DxLJXAhw25FiApaTrE/5ZPbTGwvd3 0xkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="O0B6+Ie/"; 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 gg25si5847009ejb.5.2019.11.09.07.47.33; Sat, 09 Nov 2019 07:47:57 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b="O0B6+Ie/"; 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 S1726194AbfKIPrB (ORCPT + 99 others); Sat, 9 Nov 2019 10:47:01 -0500 Received: from mail-lf1-f67.google.com ([209.85.167.67]:37755 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726026AbfKIPrB (ORCPT ); Sat, 9 Nov 2019 10:47:01 -0500 Received: by mail-lf1-f67.google.com with SMTP id b20so6724487lfp.4; Sat, 09 Nov 2019 07:47:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=X2MNWyYxDIwl5/Y9DLOD0SRUpFh0800mLWYZQrn0cFw=; b=O0B6+Ie/CO8H2I8KqlKT5A11S9gWLbnRbEKHRPQjq9M4dQwy9khnxFG2rp1S5wnWYr bjagMxx1Sg20hb85dtRGpUTZjYlvKbl+uPMQiqZYuhms8+KHBy7kgHmcOE+Yy8ySRUhW RODFrqLNTx6Wc0Ui3Ae1eH++IwrCqpbVyYe9mE1Dg2S/atkh9NZEmYyJkMRRFWXSJtMl JgW5qcPxDSeglcyoeAc2vvg9vcYZlpS+r7pexwuvmArzoUXclK2iYFlwrGlomXiYe2fE NF6ru+eceDaHO60BUmSKnffAZz6VI8jDDHsiaKYRZolEpD2HpbLGcWDf9HrEAD7EIrpz sTow== 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:mime-version :content-transfer-encoding; bh=X2MNWyYxDIwl5/Y9DLOD0SRUpFh0800mLWYZQrn0cFw=; b=qQTSgyJJcClVVA7bC/UcT8CwEew10NVgqtT5RYFh7/PgWN7liMV6HEvUBM7Vn5lAVQ UCHhcXPfx11w5vCrML75X4dHyQzcdWSZ8jCXrlQaFatL8/eGamZozPMCqxQj5V4Z4y94 4yPVgOFEPVr9oqOiu4mhy896a3r7M+zQe29jvP7YUTpGPuqTb8QLO4leMMaM+1YI4OYH 9qhqpwmCH8Q0jqUPatA4Kxjoo7D0SL8fU1GzrQhHGvrzkyKqXlDTHKyr4gt0IZdSOhl3 TEYti+xhVIbnbsPxjAMzm2hHQVR/GQj8lbVA/YREKyXeeByKavI10QRuWBVQC8NmCUiM tlbw== X-Gm-Message-State: APjAAAVs2KVSre5o/6aGZF+ft7lXRcRMVXwzsSAgyvWvz2PzbQguIwun wm1mHHZQVaQVpu+ZEdLXQUA= X-Received: by 2002:a19:4909:: with SMTP id w9mr9975308lfa.174.1573314419271; Sat, 09 Nov 2019 07:46:59 -0800 (PST) Received: from localhost.localdomain ([188.243.226.168]) by smtp.gmail.com with ESMTPSA id g21sm4141987ljh.2.2019.11.09.07.46.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Nov 2019 07:46:58 -0800 (PST) From: Andrey Skvortsov To: Alessandro Zummo , Alexandre Belloni , linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andrey Skvortsov Subject: [PATCH] rtc: tps65910: allow using RTC without alarm interrupt Date: Sat, 9 Nov 2019 18:46:52 +0300 Message-Id: <20191109154652.7419-1-andrej.skvortzov@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Andrey Skvortsov --- drivers/rtc/rtc-tps65910.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/rtc/rtc-tps65910.c b/drivers/rtc/rtc-tps65910.c index 2c0467a9e717..aa3a001ef413 100644 --- a/drivers/rtc/rtc-tps65910.c +++ b/drivers/rtc/rtc-tps65910.c @@ -361,6 +361,13 @@ static const struct rtc_class_ops tps65910_rtc_ops = { .set_offset = tps65910_set_offset, }; +static const struct rtc_class_ops tps65910_rtc_ops_noirq = { + .read_time = tps65910_rtc_read_time, + .set_time = tps65910_rtc_set_time, + .read_offset = tps65910_read_offset, + .set_offset = tps65910_set_offset, +}; + static int tps65910_rtc_probe(struct platform_device *pdev) { struct tps65910 *tps65910 = NULL; @@ -415,13 +422,17 @@ static int tps65910_rtc_probe(struct platform_device *pdev) tps65910_rtc_interrupt, IRQF_TRIGGER_LOW, dev_name(&pdev->dev), &pdev->dev); if (ret < 0) { - dev_err(&pdev->dev, "IRQ is not free.\n"); - return ret; + dev_err(&pdev->dev, "request IRQ:%d failed, err = %d\n", + irq, ret); + irq = -1; } tps_rtc->irq = irq; - device_set_wakeup_capable(&pdev->dev, 1); + if (irq != -1) { + device_set_wakeup_capable(&pdev->dev, 1); + tps_rtc->rtc->ops = &tps65910_rtc_ops; + } else + tps_rtc->rtc->ops = &tps65910_rtc_ops_noirq; - tps_rtc->rtc->ops = &tps65910_rtc_ops; tps_rtc->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000; tps_rtc->rtc->range_max = RTC_TIMESTAMP_END_2099; -- 2.20.1