Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp6870084imm; Tue, 24 Jul 2018 04:42:31 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfZiEQaEC5E2f6O79jFsN9RWtxEaJ94WriLoouEO+0xz9vp2iPjic5jdMXLG8zkOob/BXCf X-Received: by 2002:a17:902:28e4:: with SMTP id f91-v6mr16841757plb.70.1532432551046; Tue, 24 Jul 2018 04:42:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532432551; cv=none; d=google.com; s=arc-20160816; b=Lw9E9F8XS7wsyCreYGVo6MS1QkybleiylwNMkrkkKR/erdB6yX9/xmA1E5/kOd3LUp QIi4zKMj8NIY+jqb9vK2La+0G4RZ4zcAIIW7z2LyLR39j8wTMYhAYQzX+wTTv+1Kcupj 8YBwl3xUAzLlIMFYSn4tAZ5wHNCL+5JocNAiOkpDgisSMRJJ74GsALLfkLlCVW2ihPXg VGeiIq1bwjg5vi/O6i+Zla6JuQM+VOIY1I0yi7OsHfZfkPUbfLEB7JQfa9NIVFhctDPE QRjKE9b5Ub1PgpF0KbHKrWgFYnGbPIa4BE64WmByuoUCbNgjyAlJMW9OZvBBQIUMS2go yf9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:mime-version:accept-language:in-reply-to :references:message-id:date:thread-index:thread-topic:subject:cc:to :from:arc-authentication-results; bh=DuzL3EcSvmhrhykhiO13Hj8KoKeifxglxer2wlSXBFE=; b=Z0a9gp9ax/ubi4qQldo7cbfIW/9SAbIIDtCnlbN6uTuziPpPXq+H5raqURe6KJiN0d 6w5G3fT3ViHTAG8nQ9ZgVUMhwxPgezM+rMQJGKP69pGo1jC+ayvhx/QY+4mK2PV4TkTj bFzuZ1RCOIj087kioW1Em8DfEzuFoCRDeXt7M7XmlPrDgWhnABx4QNZTb+jCz91c3Cie 8lOkz1x5qDFypz57WboTs8NQCcp9/9T5eb5mRg6vHFuMvMOpSsTOb6X9mjdHMmYW3vdt /YBQw+wLWAE06FtW5Q5HIEN4vuqtBuCHwYXkeCUuI3qDQt6xIfuHDslFUltTB2wI8ZIw s4sQ== ARC-Authentication-Results: i=1; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x4-v6si9973834pln.487.2018.07.24.04.42.16; Tue, 24 Jul 2018 04:42:31 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388410AbeGXMrU convert rfc822-to-8bit (ORCPT + 99 others); Tue, 24 Jul 2018 08:47:20 -0400 Received: from enterprise02.smtp.diehl.com ([193.201.238.220]:61312 "EHLO enterprise02.smtp.diehl.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388256AbeGXMrU (ORCPT ); Tue, 24 Jul 2018 08:47:20 -0400 X-$ESA-Groupmapping: true X-IronPort-AV: E=Sophos;i="5.51,397,1526335200"; d="scan'208";a="34467531" From: Denis OSTERLAND To: "a.zummo@towertech.it" , "alexandre.belloni@bootlin.com" CC: "linux-kernel@vger.kernel.org" , "robh+dt@kernel.org" , "m.grzeschik@pengutronix.de" , "devicetree@vger.kernel.org" , "mark.rutland@arm.com" , "linux-rtc@vger.kernel.org" , "kernel@pengutronix.de" , Denis OSTERLAND Subject: [PATCH v5 4/5] rtc: isl1208: set ev-evienb bit from device tree Thread-Topic: [PATCH v5 4/5] rtc: isl1208: set ev-evienb bit from device tree Thread-Index: AQHUI0HYlN5vLmSop0OQEh24l8R1pw== Date: Tue, 24 Jul 2018 11:31:21 +0000 Message-ID: <20180724095437.6016-5-Denis.Osterland@diehl.com> References: <20180724095437.6016-1-Denis.Osterland@diehl.com> In-Reply-To: <20180724095437.6016-1-Denis.Osterland@diehl.com> Accept-Language: de-DE, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: Evolution 3.18.5.2-0ubuntu3.2 MIME-Version: 1.0 X-TrailerSkip: 1 X-GBS-PROC: byQFdw3ukCM+zy1/poiPc3S+cPOwesVRp3YOtqJ1nLGzDTCHgOUEK+Oxjt5YvNJU X-TNEFEvaluated: 1 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="iso-8859-1" Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Denis Osterland Add support to disable event in pull-up. Signed-off-by: Denis Osterland --- drivers/rtc/rtc-isl1208.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/drivers/rtc/rtc-isl1208.c b/drivers/rtc/rtc-isl1208.c index 0812a14c2d5c..fa744c7ad5b3 100644 --- a/drivers/rtc/rtc-isl1208.c +++ b/drivers/rtc/rtc-isl1208.c @@ -44,6 +44,7 @@ #define ISL1208_REG_INT_IM (1<<7) /* interrupt/alarm mode */ #define ISL1219_REG_EV 0x09 #define ISL1219_REG_EV_EVEN (1<<4) /* event detection enable */ +#define ISL1219_REG_EV_EVIENB (1<<7) /* event in pull-up disable */ #define ISL1208_REG_ATR 0x0a #define ISL1208_REG_DTR 0x0b @@ -777,8 +778,22 @@ isl1208_probe(struct i2c_client *client, const struct i2c_device_id *id) "please set clock.\n"); if (id->driver_data == TYPE_ISL1219) { - rc = i2c_smbus_write_byte_data(client, ISL1219_REG_EV, - ISL1219_REG_EV_EVEN); + struct device_node *np = client->dev.of_node; + u32 evienb; + + rc = i2c_smbus_read_byte_data(client, ISL1219_REG_EV); + if (rc < 0) { + dev_err(&client->dev, "failed to read EV reg\n"); + return rc; + } + rc |= ISL1219_REG_EV_EVEN; + if (!of_property_read_u32(np, "isil,ev-evienb", &evienb)) { + if (evienb) + rc |= ISL1219_REG_EV_EVIENB; + else + rc &= ~ISL1219_REG_EV_EVIENB; + } + rc = i2c_smbus_write_byte_data(client, ISL1219_REG_EV, rc); if (rc < 0) { dev_err(&client->dev, "could not enable tamper detection\n"); return rc; @@ -786,7 +801,7 @@ isl1208_probe(struct i2c_client *client, const struct i2c_device_id *id) rc = rtc_add_group(rtc, &isl1219_rtc_sysfs_files); if (rc) return rc; - evdet_irq = of_irq_get_byname(client->dev.of_node, "evdet"); + evdet_irq = of_irq_get_byname(np, "evdet"); } rc = sysfs_create_group(&client->dev.kobj, &isl1208_rtc_sysfs_files); -- 2.18.0 Diehl Connectivity Solutions GmbH Gesch?ftsf?hrung: Horst Leonberger Sitz der Gesellschaft: N?rnberg - Registergericht: Amtsgericht N?rnberg: HRB 32315 ___________________________________________________________________________________________________ Der Inhalt der vorstehenden E-Mail ist nicht rechtlich bindend. Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen. Informieren Sie uns bitte, wenn Sie diese E-Mail faelschlicherweise erhalten haben. Bitte loeschen Sie in diesem Fall die Nachricht. Jede unerlaubte Form der Reproduktion, Bekanntgabe, Aenderung, Verteilung und/oder Publikation dieser E-Mail ist strengstens untersagt. The contents of the above mentioned e-mail is not legally binding. This e-mail contains confidential and/or legally protected information. Please inform us if you have received this e-mail by mistake and delete it in such a case. Each unauthorized reproduction, disclosure, alteration, distribution and/or publication of this e-mail is strictly prohibited.