dt-bindings: mtd: ingenic: Use standard ecc-engine property
[linux/fpc-iii.git] / drivers / usb / wusbcore / pal.c
blob30f5691314718aae72ee8b42faa85271e9a97e25
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3 * Wireless USB Host Controller
4 * UWB Protocol Adaptation Layer (PAL) glue.
6 * Copyright (C) 2008 Cambridge Silicon Radio Ltd.
7 */
8 #include "wusbhc.h"
10 static void wusbhc_channel_changed(struct uwb_pal *pal, int channel)
12 struct wusbhc *wusbhc = container_of(pal, struct wusbhc, pal);
14 dev_dbg(wusbhc->dev, "%s: channel = %d\n", __func__, channel);
15 if (channel < 0)
16 wusbhc_stop(wusbhc);
17 else
18 wusbhc_start(wusbhc);
21 /**
22 * wusbhc_pal_register - register the WUSB HC as a UWB PAL
23 * @wusbhc: the WUSB HC
25 int wusbhc_pal_register(struct wusbhc *wusbhc)
27 uwb_pal_init(&wusbhc->pal);
29 wusbhc->pal.name = "wusbhc";
30 wusbhc->pal.device = wusbhc->usb_hcd.self.controller;
31 wusbhc->pal.rc = wusbhc->uwb_rc;
32 wusbhc->pal.channel_changed = wusbhc_channel_changed;
34 return uwb_pal_register(&wusbhc->pal);
37 /**
38 * wusbhc_pal_unregister - unregister the WUSB HC as a UWB PAL
39 * @wusbhc: the WUSB HC
41 void wusbhc_pal_unregister(struct wusbhc *wusbhc)
43 if (wusbhc->uwb_rc)
44 uwb_pal_unregister(&wusbhc->pal);