linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH 1/2] usb: dwc3: add a power supply for current control
       [not found] ` <20210222115149.3606776-2-raychi@google.com>
@ 2021-03-04 17:24   ` Naresh Kamboju
  0 siblings, 0 replies; only message in thread
From: Naresh Kamboju @ 2021-03-04 17:24 UTC (permalink / raw)
  To: Ray Chi, linux-mips, Linux-Next Mailing List
  Cc: Felipe Balbi, Greg Kroah-Hartman, linux-usb, open list, kyletso,
	badhri, lkft-triage

While building linux next 20210304 the following builds failed,
 - mips (cavium_octeon_defconfig) with gcc-8
 - mips (cavium_octeon_defconfig) with gcc-9
 - mips (cavium_octeon_defconfig) with gcc-10

On Mon, 22 Feb 2021 at 17:24, Ray Chi <raychi@google.com> wrote:
>
> Currently, VBUS draw callback does no action when the
> generic PHYs are used. This patch adds an additional
> path to control charging current through power supply
> interface.
>
> Signed-off-by: Ray Chi <raychi@google.com>
> ---
>  drivers/usb/dwc3/core.c | 15 +++++++++++++++
>  drivers/usb/dwc3/core.h |  4 ++++
>  2 files changed, 19 insertions(+)
>
> diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> index f2448d0a9d39..d15f065849cd 100644
> --- a/drivers/usb/dwc3/core.c
> +++ b/drivers/usb/dwc3/core.c
> @@ -1238,6 +1238,8 @@ static void dwc3_get_properties(struct dwc3 *dwc)
>         u8                      rx_max_burst_prd;
>         u8                      tx_thr_num_pkt_prd;
>         u8                      tx_max_burst_prd;
> +       const char              *usb_psy_name;
> +       int                     ret;
>
>         /* default to highest possible threshold */
>         lpm_nyet_threshold = 0xf;
> @@ -1263,6 +1265,13 @@ static void dwc3_get_properties(struct dwc3 *dwc)
>         else
>                 dwc->sysdev = dwc->dev;
>
> +       ret = device_property_read_string(dev, "usb-psy-name", &usb_psy_name);
> +       if (ret >= 0) {
> +               dwc->usb_psy = power_supply_get_by_name(usb_psy_name);
> +               if (!dwc->usb_psy)
> +                       dev_err(dev, "couldn't get usb power supply\n");
> +       }
> +
>         dwc->has_lpm_erratum = device_property_read_bool(dev,
>                                 "snps,has-lpm-erratum");
>         device_property_read_u8(dev, "snps,lpm-nyet-threshold",
> @@ -1619,6 +1628,9 @@ static int dwc3_probe(struct platform_device *pdev)
>  assert_reset:
>         reset_control_assert(dwc->reset);
>
> +       if (!dwc->usb_psy)
> +               power_supply_put(dwc->usb_psy);
> +
>         return ret;
>  }
>
> @@ -1641,6 +1653,9 @@ static int dwc3_remove(struct platform_device *pdev)
>         dwc3_free_event_buffers(dwc);
>         dwc3_free_scratch_buffers(dwc);
>
> +       if (!dwc->usb_psy)
> +               power_supply_put(dwc->usb_psy);

# to reproduce this build locally:

 tuxmake --target-arch=mips --kconfig=cavium_octeon_defconfig
--toolchain=gcc-8 --wrapper=sccache
--environment=SCCACHE_BUCKET=sccache.tuxbuild.com --runtime=podman
--image=public.ecr.aws/tuxmake/mips_gcc-8 config default kernel
xipkernel modules dtbs dtbs-legacy debugkernel headers
make --silent --keep-going --jobs=8
O=/home/tuxbuild/.cache/tuxmake/builds/1/tmp ARCH=mips
CROSS_COMPILE=mips-linux-gnu- 'CC=sccache mips-linux-gnu-gcc'
'HOSTCC=sccache gcc' cavium_octeon_defconfig
make --silent --keep-going --jobs=8
O=/home/tuxbuild/.cache/tuxmake/builds/1/tmp ARCH=mips
CROSS_COMPILE=mips-linux-gnu- 'CC=sccache mips-linux-gnu-gcc'
'HOSTCC=sccache gcc'
kernel/sched/fair.c:8384:13: warning: 'update_nohz_stats' defined but
not used [-Wunused-function]
 static bool update_nohz_stats(struct rq *rq)
             ^~~~~~~~~~~~~~~~~
mips-linux-gnu-ld: drivers/usb/dwc3/core.o: in function `dwc3_remove':
drivers/usb/dwc3/core.c:1657: undefined reference to `power_supply_put'
mips-linux-gnu-ld: drivers/usb/dwc3/core.o: in function `dwc3_get_properties':
drivers/usb/dwc3/core.c:1270: undefined reference to `power_supply_get_by_name'
mips-linux-gnu-ld: drivers/usb/dwc3/core.o: in function `dwc3_probe':
drivers/usb/dwc3/core.c:1632: undefined reference to `power_supply_put'

Build link,
https://gitlab.com/Linaro/lkft/mirrors/next/linux-next/-/jobs/1071668201#L146

-- 
Linaro LKFT
https://lkft.linaro.org

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-04 17:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20210222115149.3606776-1-raychi@google.com>
     [not found] ` <20210222115149.3606776-2-raychi@google.com>
2021-03-04 17:24   ` [PATCH 1/2] usb: dwc3: add a power supply for current control Naresh Kamboju

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).