Commit Graph

1286335 Commits

Author SHA1 Message Date
Kory Maincent
bc5a07ed15 net: net_tstamp: Add unspec field to hwtstamp_source enumeration
Prepare for future support of saving hwtstamp source in PTP xarray by
introducing HWTSTAMP_SOURCE_UNSPEC to hwtstamp_source enum, setting it
to 0 to match old behavior of no source defined.

Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
Link: https://patch.msgid.link/20240709-feature_ptp_netnext-v17-5-b5317f50df2a@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-07-15 08:02:26 -07:00
Kory Maincent
2dd3560059 net: Change the API of PHY default timestamp to MAC
Change the API to select MAC default time stamping instead of the PHY.
Indeed the PHY is closer to the wire therefore theoretically it has less
delay than the MAC timestamping but the reality is different. Due to lower
time stamping clock frequency, latency in the MDIO bus and no PHC hardware
synchronization between different PHY, the PHY PTP is often less precise
than the MAC. The exception is for PHY designed specially for PTP case but
these devices are not very widespread. For not breaking the compatibility
default_timestamp flag has been introduced in phy_device that is set by
the phy driver to know we are using the old API behavior.

Reviewed-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
Link: https://patch.msgid.link/20240709-feature_ptp_netnext-v17-4-b5317f50df2a@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-07-15 08:02:26 -07:00
Rafael J. Wysocki
3fdd8ea39f - Group all Renesas drivers inside a dedicated sub directory and add
the missing dependency to OF (Niklas Söderlund)
 
 - Add suspend/resume support on k3_j72xx_bandgap and take the
   opportunity to remove a unneeded delay in the init time code path
   (Théo Lebrun)
 
 - Fix thermal zone definition for MT8186 and MT8188 (Julien Panis)
 
 - Convert hisilicon-thermal.txt to dt-schema (Abdulrasaq Lawani)
 
 - Add the DT bindings for the X1E80100 temperature sensor (Abel Vesa)
 
 - Fix the thermal zone node name regular expression in the DT schema
   (Krzysztof Kozlowski)
 
 - Take into account some production platforms may not have calibration
   data. Deal with it with a default value instead of failing the
   initialization (Chen-Yu Tsai)
 
 - Fix the sensor cell size on the Exynos platform (Krzysztof Kozlowski)
 
 - Bring the common definition of '#thermal-sensor-cells' property in
   order to simplify the bindings on all the platforms where this
   change makes sense and do some minor cleanups (Krzysztof Kozlowski)
 
 - Fix a race between removal and clock disable on the broadcom driver
   (Krzysztof Kozlowski)
 
 - Drop 'trips' node as required from the thermal zone bindings in
   order to fix the remaining warnings appearing with thermal zone
   whithout trip points defined (Rob Herring)
 
 - Simplify all the drivers where dev_err_probe() can apply (Krzysztof
   Kozlowski)
 
 - Cleanup code related to stih416 as this platform is not described
   anywhere (Raphael Gallais-Pou)
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCAAdFiEEGn3N4YVz0WNVyHskqDIjiipP6E8FAmaVNb8ACgkQqDIjiipP
 6E/eIgf8CJavAB//zBlqpR1aqfz1mkkBXFCpcBsjlMcc1X88eKa5uFvDjhrlYt7F
 lFATC+r2KyXJ6/827/CTYd/GUw1aQwakTV2RfMzXrl/VYkzX/qnZif7Q2TQ1Vcjr
 n+AHxnB5HogtGj5GblGsP4anYJ3li4g2vpbUc2GH6KZdyIGp2UKXEzw3Ap1qujKL
 uw8wb6wUqYMmhoMQsoqhsPPYtpzyqt39AF/DDDZcriM1RwRibBrFpvQQsEzKpW60
 NFDf1QW9gtgcepiMwTGG0EIDy7BJC7I0gY7FlAzvQHMUoZuzZt+vVuLchQX5VH4V
 03jG6N5WPA3sTJw9AwyweDt7CKsi/w==
 =Opek
 -----END PGP SIGNATURE-----

Merge tag 'thermal-v6.11-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/thermal/linux into thermal

Merge thermal drivers updates for 6.11-rc1 from Daniel Lezcano:

