[RFC,4/8] ALSA: hda/i915: Update PCI IDs

Message ID 20230628205135.517241-5-amadeuszx.slawinski@linux.intel.com
State New
Headers
Series PCI: Define Intel PCI IDs and use them in drivers |

Commit Message

Amadeusz Sławiński June 28, 2023, 8:51 p.m. UTC
  Use PCI device IDs from pci_ids.h header

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
---
 sound/hda/hdac_i915.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
  

Comments

Andy Shevchenko June 28, 2023, 2:42 p.m. UTC | #1
On Wed, Jun 28, 2023 at 10:51:31PM +0200, Amadeusz Sławiński wrote:
> Use PCI device IDs from pci_ids.h header

Missing period at the end.

...

> -#define IS_HSW_CONTROLLER(pci) (((pci)->device == 0x0a0c) || \
> -				((pci)->device == 0x0c0c) || \
> -				((pci)->device == 0x0d0c) || \
> -				((pci)->device == 0x160c))
> +#define IS_HSW_CONTROLLER(pci) (((pci)->device == PCI_DEVICE_ID_INTEL_HDA_HSW_0) || \
> +				((pci)->device == PCI_DEVICE_ID_INTEL_HDA_HSW_2) || \
> +				((pci)->device == PCI_DEVICE_ID_INTEL_HDA_HSW_3) || \
> +				((pci)->device == PCI_DEVICE_ID_INTEL_HDA_BDW))

The very same macro under different name appeared in the previous patch.
Am I correct? Perhaps go further and first move it somewhere to be available
for both?
  
Andy Shevchenko June 28, 2023, 2:44 p.m. UTC | #2
On Wed, Jun 28, 2023 at 05:42:54PM +0300, Andy Shevchenko wrote:
> On Wed, Jun 28, 2023 at 10:51:31PM +0200, Amadeusz Sławiński wrote:

...

> > -#define IS_HSW_CONTROLLER(pci) (((pci)->device == 0x0a0c) || \
> > -				((pci)->device == 0x0c0c) || \
> > -				((pci)->device == 0x0d0c) || \
> > -				((pci)->device == 0x160c))
> > +#define IS_HSW_CONTROLLER(pci) (((pci)->device == PCI_DEVICE_ID_INTEL_HDA_HSW_0) || \
> > +				((pci)->device == PCI_DEVICE_ID_INTEL_HDA_HSW_2) || \
> > +				((pci)->device == PCI_DEVICE_ID_INTEL_HDA_HSW_3) || \
> > +				((pci)->device == PCI_DEVICE_ID_INTEL_HDA_BDW))
> 
> The very same macro under different name appeared in the previous patch.
> Am I correct? Perhaps go further and first move it somewhere to be available
> for both?

Ah, this one is a subset of that one, nevertheless the proposal stays.
  

Patch

diff --git a/sound/hda/hdac_i915.c b/sound/hda/hdac_i915.c
index 161a9711cd63..e9342e74b739 100644
--- a/sound/hda/hdac_i915.c
+++ b/sound/hda/hdac_i915.c
@@ -11,10 +11,10 @@ 
 #include <sound/hda_i915.h>
 #include <sound/hda_register.h>
 
-#define IS_HSW_CONTROLLER(pci) (((pci)->device == 0x0a0c) || \
-				((pci)->device == 0x0c0c) || \
-				((pci)->device == 0x0d0c) || \
-				((pci)->device == 0x160c))
+#define IS_HSW_CONTROLLER(pci) (((pci)->device == PCI_DEVICE_ID_INTEL_HDA_HSW_0) || \
+				((pci)->device == PCI_DEVICE_ID_INTEL_HDA_HSW_2) || \
+				((pci)->device == PCI_DEVICE_ID_INTEL_HDA_HSW_3) || \
+				((pci)->device == PCI_DEVICE_ID_INTEL_HDA_BDW))
 
 /**
  * snd_hdac_i915_set_bclk - Reprogram BCLK for HSW/BDW