Re: [PATCH v7 1/3] platform: chrome: Add cros-usbpd-notify driver

Prashant Malani
2020-01-24T21:53:07Z

Hi Enric

(removed lot of the context text to keep the message length small)
> > So, in summary, my proposed additions to the edits you suggested are:
> > - Remove IS_ENABLED(CONFIG_OF)... checks from
> > cros_usbpd_notify_probe_plat() and cros_usbpd_notify_remove_plat()
> > - Change check in cros_ec_dev to be:
> > if (IS_ENABLED(CONFIG_OF) && ec->ec_dev->dev->of_node)
> >
> > WDYT? Could you kindly try this on your kevin configuration? I've
> > tried it for the cases "CONFIG_OF && !CONFIG_ACPI" and "!CONFIG_OF &&
> > CONFIG_ACPI" but not the third one (CONFIG_OF && CONFIG_ACPI) since I
> > don't have an environment to test with (I can confirm it builds).
> >
> > Thanks as always for helping iterate on this.
> >
> >
>
> Let's continue talking with a new version. Could you send another one and I can
> check. I have now setup both systems one with ACPi and another one with OF.
Sounds good. Will push a new version. Thanks.
>
> Thanks,
> Enric
>
>
> >> if (cros_ec_check_features(ec, EC_FEATURE_USB_PD)) {
> >> retval = mfd_add_hotplug_devices(ec->dev,
> >> cros_usbpd_notify_cells,
> >>
> >>
> >>> diff --git a/include/linux/platform_data/cros_usbpd_notify.h b/include/linux/platform_data/cros_usbpd_notify.h
> >>> new file mode 100644
> >>> index 0000000000000..4f2791722b6d3
> >>> --- /dev/null
> >>> +++ b/include/linux/platform_data/cros_usbpd_notify.h
> >>> @@ -0,0 +1,17 @@
> >>> +// SPDX-License-Identifier: GPL-2.0-only
> >>> +/*
> >>> + * ChromeOS EC Power Delivery Notifier Driver
> >>> + *
> >>> + * Copyright 2020 Google LLC
> >>> + */
> >>> +
> >>> +#ifndef __LINUX_PLATFORM_DATA_CROS_USBPD_NOTIFY_H
> >>> +#define __LINUX_PLATFORM_DATA_CROS_USBPD_NOTIFY_H
> >>> +
> >>> +#include <linux/notifier.h>
> >>> +
> >>> +int cros_usbpd_register_notify(struct notifier_block *nb);
> >>> +
> >>> +void cros_usbpd_unregister_notify(struct notifier_block *nb);
> >>> +
> >>> +#endif /* __LINUX_PLATFORM_DATA_CROS_USBPD_NOTIFY_H */
> >>>
> >>
> >> Cheers,
> >> Enric