diff options
author | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-06-01 09:43:24 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-06-11 19:11:39 +0200 |
commit | 469a7306f1717b9017006708f0815bd5294324dd (patch) | |
tree | 73ce4ae1121f3f4a1edb2907aba1f197be530531 /drivers/staging/media/atomisp/pci/atomisp_v4l2.c | |
parent | 77bdacaa9f553449fe2807bfb5a88f10dba4d2b4 (diff) |
media: atomisp: change the detection of ISP2401 at runtime
Instead of having a static var to detect it, let's use the
already-existing arch-specific bytes, as this is how other
parts of the code also checks when it needs to do something
different, depending on an specific chipset version.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/staging/media/atomisp/pci/atomisp_v4l2.c')
-rw-r--r-- | drivers/staging/media/atomisp/pci/atomisp_v4l2.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c index 03c0c5e91f6f..73bea6a7ebb6 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c +++ b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c @@ -124,11 +124,6 @@ MODULE_PARM_DESC(pad_h, "extra data for ISP processing"); * be to replace this to something stored inside atomisp allocated * structures. */ -bool atomisp_hw_is_isp2401; - -/* Types of atomisp hardware */ -#define HW_IS_ISP2400 0 -#define HW_IS_ISP2401 1 struct device *atomisp_dev; @@ -1459,21 +1454,17 @@ static bool is_valid_device(struct pci_dev *dev, switch (id->device & ATOMISP_PCI_DEVICE_SOC_MASK) { case ATOMISP_PCI_DEVICE_SOC_MRFLD: a0_max_id = ATOMISP_PCI_REV_MRFLD_A0_MAX; - atomisp_hw_is_isp2401 = false; name = "Merrifield"; break; case ATOMISP_PCI_DEVICE_SOC_BYT: a0_max_id = ATOMISP_PCI_REV_BYT_A0_MAX; - atomisp_hw_is_isp2401 = false; name = "Baytrail"; break; case ATOMISP_PCI_DEVICE_SOC_ANN: name = "Anniedale"; - atomisp_hw_is_isp2401 = true; break; case ATOMISP_PCI_DEVICE_SOC_CHT: name = "Cherrytrail"; - atomisp_hw_is_isp2401 = true; break; default: dev_err(&dev->dev, "%s: unknown device ID %x04:%x04\n", @@ -1493,13 +1484,13 @@ static bool is_valid_device(struct pci_dev *dev, */ #if defined(ISP2400) - if (atomisp_hw_is_isp2401) { + if (IS_ISP2401) { dev_err(&dev->dev, "Support for %s (ISP2401) was disabled at compile time\n", name); return false; } #else - if (!atomisp_hw_is_isp2401) { + if (!IS_ISP2401) { dev_err(&dev->dev, "Support for %s (ISP2400) was disabled at compile time\n", name); return false; @@ -1508,7 +1499,7 @@ static bool is_valid_device(struct pci_dev *dev, dev_info(&dev->dev, "Detected %s version %d (ISP240%c) on %s\n", name, dev->revision, - atomisp_hw_is_isp2401 ? '1' : '0', + IS_ISP2401 ? '1' : '0', product); return true; @@ -1530,7 +1521,7 @@ static int init_atomisp_wdts(struct atomisp_device *isp) for (i = 0; i < isp->num_of_streams; i++) { struct atomisp_sub_device *asd = &isp->asd[i]; - if (!atomisp_hw_is_isp2401) + if (!IS_ISP2401) timer_setup(&asd->wdt, atomisp_wdt, 0); else { timer_setup(&asd->video_out_capture.wdt, |