Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp822064pxb; Thu, 28 Jan 2021 00:35:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJxpIJiQfhTxL/U0QrTCXmmLloLZ/b8mMBYPT6iXEAU396Di5JspuX0lRifiBz8PFi8Fmuu/ X-Received: by 2002:a17:907:c01:: with SMTP id ga1mr9712244ejc.488.1611822942891; Thu, 28 Jan 2021 00:35:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611822942; cv=none; d=google.com; s=arc-20160816; b=u705jyoKgZQ5malNb7ukGPfq7XmRK6YtF7myor408dCr3oFYAWBySCz+X7HBIrKg39 kN/3HB95VAjMbRHVFIf38ZcXwfQg9jaec0sVA3o24PkKFVQxjw8Z5ubHdd0dOK5pLfOh ves3truPQeUjfViY6fnLsIPvlHg7+evJdML0uvYomwyHZrP09byphix9fARubG6XRsae k12nIfXHzJFsDVu+8q4reZbJuvI8MzWYGoVckyWmxfJJ82BYmd3lGQYgaQFp7+p4nAHv cJFdX83xPmf8BgzKjWf7JaBLSBw003rBVPeiCtf057idOdQu5Qf/Q/YpPAipeTLTlZYH 3OZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:message-id:date:to:cc:from:subject :references:in-reply-to:content-transfer-encoding:mime-version :dkim-signature; bh=eSzw6mIxV1anumYEd5uTi6KNUqQBP7nI7s0j+BuQJKM=; b=JZyqy1lms13w3dg1mNLNdW4vy1A2ZYNouHPeZpnj3o5cIBZmEbEHvMTMGaPIJxvLv9 884/P0EyrH0DLmmsTCbuNVybBEvvMJLY3aky0QLhhN6pwYGuXbnsBBXQrS2ppxTeC882 r5URxni1zWtBQ+kEpY7HHqrv4tUMfeO4oQHm0H2EvV30lfcRatpZkdnyWLdxVsBuOaRL +tymkrS3SjrtRRbYqugqvgn5VaV/2nFFwww85tE34VaEUIfXi88r4UWH32oYKb/O3hDO ZgS3WqugwpcIEItE4CrlO1pOvRQs/AbJQaXZCSHEw36llaV9vs3I/+QePaX3DYOTuLjR 9teA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="Xk/UPOnj"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v5si2569559eda.107.2021.01.28.00.35.18; Thu, 28 Jan 2021 00:35:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="Xk/UPOnj"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231905AbhA1Ic7 (ORCPT + 99 others); Thu, 28 Jan 2021 03:32:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231561AbhA1Icw (ORCPT ); Thu, 28 Jan 2021 03:32:52 -0500 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60663C061574 for ; Thu, 28 Jan 2021 00:32:12 -0800 (PST) Received: by mail-pl1-x62f.google.com with SMTP id d13so2941351plg.0 for ; Thu, 28 Jan 2021 00:32:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:content-transfer-encoding:in-reply-to:references :subject:from:cc:to:date:message-id:user-agent; bh=eSzw6mIxV1anumYEd5uTi6KNUqQBP7nI7s0j+BuQJKM=; b=Xk/UPOnjeUnDhjv4/G9R96IxcGex62ZM0aCmu6+KBcioI0KyRor9FkSLKehNdI1fhD MPvKBo8uIUHfnD3cMUyTC1CexCpIB1qD9nMns3IAip6axI7anNm0AISMaZRtu4byPS7n 9MPo01d6pUjclwZOZ4Gzrntxl2HSWvkPMAIic= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:content-transfer-encoding :in-reply-to:references:subject:from:cc:to:date:message-id :user-agent; bh=eSzw6mIxV1anumYEd5uTi6KNUqQBP7nI7s0j+BuQJKM=; b=ZRc9y8XX30fjh+Zw+mSqmQquf/uqw+IjEO8kaUaFZd+++gYxQ4JuAmX/wxBwGh3Lgf JDACWOIAPE/UWP4k0BkpUkp4A/fYIHOMBPVyPLQyz+QKrqvO8QpJVqmwdoUa5N6wiB+X W5V12FkFOmpgQ8phJFgEcAJcC+DhjJ95pijn8wm220Gc6evtiY8zIMHceD6TKlqGF1R0 FfrdNNgSmp2q0dWvRJZZa41yJEg+VK/f9A2HmJeIVrQ2b3bglh+kXez4MstIqUFtfz8K L3c5QOw2ya6BxKypdysAzshF1JzvDVyw3FmgTGFJybCnZzcW35PYkuS6gXlK4rp5cVyq Xgzw== X-Gm-Message-State: AOAM531ffV8ju4ivyjiyDZe+0xaPppIb9WHlaWpbo3+w2BBQpzW6yMOG cZBhKJqIw2ddOUzgEo5PAkRYlw== X-Received: by 2002:a17:90a:ba02:: with SMTP id s2mr10330216pjr.53.1611822731937; Thu, 28 Jan 2021 00:32:11 -0800 (PST) Received: from chromium.org ([2620:15c:202:201:304c:5453:303a:8268]) by smtp.gmail.com with ESMTPSA id w14sm4263307pjl.38.2021.01.28.00.32.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 00:32:11 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: References: <20210122225443.186184-1-swboyd@chromium.org> <20210122225443.186184-4-swboyd@chromium.org> <20210124173820.4528b9c9@archlinux> <161160076017.76967.4467861058817044169@swboyd.mtv.corp.google.com> <161161826068.76967.15170332425672601158@swboyd.mtv.corp.google.com> Subject: Re: [PATCH 3/3] iio: proximity: Add a ChromeOS EC MKBP proximity driver From: Stephen Boyd Cc: Jonathan Cameron , linux-kernel , linux-iio , Dmitry Torokhov , Benson Leung , Guenter Roeck , Douglas Anderson To: Gwendal Grignou Date: Thu, 28 Jan 2021 00:32:09 -0800 Message-ID: <161182272981.76967.6597234301739813412@swboyd.mtv.corp.google.com> User-Agent: alot/0.9.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Gwendal Grignou (2021-01-26 12:59:50) > On Mon, Jan 25, 2021 at 3:44 PM Stephen Boyd wrote: > > > > instead of having to do > > an offset after the fact. For now I'll use ec_dev->last_event_time > > because this is only used on chromeos and that should work until > > userspace is changed, but in the future I think we'll need to have a way > > for this IIO device to be notified when the clock base changes in > > iio_device_set_clock() and then have this driver call into cros_ec to > > request that such a timestamp be made when this event is seen. Or even > > better have a way to request that cros_ec timestamp the event itself on > > the EC side, but I don't know if that's possible. > One way would be use the EC sensor stack that collect such timestamp, > but that would be more firmware changes. >=20 > On second thought, to keep it simple and consistent with other IIO > drivers, I suggest to keep using iio_get_time_ns() when the sensor > clock is not CLOCK_BOOTTIME, ec_dev->last_event_time when it is. Ok I will make that change and send v3.