"- Group all Renesas drivers inside a dedicated sub directory and add
   the missing dependency to OF (Niklas Söderlund)

 - Add suspend/resume support on k3_j72xx_bandgap and take the
   opportunity to remove a unneeded delay in the init time code path
   (Théo Lebrun)

 - Fix thermal zone definition for MT8186 and MT8188 (Julien Panis)

 - Convert hisilicon-thermal.txt to dt-schema (Abdulrasaq Lawani)

 - Add the DT bindings for the X1E80100 temperature sensor (Abel Vesa)

 - Fix the thermal zone node name regular expression in the DT schema
   (Krzysztof Kozlowski)

 - Take into account some production platforms may not have calibration
   data. Deal with it with a default value instead of failing the
   initialization (Chen-Yu Tsai)

 - Fix the sensor cell size on the Exynos platform (Krzysztof Kozlowski)

 - Bring the common definition of '#thermal-sensor-cells' property in
   order to simplify the bindings on all the platforms where this
   change makes sense and do some minor cleanups (Krzysztof Kozlowski)

 - Fix a race between removal and clock disable on the broadcom driver
   (Krzysztof Kozlowski)

 - Drop 'trips' node as required from the thermal zone bindings in
   order to fix the remaining warnings appearing with thermal zone
   whithout trip points defined (Rob Herring)

 - Simplify all the drivers where dev_err_probe() can apply (Krzysztof
   Kozlowski)

 - Cleanup code related to stih416 as this platform is not described
   anywhere (Raphael Gallais-Pou)"

* tag 'thermal-v6.11-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/thermal/linux: (45 commits)
  thermal/drivers/sti: Cleanup code related to stih416
  thermal/drivers/generic-adc: Simplify with dev_err_probe()
  thermal/drivers/generic-adc: Simplify probe() with local dev variable
  thermal/drivers/qcom-tsens: Simplify with dev_err_probe()
  thermal/drivers/qcom-spmi-adc-tm5: Simplify with dev_err_probe()
  thermal/drivers/imx: Simplify with dev_err_probe()
  thermal/drivers/imx: Simplify probe() with local dev variable
  thermal/drivers/hisi: Simplify with dev_err_probe()
  thermal/drivers/exynos: Simplify with dev_err_probe()
  thermal/drivers/exynos: Simplify probe() with local dev variable
  thermal/drivers/broadcom: Simplify with dev_err_probe()
  thermal/drivers/broadcom: Simplify probe() with local dev variable
  thermal/drivers/broadcom: Fix race between removal and clock disable
  dt-bindings: thermal: Drop 'trips' node as required
  dt-bindings: thermal: qoriq: reference thermal-sensor schema
  dt-bindings: thermal: cleanup examples indentation
  dt-bindings: thermal: simplify few bindings
  dt-bindings: thermal: ti,j72xx: reference thermal-sensor schema
  dt-bindings: thermal: ti,am654: reference thermal-sensor schema
  dt-bindings: thermal: st,stm32: reference thermal-sensor schema
  ...
2024-07-15 16:59:14 +02:00
Marek Behún
49e24c80d3
firmware: turris-mox-rwtm: Initialize completion before mailbox
Initialize the completion before the mailbox channel is requested.

Fixes: 389711b374 ("firmware: Add Turris Mox rWTM firmware driver")
Signed-off-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-07-15 16:57:57 +02:00
Marek Behún
8467cfe821
firmware: turris-mox-rwtm: Fix checking return value of wait_for_completion_timeout()
The wait_for_completion_timeout() function returns 0 if timed out, and a
positive value if completed. Fix the usage of this function.

Fixes: 389711b374 ("firmware: Add Turris Mox rWTM firmware driver")
Fixes: 2eab59cf0d ("firmware: turris-mox-rwtm: fail probing when firmware does not support hwrng")
Signed-off-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-07-15 16:57:48 +02:00
Marek Behún
0bafb172b1
firmware: turris-mox-rwtm: Do not complete if there are no waiters
Do not complete the "command done" completion if there are no waiters.
This can happen if a wait_for_completion() timed out or was interrupted.

