]> Git Repo - J-linux.git/commitdiff
Add bridged amplifiers to cs42l43
authorMark Brown <[email protected]>
Wed, 17 Apr 2024 00:12:19 +0000 (09:12 +0900)
committerMark Brown <[email protected]>
Wed, 17 Apr 2024 00:12:19 +0000 (09:12 +0900)
Merge series from Charles Keepax <[email protected]>:

In some cs42l43 systems a couple of cs35l56 amplifiers are attached
to the cs42l43's SPI and I2S. On Windows the cs42l43 is controlled
by a SDCA class driver and these two amplifiers are controlled by
firmware running on the cs42l43. However, under Linux the decision
was made to interact with the cs42l43 directly, affording the user
greater control over the audio system. However, this has resulted
in an issue where these two bridged cs35l56 amplifiers are not
populated in ACPI and must be added manually. There is at least an
SDCA extension unit DT entry we can key off.

The process of adding this is handled using a software node, firstly the
ability to add native chip selects to software nodes must be added.
Secondly, an additional flag for naming the SPI devices is added this
allows the machine driver to key to the correct amplifier. Then finally,
the cs42l43 SPI driver adds the two amplifiers directly onto its SPI
bus.

An additional series will follow soon to add the audio machine driver
parts (in the sof-sdw driver), however that is fairly orthogonal to
this part of the process, getting the actual amplifiers registered.

1  2 
MAINTAINERS
drivers/spi/Kconfig
drivers/spi/spi.c

diff --combined MAINTAINERS
index 7fce3c646cef6060ef5a4f41cc3ea44bd798d482,aea47e04c3a52aa6774a090c2bd17555306c4a02..2b63ed1145323cb7b9ae9c091d8bb826a87e91b3
@@@ -3942,8 -3942,7 +3942,7 @@@ F:      kernel/bpf/ringbuf.
  
  BPF [SECURITY & LSM] (Security Audit and Enforcement using BPF)
  M:    KP Singh <[email protected]>
- R:    Florent Revest <[email protected]>
- R:    Brendan Jackman <[email protected]>
+ R:    Matt Bobrowski <[email protected]>
  L:    [email protected]
  S:    Maintained
  F:    Documentation/bpf/prog_lsm.rst
@@@ -3968,7 -3967,7 +3967,7 @@@ F:      kernel/bpf/bpf_lru
  F:    kernel/bpf/cgroup.c
  
  BPF [TOOLING] (bpftool)
- M:    Quentin Monnet <q[email protected]>
+ M:    Quentin Monnet <q[email protected]>
  L:    [email protected]
  S:    Maintained
  F:    kernel/bpf/disasm.*
