Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp249629imm; Wed, 18 Jul 2018 01:15:37 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcgPlzp73Qg6XnlydRiSXoLVi0iaKxJYN0gsB5PmSoUhz+D27AsZXU56VaXemW0PPH92t/Z X-Received: by 2002:aa7:8118:: with SMTP id b24-v6mr4222282pfi.78.1531901737504; Wed, 18 Jul 2018 01:15:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531901737; cv=none; d=google.com; s=arc-20160816; b=hxXbajO+hG94CK5TvRX0VipJAO+HQ8KUAb7dqniE+XRN6VPM03GxUPQYn70ovTp4EG b19fJYjdMiDO7sR0cB4ImFLzuJy/VK9ooXGsed+Y/TGGAVlNh0axQETQ/IFQPPDPrxPF 1668+thxe8mbofCcar8pGS3jv2w6YaUf0sjAKEab0YhMjNvbko2+BWbw3XXA1x/Pit5w v56pobh9YiyjpYeaMEBipuSDHuqegS3cZR+TggH5QTD0v+PYVg16Jtbao2xi2dB8nQ4V gM+PRWYuObwnWk+wqQfnGRFYY1Cki6457NyYDzfrUZNsFbMQzOPKhJWVdYQLgWbRisMX YP0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=lGrUAalemyiFYT3ZbUOJ0ZDJa1YxHXCBVv5wo8SBHps=; b=Hh1TT/OYGpbasN2QHQo/lB8APu2zGPXKPMOKOQ/erbrzZDPa71epioHa8NzwH0tLKr F1VZSzLjXBH+TSNjzx7oQf3l6XN+MWpvfa6Eqi+wIiK3IcevgK5raUWCCMdDyIU4ebCQ TT19VjvKLcgpsPGkzTAkINJGocJ2fZjOMTQ1J6KsuExaASsOKZ0R3tva9EqthfNilqvb y3BgbNtg0RxkZkq9cTUikgwjhx8gjvEjS7NwErRcKuIMX0y+osNJJl85zt7lG8niYrXH 6gk7YklPUvudhayQfUwlODVcoW5IhrPqG9fGjdEbfcxe3ahe+Z8+2gmxkoIiw9/LKvN7 XEkA== 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 k72-v6si3027060pgc.304.2018.07.18.01.15.22; Wed, 18 Jul 2018 01:15:37 -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 S1729650AbeGRIt6 (ORCPT + 99 others); Wed, 18 Jul 2018 04:49:58 -0400 Received: from mail.bootlin.com ([62.4.15.54]:40285 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726514AbeGRIt5 (ORCPT ); Wed, 18 Jul 2018 04:49:57 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 6924520766; Wed, 18 Jul 2018 10:13:13 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (unknown [88.191.26.124]) by mail.bootlin.com (Postfix) with ESMTPSA id 391CC2072C; Wed, 18 Jul 2018 10:13:13 +0200 (CEST) Date: Wed, 18 Jul 2018 10:13:13 +0200 From: Alexandre Belloni To: Denis OSTERLAND Cc: "a.zummo@towertech.it" , "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" Subject: Re: [PATCH v4 2/5] rtc: isl1208: add support for isl1219 with tamper detection Message-ID: <20180718081313.GI3211@piout.net> References: <20180710090710.9066-1-Denis.Osterland@diehl.com> <20180710090710.9066-3-Denis.Osterland@diehl.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20180710090710.9066-3-Denis.Osterland@diehl.com> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/07/2018 09:44:15+0000, Denis OSTERLAND wrote: > static int > isl1208_probe(struct i2c_client *client, const struct i2c_device_id *id) > { > @@ -642,6 +744,7 @@ isl1208_probe(struct i2c_client *client, const struct i2c_device_id *id) > rtc->ops = &isl1208_rtc_ops; > > i2c_set_clientdata(client, rtc); > + dev_set_drvdata(&rtc->dev, client); > > rc = isl1208_i2c_get_sr(client); > if (rc < 0) { > @@ -653,6 +756,18 @@ isl1208_probe(struct i2c_client *client, const struct i2c_device_id *id) > dev_warn(&client->dev, "rtc power failure detected, " > "please set clock.\n"); > > + if (id->driver_data == TYPE_ISL1219) { > + rc = ISL1219_REG_EV_EVEN; > + rc = i2c_smbus_write_byte_data(client, ISL1219_REG_EV, rc); I'd pass ISL1219_REG_EV_EVEN directly instead of assigning it to rc. > + if (rc < 0) { > + dev_err(&client->dev, "could not enable tamper detection\n"); > + return rc; > + } > + rc = rtc_add_group(rtc, &isl1219_rtc_sysfs_files); > + if (rc) > + return rc; > + } > + > rc = sysfs_create_group(&client->dev.kobj, &isl1208_rtc_sysfs_files); > if (rc) > return rc; > @@ -686,8 +801,9 @@ isl1208_remove(struct i2c_client *client) > } > > static const struct i2c_device_id isl1208_id[] = { > - { "isl1208", 0 }, > - { "isl1218", 0 }, > + { "isl1208", TYPE_ISL1208 }, > + { "isl1218", TYPE_ISL1218 }, > + { "isl1219", TYPE_ISL1219 }, > { } > }; > MODULE_DEVICE_TABLE(i2c, isl1208_id); > @@ -695,6 +811,7 @@ MODULE_DEVICE_TABLE(i2c, isl1208_id); > static const struct of_device_id isl1208_of_match[] = { > { .compatible = "isil,isl1208" }, > { .compatible = "isil,isl1218" }, > + { .compatible = "isil,isl1219" }, > { } > }; > MODULE_DEVICE_TABLE(of, isl1208_of_match); > -- > 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. -- Alexandre Belloni, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com