Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17969916ybl; Thu, 2 Jan 2020 15:54:44 -0800 (PST) X-Google-Smtp-Source: APXvYqy5O9M45t3E3TuGHKYVm/jQU8QGoI1A+Neo6lYCUaltCTBBsSS4e6t1L6RiONqY/njFA4Es X-Received: by 2002:a9d:768b:: with SMTP id j11mr94429485otl.116.1578009284791; Thu, 02 Jan 2020 15:54:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578009284; cv=none; d=google.com; s=arc-20160816; b=EE9deVkaHxY5r7RkL7NpnzSHmE2tKq2rpYJkWriR96PN0iOTYQyLbhUgJeRbl3rFkK 8XAkoP7BcJIpIWgWnVHTLgiexlTELU2VGnYtbBj4PVuSsvVJZGbYvkiKivnE2L2zacgI kdIz0cBSBwqf3mUxuEoi+qUHqU3JW/pQEjWboF4V/Y5Mz+1WJj2aX65NBNqvcbTyjp0J Ka3NCQN4N6Ko/Ud2YnKAFLTQliDnaRHF6CIPdbkC2XiIycfU7IRT6tMavt1slIMlV1SS QyY2fomkRaeEE15+jSTjf80FsM/PAzg5X2+BzBhyISyIABLdedI+x6OBQfp+8qDrrh1I fNqg== 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=EAjgcYRwwQLEHNJXsVZFmFh/vkYMti29PfuD05RdzD0=; b=ELR42o6Wqayer2UWQqw8sTUIyGXzGmM0xc+d94UudqZjPC7dwFySrlRnEKHxtfVsej uhTahptNxr4NOl4Ak7Hvgwhh+dqepuCs+CPMUAPUMEvc9jPfSUtStT/+7iP66rpoKMZh /FqOxSNolNFn/VUa1Acixa5Dp6lWZgez/3vcwgy9xNVMSzaxfc77dqJND4Dii4IHiFwa VDme7FJl2/4IQCsuNuDlkXIb0cCUovqjP2CeOVVEnb7+HX85EKMcQaK6Xk7sRP8zRy6X lieKPHzy4Pdkk1AN7Gu4zaX79Ppqtz2Pa3/uxJoYs/gLAlh+PHi8ckC0UCAJ2ZvEutbm E2dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jEu9P5kd; 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 w23si29085173oti.39.2020.01.02.15.54.31; Thu, 02 Jan 2020 15:54:44 -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=jEu9P5kd; 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 S1727303AbgABXwh (ORCPT + 99 others); Thu, 2 Jan 2020 18:52:37 -0500 Received: from mail-qk1-f193.google.com ([209.85.222.193]:39025 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725872AbgABXwg (ORCPT ); Thu, 2 Jan 2020 18:52:36 -0500 Received: by mail-qk1-f193.google.com with SMTP id c16so32605543qko.6 for ; Thu, 02 Jan 2020 15:52:36 -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=EAjgcYRwwQLEHNJXsVZFmFh/vkYMti29PfuD05RdzD0=; b=jEu9P5kd46ah9fO74PUFMW8yKnRpnQKJTQZ3VjFdpjiEoLMpHo73b4PHD6WnotAdfw 5nag/gjhyWUKjJm0dIqjMmuiZoywq4AvW2AiMzfoxP2I8FDZ+F8Jce+edDOdkqoUS4qD Iyxrk6J0A6UBLqpU4MvNGyqUaG72ZTXlgLYmY= 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=EAjgcYRwwQLEHNJXsVZFmFh/vkYMti29PfuD05RdzD0=; b=nF6g0CTiyDN/PKciBi2oAaRELcr1V0kRcWoeqi6d1RwHSL21IUkvi7xB9L4mXqQFJk GxksktMPFOgIWCWDU0vNJ/no+IgPTGi0Nm8pbnL9Pj0IVlugHrw3i4hNR0D6aGUGrYQd 994RZbrj/ye0nOGWW90i9Bl8tkPSc+ZfSnSVXbgrACp9SXFwyHyh6Wn1o8agwGayavwc wbI6KWWQ86m+OAKG/uHh6VCPl8eLYY0WAX+V2MHrtBsBpQY/n168QiPcPQgaPEZW9HFu TgiA7ZMhRAnW0NpImzVVWlLMPF7AuYlPqPcguvzt6CqTdg989T3RWB/Jkyyxd/6e2s13 wWag== X-Gm-Message-State: APjAAAVt58daNGGSVj0vHIxuQex/pSZSjcbcmMI39Cu7TJsTcqCG8I86 XyPNfHp4PlUBfHfRwxdl6VRAHTAhVYOxW2DB9DICjkpNL9o= X-Received: by 2002:a05:620a:1114:: with SMTP id o20mr67810505qkk.128.1578009155332; Thu, 02 Jan 2020 15:52:35 -0800 (PST) MIME-Version: 1.0 References: <20191220193843.47182-1-pmalani@chromium.org> <20191220193843.47182-2-pmalani@chromium.org> <7eecafb2-4686-b448-2837-4181188365b1@collabora.com> In-Reply-To: From: Prashant Malani Date: Thu, 2 Jan 2020 15:52:24 -0800 Message-ID: Subject: Re: [PATCH v4 2/2] mfd: cros_ec: Add cros-usbpd-notify subdevice To: Enric Balletbo i Serra Cc: Guenter Roeck , Benson Leung , Lee Jones , Linux Kernel Mailing 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 Hi Enric, On Mon, Dec 23, 2019 at 12:29 PM Prashant Malani wrote: > > Hi Enric, > > On Sun, Dec 22, 2019 at 11:25 PM Enric Balletbo i Serra > wrote: > > > > Hi Prashant, > > > > On 20/12/19 20:38, Prashant Malani wrote: > > > Add the cros-usbpd-notify driver as a subdevice on non-ACPI platforms > > > that support the EC_FEATURE_USB_PD EC feature flag. > > > > > > This driver allows other cros-ec devices to receive PD event > > > notifications from the Chrome OS Embedded Controller (EC) via a > > > notification chain. > > > > > > Signed-off-by: Prashant Malani > > > --- > > > > > > Changes in v4: > > > - Removed #ifndef usage; instead, moved cros-usbpd-notify to a separate > > > mfd_cell and used an IS_ENABLED() check. > > > - Changed commit title and description slightly to reflect change in > > > code. > > > > > > drivers/mfd/cros_ec_dev.c | 21 +++++++++++++++++++++ > > > 1 file changed, 21 insertions(+) > > > > > > diff --git a/drivers/mfd/cros_ec_dev.c b/drivers/mfd/cros_ec_dev.c > > > index c4b977a5dd966..da198abe2b0a6 100644 > > > --- a/drivers/mfd/cros_ec_dev.c > > > +++ b/drivers/mfd/cros_ec_dev.c > > > @@ -5,6 +5,7 @@ > > > * Copyright (C) 2014 Google, Inc. > > > */ > > > > > > +#include > > > #include > > > #include > > > #include > > > @@ -87,6 +88,10 @@ static const struct mfd_cell cros_usbpd_charger_cells[] = { > > > { .name = "cros-usbpd-logger", }, > > > }; > > > > > > +static const struct mfd_cell cros_usbpd_notify_cells[] = { > > > + { .name = "cros-usbpd-notify", }, > > > +}; > > > + > > > static const struct cros_feature_to_cells cros_subdevices[] = { > > > { > > > .id = EC_FEATURE_CEC, > > > @@ -202,6 +207,22 @@ static int ec_device_probe(struct platform_device *pdev) > > > } > > > } > > > > > > + /* > > > + * The PD notifier driver cell is separate since it only needs to be > > > + * explicitly added on non-ACPI platforms. > > > > > > Sorry to not catch this before, but a worry arose. Is non-ACPI platforms or > > non-X86 platforms or on OF platforms? > > > > ARM64 for example has the CONFIG_ACPI symbol set to yes, with the below > > condition condition will not work on Kevin for example and IIUC this is not what > > we want, I think we want IS_ENABLED(CONFIG_OF)? > Thanks for noting this. I will check with a kevin, and with the > internal build flags to verify whether there are ARM64 which have the > GOOG0003 PD notification device. > I'll update this thread with my findings. AFAICT from the Chrome OS kernel build step .config output, kevin doesn't have CONFIG_ACPI enabled (it is marked as "# CONFIG_ACPI is not set"), and it doesn't look like there are Chrome OS ARM devices that use ACPI (I believe it's only used on Chrome OS x86-based devices). So perhaps it is not a concern? > > Best, > > > > > Thanks, > > Enric > > > > > + */ > > > + if (!IS_ENABLED(CONFIG_ACPI)) { > > > + if (cros_ec_check_features(ec, EC_FEATURE_USB_PD)) { > > > + retval = mfd_add_hotplug_devices(ec->dev, > > > + cros_usbpd_notify_cells, > > > + ARRAY_SIZE(cros_usbpd_notify_cells)); > > > + if (retval) > > > + dev_err(ec->dev, > > > + "failed to add PD notify devices: %d\n", > > > + retval); > > > + } > > > + } > > > + > > > /* > > > * The following subdevices cannot be detected by sending the > > > * EC_FEATURE_GET_CMD to the Embedded Controller device. > > >