@@@ -6157,7 -6156,6 +6156,6 @@@ DEVICE-MAPPER  (LVM
  M:    Alasdair Kergon <[email protected]>
  M:    Mike Snitzer <[email protected]>
  M:    Mikulas Patocka <[email protected]>
- M:    [email protected]
  L:    [email protected]
  S:    Maintained
  Q:    http://patchwork.kernel.org/project/dm-devel/list/
@@@ -6173,7 -6171,6 +6171,6 @@@ F:      include/uapi/linux/dm-*.
  
  DEVICE-MAPPER VDO TARGET
  M:    Matthew Sakai <[email protected]>
- M:    [email protected]
  L:    [email protected]
  S:    Maintained
  F:    Documentation/admin-guide/device-mapper/vdo*.rst
@@@ -7941,6 -7938,7 +7938,7 @@@ M:      Gao Xiang <[email protected]
  M:    Chao Yu <[email protected]>
  R:    Yue Hu <[email protected]>
  R:    Jeffle Xu <[email protected]>
+ R:    Sandeep Dhavale <[email protected]>
  L:    [email protected]
  S:    Maintained
  W:    https://erofs.docs.kernel.org
@@@ -9653,7 -9651,9 +9651,9 @@@ L:      [email protected]
  S:    Maintained
  F:    drivers/hid/hid-logitech-hidpp.c
  
- HIGH-RESOLUTION TIMERS, CLOCKEVENTS
+ HIGH-RESOLUTION TIMERS, TIMER WHEEL, CLOCKEVENTS
+ M:    Anna-Maria Behnsen <[email protected]>
+ M:    Frederic Weisbecker <[email protected]>
  M:    Thomas Gleixner <[email protected]>
  L:    [email protected]
  S:    Maintained
@@@ -9661,9 -9661,13 +9661,13 @@@ T:    git git://git.kernel.org/pub/scm/lin
  F:    Documentation/timers/
  F:    include/linux/clockchips.h
  F:    include/linux/hrtimer.h
+ F:    include/linux/timer.h
  F:    kernel/time/clockevents.c
  F:    kernel/time/hrtimer.c
- F:    kernel/time/timer_*.c
+ F:    kernel/time/timer.c
+ F:    kernel/time/timer_list.c
+ F:    kernel/time/timer_migration.*
+ F:    tools/testing/selftests/timers/
  
  HIGH-SPEED SCC DRIVER FOR AX.25
  L:    [email protected]
@@@ -13134,6 -13138,7 +13138,7 @@@ F:   drivers/net/ethernet/marvell/mvpp2
  
  MARVELL MWIFIEX WIRELESS DRIVER
  M:    Brian Norris <[email protected]>
+ R:    Francesco Dolcini <[email protected]>
  L:    [email protected]
  S:    Odd Fixes
  F:    drivers/net/wireless/marvell/mwifiex/
@@@ -14014,6 -14019,7 +14019,7 @@@ F:   drivers/net/ethernet/mellanox/mlx4/e
  
  MELLANOX ETHERNET DRIVER (mlx5e)
  M:    Saeed Mahameed <[email protected]>
+ M:    Tariq Toukan <[email protected]>
  L:    [email protected]
  S:    Supported
  W:    http://www.mellanox.com
@@@ -14081,6 -14087,7 +14087,7 @@@ F:   include/uapi/rdma/mlx4-abi.
  MELLANOX MLX5 core VPI driver
  M:    Saeed Mahameed <[email protected]>
  M:    Leon Romanovsky <[email protected]>
+ M:    Tariq Toukan <[email protected]>
  L:    [email protected]
  L:    [email protected]
  S:    Supported
@@@ -15627,9 -15634,10 +15634,10 @@@ F: drivers/misc/nsm.
  F:    include/uapi/linux/nsm.h
  
  NOHZ, DYNTICKS SUPPORT
+ M:    Anna-Maria Behnsen <[email protected]>
  M:    Frederic Weisbecker <[email protected]>
- M:    Thomas Gleixner <[email protected]>
  M:    Ingo Molnar <[email protected]>
+ M:    Thomas Gleixner <[email protected]>
  L:    [email protected]
  S:    Maintained
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/nohz
@@@ -16725,9 -16733,9 +16733,9 @@@ F:   include/uapi/linux/ppdev.
  
  PARAVIRT_OPS INTERFACE
  M:    Juergen Gross <[email protected]>
- R:    Ajay Kaher <akaher@vmware.com>
- R:    Alexey Makhalov <amakhalov@vmware.com>
- R:    VMware PV-Drivers Reviewers <pv-drivers@vmware.com>
+ R:    Ajay Kaher <ajay.kaher@broadcom.com>
+ R:    Alexey Makhalov <alexey.amakhalov@broadcom.com>
+ R:    Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
  L:    [email protected]
  L:    [email protected]
  S:    Supported
@@@ -17590,15 -17598,20 +17598,20 @@@ F:        drivers/pnp
  F:    include/linux/pnp.h
  
  POSIX CLOCKS and TIMERS
+ M:    Anna-Maria Behnsen <[email protected]>
+ M:    Frederic Weisbecker <[email protected]>
  M:    Thomas Gleixner <[email protected]>
  L:    [email protected]
  S:    Maintained
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/core
  F:    fs/timerfd.c
  F:    include/linux/time_namespace.h
- F:    include/linux/timer*
+ F:    include/linux/timerfd.h
+ F:    include/uapi/linux/time.h
+ F:    include/uapi/linux/timerfd.h
  F:    include/trace/events/timer*
- F:    kernel/time/*timer*
+ F:    kernel/time/itimer.c
+ F:    kernel/time/posix-*
  F:    kernel/time/namespace.c
  
  POWER MANAGEMENT CORE
@@@ -18645,18 -18658,21 +18658,21 @@@ REALTEK WIRELESS DRIVER (rtlwifi family
  M:    Ping-Ke Shih <[email protected]>
  L:    [email protected]
  S:    Maintained
+ T:    git https://github.com/pkshih/rtw.git
  F:    drivers/net/wireless/realtek/rtlwifi/
  
  REALTEK WIRELESS DRIVER (rtw88)
  M:    Ping-Ke Shih <[email protected]>
  L:    [email protected]
  S:    Maintained
+ T:    git https://github.com/pkshih/rtw.git
  F:    drivers/net/wireless/realtek/rtw88/
  
  REALTEK WIRELESS DRIVER (rtw89)
  M:    Ping-Ke Shih <[email protected]>
  L:    [email protected]
  S:    Maintained
+ T:    git https://github.com/pkshih/rtw.git
  F:    drivers/net/wireless/realtek/rtw89/
  
  REDPINE WIRELESS DRIVER
@@@ -18727,13 -18743,24 +18743,24 @@@ S:        Supporte
  F:    Documentation/devicetree/bindings/i2c/renesas,iic-emev2.yaml
  F:    drivers/i2c/busses/i2c-emev2.c
  
- RENESAS ETHERNET DRIVERS
+ RENESAS ETHERNET AVB DRIVER
  R:    Sergey Shtylyov <[email protected]>
  L:    [email protected]
  L:    [email protected]
- F:    Documentation/devicetree/bindings/net/renesas,*.yaml
- F:    drivers/net/ethernet/renesas/
- F:    include/linux/sh_eth.h
+ F:    Documentation/devicetree/bindings/net/renesas,etheravb.yaml
+ F:    drivers/net/ethernet/renesas/Kconfig
+ F:    drivers/net/ethernet/renesas/Makefile
+ F:    drivers/net/ethernet/renesas/ravb*
+ RENESAS ETHERNET SWITCH DRIVER
+ R:    Yoshihiro Shimoda <[email protected]>
+ L:    [email protected]
+ L:    [email protected]
+ F:    Documentation/devicetree/bindings/net/renesas,*ether-switch.yaml
+ F:    drivers/net/ethernet/renesas/Kconfig
+ F:    drivers/net/ethernet/renesas/Makefile
+ F:    drivers/net/ethernet/renesas/rcar_gen4*
+ F:    drivers/net/ethernet/renesas/rswitch*
  
  RENESAS IDT821034 ASoC CODEC
  M:    Herve Codina <[email protected]>
@@@ -18843,6 -18870,16 +18870,16 @@@ S: Supporte
  F:    Documentation/devicetree/bindings/i2c/renesas,rzv2m.yaml
  F:    drivers/i2c/busses/i2c-rzv2m.c
  
+ RENESAS SUPERH ETHERNET DRIVER
+ R:    Sergey Shtylyov <[email protected]>
+ L:    [email protected]
+ L:    [email protected]
+ F:    Documentation/devicetree/bindings/net/renesas,ether.yaml
+ F:    drivers/net/ethernet/renesas/Kconfig
+ F:    drivers/net/ethernet/renesas/Makefile
+ F:    drivers/net/ethernet/renesas/sh_eth*
+ F:    include/linux/sh_eth.h
  RENESAS USB PHY DRIVER
  M:    Yoshihiro Shimoda <[email protected]>
  L:    [email protected]
@@@ -19179,12 -19216,14 +19216,14 @@@ M:        Hin-Tak Leung <[email protected]
  M:    Larry Finger <[email protected]>
  L:    [email protected]
  S:    Maintained
+ T:    git https://github.com/pkshih/rtw.git
  F:    drivers/net/wireless/realtek/rtl818x/rtl8187/
  
  RTL8XXXU WIRELESS DRIVER (rtl8xxxu)
  M:    Jes Sorensen <[email protected]>
  L:    [email protected]
  S:    Maintained
+ T:    git https://github.com/pkshih/rtw.git
  F:    drivers/net/wireless/realtek/rtl8xxxu/
  
  RTRS TRANSPORT DRIVERS
@@@ -21818,7 -21857,7 +21857,7 @@@ F:   Documentation/devicetree/bindings/so
  F:    Documentation/devicetree/bindings/sound/tas2562.yaml
  F:    Documentation/devicetree/bindings/sound/tas2770.yaml
  F:    Documentation/devicetree/bindings/sound/tas27xx.yaml
 -F:    Documentation/devicetree/bindings/sound/ti,pcm1681.txt
 +F:    Documentation/devicetree/bindings/sound/ti,pcm1681.yaml
  F:    Documentation/devicetree/bindings/sound/ti,pcm3168a.yaml
  F:    Documentation/devicetree/bindings/sound/ti,tlv320*.yaml
  F:    Documentation/devicetree/bindings/sound/tlv320adcx140.yaml
@@@ -22254,13 -22293,20 +22293,20 @@@ S:        Supporte
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git timers/core
  F:    include/linux/clocksource.h
  F:    include/linux/time.h
+ F:    include/linux/timekeeper_internal.h
+ F:    include/linux/timekeeping.h
  F:    include/linux/timex.h
  F:    include/uapi/linux/time.h
  F:    include/uapi/linux/timex.h
  F:    kernel/time/alarmtimer.c
- F:    kernel/time/clocksource.c
- F:    kernel/time/ntp.c
- F:    kernel/time/time*.c
+ F:    kernel/time/clocksource*
+ F:    kernel/time/ntp*
+ F:    kernel/time/time.c
+ F:    kernel/time/timeconst.bc
+ F:    kernel/time/timeconv.c
+ F:    kernel/time/timecounter.c
+ F:    kernel/time/timekeeping*
+ F:    kernel/time/time_test.c
  F:    tools/testing/selftests/timers/
  
  TIPC NETWORK LAYER
@@@ -22384,6 -22430,7 +22430,7 @@@ S:   Maintaine
  W:    https://kernsec.org/wiki/index.php/Linux_Kernel_Integrity
  Q:    https://patchwork.kernel.org/project/linux-integrity/list/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd.git
+ F:    Documentation/devicetree/bindings/tpm/
  F:    drivers/char/tpm/
  
  TPS546D24 DRIVER
@@@ -23608,9 -23655,9 +23655,9 @@@ S:   Supporte
  F:    drivers/misc/vmw_balloon.c
  
  VMWARE HYPERVISOR INTERFACE
- M:    Ajay Kaher <akaher@vmware.com>
- M:    Alexey Makhalov <amakhalov@vmware.com>
- R:    VMware PV-Drivers Reviewers <pv-drivers@vmware.com>
+ M:    Ajay Kaher <ajay.kaher@broadcom.com>
+ M:    Alexey Makhalov <alexey.amakhalov@broadcom.com>
+ R:    Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
  L:    [email protected]
  L:    [email protected]
  S:    Supported
@@@ -23619,34 -23666,34 +23666,34 @@@ F:        arch/x86/include/asm/vmware.
  F:    arch/x86/kernel/cpu/vmware.c
  
  VMWARE PVRDMA DRIVER
- M:    Bryan Tan <bryantan@vmware.com>
- M:    Vishnu Dasa <vdasa@vmware.com>
- R:    VMware PV-Drivers Reviewers <pv-drivers@vmware.com>
+ M:    Bryan Tan <bryan-bt.tan@broadcom.com>
+ M:    Vishnu Dasa <vishnu.dasa@broadcom.com>
+ R:    Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
  L:    [email protected]
  S:    Supported
  F:    drivers/infiniband/hw/vmw_pvrdma/
  
  VMWARE PVSCSI DRIVER
- M:    Vishal Bhakta <vbhakta@vmware.com>
- R:    VMware PV-Drivers Reviewers <pv-drivers@vmware.com>
+ M:    Vishal Bhakta <vishal.bhakta@broadcom.com>
+ R:    Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
  L:    [email protected]
  S:    Supported
  F:    drivers/scsi/vmw_pvscsi.c
  F:    drivers/scsi/vmw_pvscsi.h
  
  VMWARE VIRTUAL PTP CLOCK DRIVER
- M:    Jeff Sipek <jsipek@vmware.com>
- R:    Ajay Kaher <akaher@vmware.com>
- R:    Alexey Makhalov <amakhalov@vmware.com>
- R:    VMware PV-Drivers Reviewers <pv-drivers@vmware.com>
+ M:    Nick Shi <nick.shi@broadcom.com>
+ R:    Ajay Kaher <ajay.kaher@broadcom.com>
+ R:    Alexey Makhalov <alexey.amakhalov@broadcom.com>
+ R:    Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
  L:    [email protected]
  S:    Supported
  F:    drivers/ptp/ptp_vmw.c
  
  VMWARE VMCI DRIVER
- M:    Bryan Tan <bryantan@vmware.com>
- M:    Vishnu Dasa <vdasa@vmware.com>
- R:    VMware PV-Drivers Reviewers <pv-drivers@vmware.com>
+ M:    Bryan Tan <bryan-bt.tan@broadcom.com>
+ M:    Vishnu Dasa <vishnu.dasa@broadcom.com>
+ R:    Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
  L:    [email protected]
  S:    Supported
  F:    drivers/misc/vmw_vmci/
@@@ -23661,16 -23708,16 +23708,16 @@@ F:        drivers/input/mouse/vmmouse.
  F:    drivers/input/mouse/vmmouse.h
  
  VMWARE VMXNET3 ETHERNET DRIVER
- M:    Ronak Doshi <doshir@vmware.com>
- R:    VMware PV-Drivers Reviewers <pv-drivers@vmware.com>
+ M:    Ronak Doshi <ronak.doshi@broadcom.com>
+ R:    Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
  L:    [email protected]
  S:    Supported
  F:    drivers/net/vmxnet3/
  
  VMWARE VSOCK VMCI TRANSPORT DRIVER
- M:    Bryan Tan <bryantan@vmware.com>
- M:    Vishnu Dasa <vdasa@vmware.com>
- R:    VMware PV-Drivers Reviewers <pv-drivers@vmware.com>
+ M:    Bryan Tan <bryan-bt.tan@broadcom.com>
+ M:    Vishnu Dasa <vishnu.dasa@broadcom.com>
+ R:    Broadcom internal kernel review list <bcm-kernel-feedback-list@broadcom.com>
  L:    [email protected]
  S:    Supported
  F:    net/vmw_vsock/vmci_transport*
diff --combined drivers/spi/Kconfig
index 554664efda86beaef7983d129b5682c55d907ecc,555df2f07b3a186f6ac691f6c3a00bc12fbf8dde..17325e0b7bd5d8ee5c3021db3da865c60e5b3425
@@@ -246,7 -246,7 +246,7 @@@ config SPI_CADENC
  
  config SPI_CADENCE_QUADSPI
        tristate "Cadence Quad SPI controller"
 -      depends on OF && (ARM || ARM64 || X86 || RISCV || COMPILE_TEST)
 +      depends on OF && (ARM || ARM64 || X86 || RISCV || MIPS || COMPILE_TEST)
        help
          Enable support for the Cadence Quad SPI Flash controller.
  
@@@ -284,6 -284,7 +284,7 @@@ config SPI_COLDFIRE_QSP
  config SPI_CS42L43
        tristate "Cirrus Logic CS42L43 SPI controller"
        depends on MFD_CS42L43 && PINCTRL_CS42L43
+       select GPIO_SWNODE_UNDEFINED
        help
          This enables support for the SPI controller inside the Cirrus Logic
          CS42L43 audio codec.
@@@ -817,7 -818,7 +818,7 @@@ config SPI_PPC4x
  
  config SPI_PXA2XX
        tristate "PXA2xx SSP SPI master"
 -      depends on ARCH_PXA || ARCH_MMP || PCI || ACPI || COMPILE_TEST
 +      depends on ARCH_PXA || ARCH_MMP || (X86 && (PCI || ACPI)) || COMPILE_TEST
        select PXA_SSP if ARCH_PXA || ARCH_MMP
        help
          This enables using a PXA2xx or Sodaville SSP port as a SPI master
diff --combined drivers/spi/spi.c
index 6c620df6a14f39b27260d90212775d3ddf63a641,555fbe200733d0982df3958605a7411387082eaf..34fca94b2b5b100579a2886e50098fc70f052f1b
@@@ -597,10 -597,16 +597,16 @@@ EXPORT_SYMBOL_GPL(spi_alloc_device)
  
  static void spi_dev_set_name(struct spi_device *spi)
  {
-       struct acpi_device *adev = ACPI_COMPANION(&spi->dev);
+       struct device *dev = &spi->dev;
+       struct fwnode_handle *fwnode = dev_fwnode(dev);
  
-       if (adev) {
-               dev_set_name(&spi->dev, "spi-%s", acpi_dev_name(adev));
+       if (is_acpi_device_node(fwnode)) {
+               dev_set_name(dev, "spi-%s", acpi_dev_name(to_acpi_device_node(fwnode)));
+               return;
+       }
+       if (is_software_node(fwnode)) {
+               dev_set_name(dev, "spi-%pfwP", fwnode);
                return;
        }
  
@@@ -822,10 -828,14 +828,10 @@@ struct spi_device *spi_new_device(struc
        proxy->controller_data = chip->controller_data;
        proxy->controller_state = NULL;
        /*
 -       * spi->chip_select[i] gives the corresponding physical CS for logical CS i
 -       * logical CS number is represented by setting the ith bit in spi->cs_index_mask
 -       * So, for example, if spi->cs_index_mask = 0x01 then logical CS number is 0 and
 -       * spi->chip_select[0] will give the physical CS.
 -       * By default spi->chip_select[0] will hold the physical CS number so, set
 -       * spi->cs_index_mask as 0x01.
 +       * By default spi->chip_select[0] will hold the physical CS number,
 +       * so set bit 0 in spi->cs_index_mask.
         */
 -      proxy->cs_index_mask = 0x01;
 +      proxy->cs_index_mask = BIT(0);
  
        if (chip->swnode) {
                status = device_add_software_node(&proxy->dev, chip->swnode);
@@@ -1018,45 -1028,20 +1024,45 @@@ static void spi_res_release(struct spi_
  }
  
  /*-------------------------------------------------------------------------*/
 +#define spi_for_each_valid_cs(spi, idx)                               \
 +      for (idx = 0; idx < SPI_CS_CNT_MAX; idx++)              \
 +              if (!(spi->cs_index_mask & BIT(idx))) {} else
 +
  static inline bool spi_is_last_cs(struct spi_device *spi)
  {
        u8 idx;
        bool last = false;
  
 -      for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
 -              if (spi->cs_index_mask & BIT(idx)) {
 -                      if (spi->controller->last_cs[idx] == spi_get_chipselect(spi, idx))
 -                              last = true;
 -              }
 +      spi_for_each_valid_cs(spi, idx) {
 +              if (spi->controller->last_cs[idx] == spi_get_chipselect(spi, idx))
 +                      last = true;
        }
        return last;
  }
  
 +static void spi_toggle_csgpiod(struct spi_device *spi, u8 idx, bool enable, bool activate)
 +{
 +      /*
 +       * Historically ACPI has no means of the GPIO polarity and
 +       * thus the SPISerialBus() resource defines it on the per-chip
 +       * basis. In order to avoid a chain of negations, the GPIO
 +       * polarity is considered being Active High. Even for the cases
 +       * when _DSD() is involved (in the updated versions of ACPI)
 +       * the GPIO CS polarity must be defined Active High to avoid
 +       * ambiguity. That's why we use enable, that takes SPI_CS_HIGH
 +       * into account.
 +       */
 +      if (has_acpi_companion(&spi->dev))
 +              gpiod_set_value_cansleep(spi_get_csgpiod(spi, idx), !enable);
 +      else
 +              /* Polarity handled by GPIO library */
 +              gpiod_set_value_cansleep(spi_get_csgpiod(spi, idx), activate);
 +
 +      if (activate)
 +              spi_delay_exec(&spi->cs_setup, NULL);
 +      else
 +              spi_delay_exec(&spi->cs_inactive, NULL);
 +}
  
  static void spi_set_cs(struct spi_device *spi, bool enable, bool force)
  {
  
        if (spi_is_csgpiod(spi)) {
                if (!(spi->mode & SPI_NO_CS)) {
 -                      /*
 -                       * Historically ACPI has no means of the GPIO polarity and
 -                       * thus the SPISerialBus() resource defines it on the per-chip
 -                       * basis. In order to avoid a chain of negations, the GPIO
 -                       * polarity is considered being Active High. Even for the cases
 -                       * when _DSD() is involved (in the updated versions of ACPI)
 -                       * the GPIO CS polarity must be defined Active High to avoid
 -                       * ambiguity. That's why we use enable, that takes SPI_CS_HIGH
 -                       * into account.
 -                       */
 -                      for (idx = 0; idx < SPI_CS_CNT_MAX; idx++) {
 -                              if ((spi->cs_index_mask & BIT(idx)) && spi_get_csgpiod(spi, idx)) {
 -                                      if (has_acpi_companion(&spi->dev))
 -                                              gpiod_set_value_cansleep(spi_get_csgpiod(spi, idx),
 -                                                                       !enable);
 -                                      else
 -                                              /* Polarity handled by GPIO library */
 -                                              gpiod_set_value_cansleep(spi_get_csgpiod(spi, idx),
 -                                                                       activate);
 -
 -                                      if (activate)
 -                                              spi_delay_exec(&spi->cs_setup, NULL);
 -                                      else
 -                                              spi_delay_exec(&spi->cs_inactive, NULL);
 -                              }
 +                      spi_for_each_valid_cs(spi, idx) {
 +                              if (spi_get_csgpiod(spi, idx))
 +                                      spi_toggle_csgpiod(spi, idx, enable, activate);
                        }
                }
                /* Some SPI masters need both GPIO CS & slave_select */
@@@ -3708,6 -3715,9 +3714,6 @@@ static int __spi_split_transfer_maxsize
         * to the same values as *xferp, so tx_buf, rx_buf and len
         * are all identical (as well as most others)
         * so we just have to fix up len and the pointers.
 -       *
 -       * This also includes support for the depreciated
 -       * spi_message.is_dma_mapped interface.
         */
  
        /*
                /* Update rx_buf, tx_buf and DMA */
                if (xfers[i].rx_buf)
                        xfers[i].rx_buf += offset;
 -              if (xfers[i].rx_dma)
 -                      xfers[i].rx_dma += offset;
                if (xfers[i].tx_buf)
                        xfers[i].tx_buf += offset;
 -              if (xfers[i].tx_dma)
 -                      xfers[i].tx_dma += offset;
  
                /* Update length */
                xfers[i].len = min(maxsize, xfers[i].len - offset);
This page took 0.142613 seconds and 4 git commands to generate.