Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6386795ybx; Mon, 11 Nov 2019 08:21:21 -0800 (PST) X-Google-Smtp-Source: APXvYqzsD+98rfyKxPn52BykuX3GdyZePh6whgHbBCJOmTddSg6TCG30jlw/Ze1/fu13fBN9qhBX X-Received: by 2002:aa7:dbd4:: with SMTP id v20mr27920795edt.58.1573489281572; Mon, 11 Nov 2019 08:21:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573489281; cv=none; d=google.com; s=arc-20160816; b=vqjFQMsafloBzIc7zBOMltIRq4HdNRk9PfacVIUXKZMQZSJKlvAe2RW6F5BETTL/ms buni0OYsGNqe0DFeZ6P7To4adtlp9XgabomjVIn0nJ3VERFLqu5cVZpj0TR3Eq8ucltq 1Zxaoo4dkvqmPraKlFeVtRuqT3NiMy6jWTdn1fDfZVvuOEliSY6o6GMwDhrjVie7EAia ZeN6LfRd78wM4ERVB2zGJugVF0412e2gZ9JF2B9qlyhejlghRxULQg/CQEu6S8kH/k7d nlpi1MyccsZljofNU+zc6eYss9MKI28e/Q/x6EG4pPSJCjYY+5dCJ5eVEDCeLFq+Bo72 UeQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Viwlbj65nn8ReJJEw6TxEivw66vJa2K9DgN6wFoU/mc=; b=YG8fro2RwzLhKyylYYZC6khz8pFQesvmAS1lEdTYSUzez1vBUEC3oL79+Adcz7IE8R Qe/ux7WkYzPcHbR1gzhrF+jh92pvfJoo73jtvsYXExEfH8Eb81wmRSJwMdwW+vGFLoIW QSWlFVytnGD9sDm46leQyQr7idwuKhWyoBQTME+nl90sOWMexue9/P+CHN+zD+byp+0V 9lv4yj1Wd3BV1XIRvO7XVubOvBQ2T9SJ6Vq0fVxE5XG8QDzvmAcVMoyNGpcmeEtt7ThU HQRYf10aPWMhv4ATts8GQIqLBmtnU81HPBXIWb0kYiK3HJ6NdiSmTlQ32Uz21tq43cx+ vptA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=T8mQfy3o; 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=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n12si4648506edi.235.2019.11.11.08.20.57; Mon, 11 Nov 2019 08:21:21 -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=@chromium.org header.s=google header.b=T8mQfy3o; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726910AbfKKQUF (ORCPT + 99 others); Mon, 11 Nov 2019 11:20:05 -0500 Received: from mail-ed1-f67.google.com ([209.85.208.67]:46095 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726871AbfKKQUF (ORCPT ); Mon, 11 Nov 2019 11:20:05 -0500 Received: by mail-ed1-f67.google.com with SMTP id x11so12338974eds.13 for ; Mon, 11 Nov 2019 08:20:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Viwlbj65nn8ReJJEw6TxEivw66vJa2K9DgN6wFoU/mc=; b=T8mQfy3o88S9x/rjMBJZpXojbwQWJ1vmdC6bMJXLDd2MMVtkgJaPFbygqiOQx5HDGh h/WGoCbh5AbAby6bOoKq4twLvdYTks8rs14AsTlYBHBn8oNTL9ZwjPNTDcmLk68iraVV mOQO9GL59RXqC2bjR0JkTmoB5vpyfhLZS+PpU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Viwlbj65nn8ReJJEw6TxEivw66vJa2K9DgN6wFoU/mc=; b=st0dKue88vgO0+QfVV+peLjUORJk5kpcylkEu5KSnETyZ31dZOZeO/ZyVSRit8n4kA S7mYpgrMq3Th/cbZSnQHZJKb6gglWejCv7yRtu5n/B1duZTcjKKqBipJpL42N+SCumH0 vYgqgJcw4AmXf7ezGTBMcPicIUTCJm/5o4dWej3XpJ+LvF61gzaBEt5ksMjZ66aNuW07 XA2P4hv3Cc7gBLMCJiGweGKxhVpRY26h435mZFuL6Ou7JqYP2WEQs2C3UhxQ7obi1XVt m0DKv/R/FVC2mwxQ+O4yPHUCqoD04i4YpRqDfI2Q0NL/qINrbYam5F75HddTYfaiMkKp 7q4g== X-Gm-Message-State: APjAAAWsMYLu9co1N2wD1HuQAeroI+nqal/9RrqSJdXxeb4LIpRvZZRK Obd4h0rH0q24ohLKn6+kRPZwUdaS65s= X-Received: by 2002:a17:906:70e:: with SMTP id y14mr23249722ejb.70.1573489203040; Mon, 11 Nov 2019 08:20:03 -0800 (PST) Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com. [209.85.221.42]) by smtp.gmail.com with ESMTPSA id z69sm511290ede.88.2019.11.11.08.20.01 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 Nov 2019 08:20:02 -0800 (PST) Received: by mail-wr1-f42.google.com with SMTP id z10so9984023wrs.12 for ; Mon, 11 Nov 2019 08:20:01 -0800 (PST) X-Received: by 2002:adf:f20d:: with SMTP id p13mr20546287wro.325.1573489201369; Mon, 11 Nov 2019 08:20:01 -0800 (PST) MIME-Version: 1.0 References: <20191111161431.26293-1-akshu.agrawal@amd.com> In-Reply-To: <20191111161431.26293-1-akshu.agrawal@amd.com> From: Raul Rangel Date: Mon, 11 Nov 2019 09:19:50 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] i2c: i2c-cros-ec-tunnel: Make the device acpi compatible To: Akshu Agrawal Cc: cychiang@chromium.org, Benson Leung , Enric Balletbo i Serra , Guenter Roeck , Wolfram Sang , Mark Brown , Neil Armstrong , "open list:I2C SUBSYSTEM HOST DRIVERS" , open list Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 11, 2019 at 9:15 AM Akshu Agrawal wrote: > > Add ACPI entry and use device_property_read to get fw value > which is common to both dtsi and acpi. > > Signed-off-by: Akshu Agrawal > --- > drivers/i2c/busses/i2c-cros-ec-tunnel.c | 15 ++++++++++----- > 1 file changed, 10 insertions(+), 5 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-cros-ec-tunnel.c b/drivers/i2c/busses/i2c-cros-ec-tunnel.c > index c551aa96a2e3..958161c71985 100644 > --- a/drivers/i2c/busses/i2c-cros-ec-tunnel.c > +++ b/drivers/i2c/busses/i2c-cros-ec-tunnel.c > @@ -3,6 +3,7 @@ > // > // Copyright (C) 2013 Google, Inc. > > +#include > #include > #include > #include > @@ -240,7 +241,6 @@ static const struct i2c_algorithm ec_i2c_algorithm = { > > static int ec_i2c_probe(struct platform_device *pdev) > { > - struct device_node *np = pdev->dev.of_node; > struct cros_ec_device *ec = dev_get_drvdata(pdev->dev.parent); > struct device *dev = &pdev->dev; > struct ec_i2c_device *bus = NULL; > @@ -256,7 +256,7 @@ static int ec_i2c_probe(struct platform_device *pdev) > if (bus == NULL) > return -ENOMEM; > > - err = of_property_read_u32(np, "google,remote-bus", &remote_bus); > + err = device_property_read_u32(dev, "google,remote-bus", &remote_bus); > if (err) { > dev_err(dev, "Couldn't read remote-bus property\n"); > return err; > @@ -271,7 +271,7 @@ static int ec_i2c_probe(struct platform_device *pdev) > bus->adap.algo = &ec_i2c_algorithm; > bus->adap.algo_data = bus; > bus->adap.dev.parent = &pdev->dev; > - bus->adap.dev.of_node = np; > + bus->adap.dev.of_node = pdev->dev.of_node; > bus->adap.retries = I2C_MAX_RETRIES; > > err = i2c_add_adapter(&bus->adap); > @@ -291,19 +291,24 @@ static int ec_i2c_remove(struct platform_device *dev) > return 0; > } > > -#ifdef CONFIG_OF > static const struct of_device_id cros_ec_i2c_of_match[] = { > { .compatible = "google,cros-ec-i2c-tunnel" }, > {}, > }; > MODULE_DEVICE_TABLE(of, cros_ec_i2c_of_match); > -#endif > + > +static const struct acpi_device_id cros_ec_i2c_tunnel_acpi_id[] = { > + { "GOOG001A", 0 }, > + { } > +}; > +MODULE_DEVICE_TABLE(acpi, cros_ec_i2c_tunnel_acpi_id); > > static struct platform_driver ec_i2c_tunnel_driver = { > .probe = ec_i2c_probe, > .remove = ec_i2c_remove, > .driver = { > .name = "cros-ec-i2c-tunnel", > + .acpi_match_table = ACPI_PTR(cros_ec_i2c_tunnel_acpi_id), > .of_match_table = of_match_ptr(cros_ec_i2c_of_match), > }, > }; > -- > 2.17.1 > Acked-by: Raul E Rangel