Fixes: 389711b374 ("firmware: Add Turris Mox rWTM firmware driver")
Signed-off-by: Marek Behún <kabel@kernel.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2024-07-15 16:57:33 +02:00
Nathan Chancellor
23e88450bb Bluetooth: btmtk: Mark all stub functions as inline
Several recent patches added static stubs to btmtk.h without the inline
keyword, which causes instances of -Wunused-function when those stubs
are not used anywhere in a file that includes the header:

  In file included from drivers/bluetooth/btusb.c:28:
  drivers/bluetooth/btmtk.h:254:13: warning: 'btmtk_fw_get_filename' defined but not used [-Wunused-function]
    254 | static void btmtk_fw_get_filename(char *buf, size_t size, u32 dev_id,
        |             ^~~~~~~~~~~~~~~~~~~~~
  drivers/bluetooth/btmtk.h:249:12: warning: 'btmtk_process_coredump' defined but not used [-Wunused-function]
    249 | static int btmtk_process_coredump(struct hci_dev *hdev, struct sk_buff *skb)
        |            ^~~~~~~~~~~~~~~~~~~~~~
  drivers/bluetooth/btmtk.h:243:12: warning: 'btmtk_register_coredump' defined but not used [-Wunused-function]
    243 | static int btmtk_register_coredump(struct hci_dev *hdev, const char *name,
        |            ^~~~~~~~~~~~~~~~~~~~~~~
  drivers/bluetooth/btmtk.h:233:12: warning: 'btmtk_setup_firmware' defined but not used [-Wunused-function]
    233 | static int btmtk_setup_firmware(struct hci_dev *hdev, const char *fwname,
        |            ^~~~~~~~~~~~~~~~~~~~
  drivers/bluetooth/btmtk.h:227:12: warning: 'btmtk_setup_firmware_79xx' defined but not used [-Wunused-function]
    227 | static int btmtk_setup_firmware_79xx(struct hci_dev *hdev, const char *fwname,
        |            ^~~~~~~~~~~~~~~~~~~~~~~~~

Add inline to all the stubs in btmtk.h (even ones that do not currently
have any warnings associated with them) to ensure there are never unused
function warnings from these stubs, as is customary for the kernel.

Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-15 10:13:17 -04:00
Luiz Augusto von Dentz
84f9288208 Bluetooth: hci_qca: Fix build error
This fixes the following build error introduced by b80f4e3b8c
("Bluetooth: hci_qca: schedule a devm action for disabling the clock"):

drivers/bluetooth/hci_qca.c: In function ‘qca_serdev_remove’:
drivers/bluetooth/hci_qca.c:2501:2: error: label at end of compound statement
 2501 |  default:
      |  ^~~~~~~

Fixes: b80f4e3b8c ("Bluetooth: hci_qca: schedule a devm action for disabling the clock")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-15 10:12:56 -04:00
Bartosz Golaszewski
921ad2879a Bluetooth: hci_qca: use the power sequencer for wcn7850 and wcn6855
In preparation for using the power sequencing subsystem on sm8650 boards
and X13s laptop let's make pwrseq the default for wcn7850 and wcn6855.

Both these models require an enable GPIO so we can safely assume that if
the property is not there, then we should try to get the power
sequencer. Due to how the pwrseq lookup works - checking the provider at
run-time - we cannot really do it the other way around as we'd get stuck
forever on -EPROBE_DEFER.

If the relevant OF node does have the 'enable-gpios' property, we
fallback to the existing code for backward compatibility with older DTs.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-15 10:12:17 -04:00
Bartosz Golaszewski
eba1718717 Bluetooth: hci_qca: make pwrseq calls the default if available
If the device has a power sequencing handle, use it first. Otherwise
fall back to whatever code already exists.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-15 10:12:15 -04:00
Bartosz Golaszewski
b809315771 Bluetooth: hci_qca: unduplicate calls to hci_uart_register_device()
Now that all three branches of the switch end up doing the same thing,
we can move the call to hci_uart_register_device() past it and unify the
error message.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-15 10:12:13 -04:00
Bartosz Golaszewski
b80f4e3b8c Bluetooth: hci_qca: schedule a devm action for disabling the clock
In preparation for unduplicating the hci_uart registration code,
schedule a devres action for disabling the SUSCLK rather than doing it
manually.

We cannot really use devm_clk_get_enabled() as we also set the rate
before enabling the clock. While this should in theory work, I don't
want to risk breaking existing users. One solution for the future is to
add devm_clk_get_enabled_with_rate() to the clock framework.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-15 10:12:10 -04:00
Bartosz Golaszewski
bd3f305886 dt-bindings: bluetooth: qualcomm: describe the inputs from PMU for wcn7850
Drop the inputs from the host and instead expect the Bluetooth node to
consume the outputs of the internal PMU. This model is closer to reality
than how we represent it now.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-15 10:12:08 -04:00
Neeraj Sanjay Kale
3aa7901e44 Bluetooth: btnxpuart: Fix warnings for suspend and resume functions
This fixes the warnings 'nxp_serdev_resume' and 'nxp_serdev_suspend'
defined but not used.

Signed-off-by: Neeraj Sanjay Kale <neeraj.sanjaykale@nxp.com>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202407100518.06Xxq5PK-lkp@intel.com/
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-15 10:12:06 -04:00
Neeraj Sanjay Kale
658c56d5b3 Bluetooth: btnxpuart: Add system suspend and resume handlers
This adds handling for system suspend and resume. While the host enters
suspend state, the driver will drive the chip into low power state.

Similarly when system is resuming, the driver will wake up the chip.

Signed-off-by: Neeraj Sanjay Kale <neeraj.sanjaykale@nxp.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-15 10:12:04 -04:00
Neeraj Sanjay Kale
d4f6acfcb0 Bluetooth: btnxpuart: Add support for IW615 chipset
This adds support for IW615 chipset with it's bootloader signature
and firmware file.

Signed-off-by: Neeraj Sanjay Kale <neeraj.sanjaykale@nxp.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-15 10:12:01 -04:00
Kory Maincent
e50bfd6bb2 net_tstamp: Add TIMESTAMPING SOFTWARE and HARDWARE mask
Timestamping software or hardware flags are often used as a group,
therefore adding these masks will ease future use.

I did not use SOF_TIMESTAMPING_SYS_HARDWARE flag as it is deprecated and
not used at all.

Reviewed-by: Willem de Bruijn <willemb@google.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Signed-off-by: Kory Maincent <kory.maincent@bootlin.com>
Link: https://patch.msgid.link/20240709-feature_ptp_netnext-v17-1-b5317f50df2a@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-07-15 07:11:59 -07:00
Neeraj Sanjay Kale
358534152c Bluetooth: btnxpuart: Add support for AW693 A1 chipset
This adds support for AW693 A1 chipset with it's bootloader signature
and firmware file.

No firmware name change needed for AW693 A0 chipset.

Signed-off-by: Neeraj Sanjay Kale <neeraj.sanjaykale@nxp.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-15 10:11:59 -04:00
Kiran K
f6dc9214e5 Bluetooth: btintel: Add support for Whale Peak2
from /sys/kernel/debug/usb/devices:

T:  Bus=03 Lev=01 Prnt=01 Port=09 Cnt=02 Dev#=  3 Spd=12   MxCh= 0
D:  Ver= 2.00 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=8087 ProdID=0039 Rev= 0.00
C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=81(I) Atr=03(Int.) MxPS=  64 Ivl=1ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms
I:  If#= 1 Alt= 6 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=03(O) Atr=01(Isoc) MxPS=  63 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  63 Ivl=1ms

Signed-off-by: Kiran K <kiran.k@intel.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-15 10:11:57 -04:00
Kiran K
880120d5f1 Bluetooth: btintel: Add support for BlazarU core
Add support for BlazarU core (CNVi).

Signed-off-by: Kiran K <kiran.k@intel.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-15 10:11:55 -04:00
Chris Lu
ceac1cb025 Bluetooth: btusb: mediatek: add ISO data transmission functions
This patch implements functions for ISO data send and receive in btusb
driver for MediaTek's controller.

MediaTek defines a specific interrupt endpoint for ISO data transmissin
because the characteristics of interrupt endpoint are similar to the
application of ISO data which can support guaranteed transmissin
bandwidth, enough maximum data length and error checking mechanism.

Driver sets up ISO interface and endpoints in btusb_mtk_setup and clears
the setup in btusb_mtk_shutdown. These flow can't move to btmtk.c due to
btusb_driver is only defined in btusb.c when claiming/relaesing interface.
ISO packet anchor stops when driver suspending and resubmit interrupt urb
for ISO data when driver resuming.

Signed-off-by: Chris Lu <chris.lu@mediatek.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-15 10:11:52 -04:00
Chris Lu
6dc22ab9f0 Bluetooth: btmtk: move btusb_recv_acl_mtk to btmtk.c
Move btusb_recv_acl_mtk from btusb.c to btmtk.c which holds
vendor specific stuff and would make btusb.c clean.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Chris Lu <chris.lu@mediatek.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-15 10:11:50 -04:00
Chris Lu
5c5e8c52e3 Bluetooth: btmtk: move btusb_mtk_[setup, shutdown] to btmtk.c
Move btusb_mtk_[setup, shutdown] and related function from
btusb.c to btmtk.c which holds vendor specific stuff and
would make btusb.c clean.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Chris Lu <chris.lu@mediatek.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-15 10:11:48 -04:00
Chris Lu
d019930b00 Bluetooth: btmtk: move btusb_mtk_hci_wmt_sync to btmtk.c
Move btusb_mtk_hci_wmt_sync from btusb.c to btmtk.c which holds
vendor specific stuff and would make btusb.c clean.

Add usb.h header to btmtksdio.c/btmtkuart.c for usb related element
defined in btmtk.h

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Chris Lu <chris.lu@mediatek.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-15 10:11:46 -04:00
Chris Lu
95f92928ad Bluetooth: btusb: add callback function in btusb suspend/resume
Add suspend/resum callback function in btusb_data which are reserved
for vendor specific usage during suspend/resume. hdev->suspend will be
added before stop traffic in btusb_suspend and hdev-> resume will be
added after resubmit urb in btusb_resume.

Signed-off-by: Chris Lu <chris.lu@mediatek.com>
Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-15 10:11:44 -04:00
Chris Lu
d3e6236053 Bluetooth: btmtk: rename btmediatek_data
Rename btmediatek_data to have a consistent prefix throughout the driver.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Chris Lu <chris.lu@mediatek.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-15 10:11:42 -04:00
Chris Lu
3dcb122b30 Bluetooth: btusb: mediatek: return error for failed reg access
Update the code to immediately return an error code if accessing a
related register fails. This ensures that our desired logic for
subsequent register operations is maintained and allows us to promptly
catch any unexpected errors.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Chris Lu <chris.lu@mediatek.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-15 10:11:39 -04:00
Chris Lu
be71dfb9ad Bluetooth: btusb: mediatek: remove the unnecessary goto tag
Remove the unnecessary goto tag whether there is an error or not, we have
to free the buffer at the end of the function.

Signed-off-by: Sean Wang <sean.wang@mediatek.com>
Signed-off-by: Chris Lu <chris.lu@mediatek.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-15 10:11:37 -04:00
Luiz Augusto von Dentz
936daee9cf Bluetooth: Remove hci_request.{c,h}
This removes hci_request.{c,h} since it shall no longer be used.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-15 10:11:35 -04:00
Luiz Augusto von Dentz
f2d8977535 Bluetooth: hci_sync: Remove remaining dependencies of hci_request
This removes the dependencies of hci_req_init and hci_request_cancel_all
from hci_sync.c.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-15 10:11:33 -04:00
Luiz Augusto von Dentz
8bedf130c2 Bluetooth: hci_sync: Move handling of interleave_scan
This moves handling of interleave_scan work to hci_sync.c since
hci_request.c is deprecated.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-15 10:11:31 -04:00
Luiz Augusto von Dentz
176cbeceb5 Bluetooth: hci_core: Don't use hci_prepare_cmd
This replaces the instance of hci_prepare_cmd with hci_cmd_sync_alloc
since the former is part of hci_request.c which is considered
deprecated.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-15 10:11:29 -04:00
Luiz Augusto von Dentz
92048ab2e2 Bluetooth: hci_core: Remove usage of hci_req_sync
hci_request functions are considered deprecated so this replaces the
usage of hci_req_sync with hci_inquiry_sync.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-15 10:11:27 -04:00
Rafał Miłecki
88b73fdc81 dt-bindings: net: bluetooth: convert MT7622 Bluetooth to the json-schema
This helps validating DTS files. Introduced changes:
1. Dropped serial details from example
2. Added required example include

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-15 10:11:25 -04:00
Luiz Augusto von Dentz
87be7b189b Bluetooth: Fix usage of __hci_cmd_sync_status
__hci_cmd_sync_status shall only be used if hci_req_sync_lock is _not_
required which is not the case of hci_dev_cmd so it needs to use
hci_cmd_sync_status which uses hci_req_sync_lock internally.

Fixes: f1a8f402f1 ("Bluetooth: L2CAP: Fix deadlock")
Reported-by: Pauli Virtanen <pav@iki.fi>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-15 10:11:23 -04:00
WangYuli
473a89b4ed Bluetooth: btusb: Add Realtek RTL8852BE support ID 0x13d3:0x3591
Add the support ID(0x13d3, 0x3591) to usb_device_id table for
Realtek RTL8852BE.

The device table is as follows:

T:  Bus=01 Lev=02 Prnt=03 Port=00 Cnt=01 Dev#=  5 Spd=12   MxCh= 0
D:  Ver= 1.00 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=13d3 ProdID=3591 Rev= 0.00
S:  Manufacturer=Realtek
S:  Product=Bluetooth Radio
S:  SerialNumber=00e04c000001
C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
I:  If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
I:  If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=03(O) Atr=01(Isoc) MxPS=  17 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  17 Ivl=1ms
I:  If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=03(O) Atr=01(Isoc) MxPS=  25 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  25 Ivl=1ms
I:  If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=03(O) Atr=01(Isoc) MxPS=  33 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  33 Ivl=1ms
I:  If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb
E:  Ad=03(O) Atr=01(Isoc) MxPS=  49 Ivl=1ms
E:  Ad=83(I) Atr=01(Isoc) MxPS=  49 Ivl=1ms

Cc: stable@vger.kernel.org
Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
Signed-off-by: WangYuli <wangyuli@uniontech.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-15 10:11:21 -04:00
Dmitry Antipov
3ba74b2f28 Bluetooth: hci_core: cleanup struct hci_dev
Remove unused and set but otherwise unused 'discovery_old_state'
and 'sco_last_tx' members of 'struct hci_dev'. The first one is
a leftover after commit 182ee45da0 ("Bluetooth: hci_sync: Rework
hci_suspend_notifier"); the second one is originated from ancient
2.4.19 and I was unable to find any actual use since that.

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-15 10:11:19 -04:00
Kiran K
1723b550b6 Bluetooth: btintel: Fix the sfi name for BlazarU
Use INTEL_HW_VARIANT() instead of CNVi Id to decide to load Intermediate
Loader (IML) image. Fix the driver loading incorrect firmware for
BlazarU product.

dmesg:
.....
[146.111834] Bluetooth: hci0: Minimum firmware build 1 week 10 2014
[146.111839] Bluetooth: hci0: Bootloader timestamp 2022.18 buildtype 1 build 16362
[146.111848] Bluetooth: hci0: No support for _PRR ACPI method
[146.112204] Bluetooth: hci0: Failed to load Intel firmware file intel/ibt-0291-0291-iml.sfi (-2)

Fixes: 164c62f958 ("Bluetooth: btintel: Add firmware ID to firmware name")
Reported-by: Tsigan, Vladislav <vladislav.tsigan@intel.com>
Signed-off-by: Kiran K <kiran.k@intel.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-15 10:11:18 -04:00
Bartosz Golaszewski
fb5e4713fc Bluetooth: qca: don't disable power management for QCA6390
We unnecessarily fallthrough the case for QCA6390 when initializing the
device and hit the condition where - due to the lack of the enable-gpio
- we disable power management despite using the power sequencer. We don't
need to look for clocks on this model so it makes more sense to just
register the hci device and break the switch.

Reported-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Fixes: 9a15ce6857 ("Bluetooth: qca: use the power sequencer for QCA6390")
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Acked-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Tested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> # RB5
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-15 10:11:05 -04:00
Krzysztof Kozlowski
b96bac9607 Bluetooth: hci: fix build when POWER_SEQUENCING=m
BT_HCIUART_QCA, which is a bool and an HCI UART component, uses now
power sequencing, so we need to be sure BT_HCIUART_QCA=y and
POWER_SEQUENCING=m cannot happen:

  /usr/bin/aarch64-linux-gnu-ld: drivers/bluetooth/hci_qca.o: in function `qca_serdev_probe':
  drivers/bluetooth/hci_qca.c:2401:(.text+0xc48): undefined reference to `devm_pwrseq_get'
  /usr/bin/aarch64-linux-gnu-ld: drivers/bluetooth/hci_qca.o: in function `qca_power_shutdown':
  drivers/bluetooth/hci_qca.c:2192:(.text+0x29e8): undefined reference to `pwrseq_power_off'
  /usr/bin/aarch64-linux-gnu-ld: drivers/bluetooth/hci_qca.o: in function `qca_power_on':
  drivers/bluetooth/hci_qca.c:1808:(.text+0x3390): undefined reference to `pwrseq_power_on'

Fixes: 9a15ce6857 ("Bluetooth: qca: use the power sequencer for QCA6390")
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-15 10:10:47 -04:00
Paul Menzel
519d849acb Bluetooth: btintel: Fix spelling of *intermediate* in comment
Fixes: f3b845e0ae ("Bluetooth: btintel: Add support to download intermediate loader")
Cc: Kiran K <kiran.k@intel.com>
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-15 10:10:17 -04:00
Bartosz Golaszewski
9a15ce6857 Bluetooth: qca: use the power sequencer for QCA6390
Use the pwrseq subsystem's consumer API to run the power-up sequence for
the Bluetooth module of the QCA6390 package.

Tested-by: Amit Pundir <amit.pundir@linaro.org>
Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8550-QRD, SM8650-QRD & SM8650-HDK
Tested-by: Caleb Connolly <caleb.connolly@linaro.org> # OnePlus 8T
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-15 10:10:15 -04:00
Bartosz Golaszewski
66ef82c66e dt-bindings: net: bluetooth: qualcomm: describe regulators for QCA6390
QCA6390 has a compatible listed in the bindings but is missing the
regulators description. Add the missing supply property and list the
required ones in the allOf section.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
2024-07-15 10:10:14 -04:00
Luiz Augusto von Dentz
f497862d99 Initial implementation of the power sequencing subsystem for linux v6.11
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEFp3rbAvDxGAT0sefEacuoBRx13IFAmZpT80ACgkQEacuoBRx
 13IftRAAq6VS7HWQ07npHeBp1YGuw/+3zjymS4esPoDouhMVeuNpsqqy7Y7JaaZ9
 kLHi0FxdFH2qDZ8ATDqGm8UntORH4ugvXt/bphZiEXh6dFINDCIUmFITx/08MJc3
 t6myhtWQTGgzGWZ+rlYGLPLOXwhQeYp9xNKt5ddQzRtPWuZxYnkwORr8hPlO8CqE
 3XqF1ctf/j6UtQRxZEGLAvvatVlxPEnGxjnVfd7ShavjMvmxhYIAaBS0hg7tbLjx
 M9Q3iXn+n+0/XfCteZ05I4wq//HaQ2BUpUfxOp0kBOXB5BukaUk68xBV55PtG/ZT
 wfK8jtOV3iHV2np0hbRK3TZvqjpD00qRDOZGRGgPM5V6HmxJCvaLBBTC8S7vrwad
 8t+WhXq1XeDVc0qcY3Alo+s3ECOyHsntCAvFywu8iF9unE0lWB6DIW98uOPTXTDM
 z+/VPDi+Wk6NY8LM6BqIXmoST5pjlo8FVytGpkwSG3pSGzFW9kj2sylvp8HvGnmf
 K0u43d5oeTSUvHUH5c5vtSwRgVM4Hcnm4w+tzdnY8rpZiVfuzg0iIVAShPJ1i4Qv
 P2Cw+4+G+sklV9HfYGSQcS203B+qYZfDQ5GqtzA9Pxx2gks2Qokm6mHIAVmlKqEY
 HZC5Dfplq5vLoHuyuS5mPvAC/EgsOjRnTK5qw9j7vCvdheWfosg=
 =Ft39
 -----END PGP SIGNATURE-----

Merge tag 'pwrseq-initial-for-v6.11' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux into HEAD

Initial implementation of the power sequencing subsystem for linux v6.11
2024-07-15 10:09:20 -04:00
Aleksander Jan Bajkowski
9283477e28 net: ethernet: lantiq_etop: remove redundant device name setup
The same name is set when allocating the netdevice structure in the
alloc_etherdev_mq()->alloc_etherrdev_mqs() function. Therefore, there
is no need to manually set it.

This fixes CheckPatch warnings:
WARNING: Prefer strscpy over strcpy - see: https://github.com/KSPP/linux/issues/88
	strcpy(dev->name, "eth%d");

Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
Link: https://patch.msgid.link/20240713170920.863171-1-olek2@wp.pl
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-07-15 07:02:22 -07:00
Jakub Kicinski
c49379dcda Merge branch 'net-dsa-vsc73xx-implement-vlan-operations'
Pawel Dembicki says:

====================
net: dsa: vsc73xx: Implement VLAN operations

This patch series is a result of splitting a larger patch series [0],
where some parts was merged before.

The first patch implements port state configuration, which is required
for bridge functionality. STP frames are not forwarded at this moment.
BPDU frames are only forwarded from/to the PI/SI interface.
For more information, see chapter 2.7.1 (CPU Forwarding) in the
datasheet.

Patches 2, 7-9 and 11 provide a basic implementation of tag_8021q
functionality with QinQ support, without VLAN filtering in
the bridge and simple VLAN awareness in VLAN filtering mode.

Patches 3-6 came from Vladimir Oltean. They prepare for making
tag8021q more common. VSC73XX uses very similar tag recognition,
and some code from tag_sja1105 could be moved to tag_8021q for
common use.

Patch 10 is preparation for use tag_8021q bridge functions as generic
implementation of the 'ds->ops->port_bridge_*()'.

Patch 12 is required to avoid problem with learning on standalone ports.

[0] https://patchwork.kernel.org/project/netdevbpf/list/?series=841034&state=%2A&archive=both
====================

Link: https://patch.msgid.link/20240713211620.1125910-1-paweldembicki@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-07-15 06:55:20 -07:00
Pawel Dembicki
259a7061c2 net: dsa: vsc73xx: start treating the BR_LEARNING flag
This patch implements .port_pre_bridge_flags() and .port_bridge_flags(),
which are required for properly treating the BR_LEARNING flag. Also,
.port_stp_state_set() is tweaked and now disables learning for standalone
ports.

Disabling learning for standalone ports is required to avoid situations
where one port sees traffic originating from another, which could cause
packet drops.

Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Link: https://patch.msgid.link/20240713211620.1125910-13-paweldembicki@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-07-15 06:55:16 -07:00
Pawel Dembicki
6dfaaa2763 net: dsa: vsc73xx: Add bridge support
This patch adds bridge support for the vsc73xx driver.

The vsc73xx requires minimal operations and ithe generic
dsa_tag_8021q_bridge_* API is sufficient.
The forwarding matrix is managed by vsc73xx_port_stp_state_set() ->
vsc73xx_refresh_fwd_map()i routine, which is called immediately after
.port_bridge_join() and .port_bridge_leave().

Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Link: https://patch.msgid.link/20240713211620.1125910-12-paweldembicki@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-07-15 06:55:16 -07:00
Pawel Dembicki
85aabd1fe9 net: dsa: prepare 'dsa_tag_8021q_bridge_join' for standalone use
The 'dsa_tag_8021q_bridge_join' could be used as a generic implementation
of the 'ds->ops->port_bridge_join()' function. However, it is necessary
to synchronize their arguments.

This patch also moves the 'tx_fwd_offload' flag configuration line into
'dsa_tag_8021q_bridge_join' body. Currently, every (sja1105) driver sets
it, and the future vsc73xx implementation will also need it for
simplification.

Suggested-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Link: https://patch.msgid.link/20240713211620.1125910-11-paweldembicki@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-07-15 06:55:16 -07:00
Pawel Dembicki
ce20fdd670 net: dsa: Define max num of bridges in tag8021q implementation
Max number of bridges in tag8021q implementation is strictly limited
by VBID size: 3 bits. But zero is reserved and only 7 values can be used.

This patch adds define which describe maximum possible value.

Suggested-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Link: https://patch.msgid.link/20240713211620.1125910-10-paweldembicki@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-07-15 06:55:16 -07:00