xref: /openbmc/linux/drivers/media/pci/solo6x10/solo6x10-core.c (revision 7ae9fb1b7ecbb5d85d07857943f677fd1a559b18)
1c942fddfSThomas Gleixner // SPDX-License-Identifier: GPL-2.0-or-later
228cae868SHans Verkuil /*
3cf293a4fSAlexander A. Klimov  * Copyright (C) 2010-2013 Bluecherry, LLC <https://www.bluecherrydvr.com>
428cae868SHans Verkuil  *
528cae868SHans Verkuil  * Original author:
628cae868SHans Verkuil  * Ben Collins <bcollins@ubuntu.com>
728cae868SHans Verkuil  *
828cae868SHans Verkuil  * Additional work by:
928cae868SHans Verkuil  * John Brooks <john.brooks@bluecherry.net>
1028cae868SHans Verkuil  */
1128cae868SHans Verkuil 
1228cae868SHans Verkuil #include <linux/kernel.h>
1328cae868SHans Verkuil #include <linux/module.h>
1428cae868SHans Verkuil #include <linux/pci.h>
1528cae868SHans Verkuil #include <linux/interrupt.h>
1628cae868SHans Verkuil #include <linux/videodev2.h>
1728cae868SHans Verkuil #include <linux/delay.h>
1828cae868SHans Verkuil #include <linux/sysfs.h>
1928cae868SHans Verkuil #include <linux/ktime.h>
2028cae868SHans Verkuil #include <linux/slab.h>
2128cae868SHans Verkuil 
2228cae868SHans Verkuil #include "solo6x10.h"
2328cae868SHans Verkuil #include "solo6x10-tw28.h"
2428cae868SHans Verkuil 
2528cae868SHans Verkuil MODULE_DESCRIPTION("Softlogic 6x10 MPEG4/H.264/G.723 CODEC V4L2/ALSA Driver");
2628cae868SHans Verkuil MODULE_AUTHOR("Bluecherry <maintainers@bluecherrydvr.com>");
2728cae868SHans Verkuil MODULE_VERSION(SOLO6X10_VERSION);
2828cae868SHans Verkuil MODULE_LICENSE("GPL");
2928cae868SHans Verkuil 
3028cae868SHans Verkuil static unsigned video_nr = -1;
3128cae868SHans Verkuil module_param(video_nr, uint, 0644);
3228cae868SHans Verkuil MODULE_PARM_DESC(video_nr, "videoX start number, -1 is autodetect (default)");
3328cae868SHans Verkuil 
3428cae868SHans Verkuil static int full_eeprom; /* default is only top 64B */
3528cae868SHans Verkuil module_param(full_eeprom, uint, 0644);
3628cae868SHans Verkuil MODULE_PARM_DESC(full_eeprom, "Allow access to full 128B EEPROM (dangerous)");
3728cae868SHans Verkuil 
3828cae868SHans Verkuil 
solo_set_time(struct solo_dev * solo_dev)3928cae868SHans Verkuil static void solo_set_time(struct solo_dev *solo_dev)
4028cae868SHans Verkuil {
416c542426SArnd Bergmann 	struct timespec64 ts;
4228cae868SHans Verkuil 
436c542426SArnd Bergmann 	ktime_get_ts64(&ts);
4428cae868SHans Verkuil 
456c542426SArnd Bergmann 	/* no overflow because we use monotonic timestamps */
466c542426SArnd Bergmann 	solo_reg_write(solo_dev, SOLO_TIMER_SEC, (u32)ts.tv_sec);
476c542426SArnd Bergmann 	solo_reg_write(solo_dev, SOLO_TIMER_USEC, (u32)ts.tv_nsec / NSEC_PER_USEC);
4828cae868SHans Verkuil }
4928cae868SHans Verkuil 
solo_timer_sync(struct solo_dev * solo_dev)5028cae868SHans Verkuil static void solo_timer_sync(struct solo_dev *solo_dev)
5128cae868SHans Verkuil {
5228cae868SHans Verkuil 	u32 sec, usec;
536c542426SArnd Bergmann 	struct timespec64 ts;
5428cae868SHans Verkuil 	long diff;
5528cae868SHans Verkuil 
5628cae868SHans Verkuil 	if (solo_dev->type != SOLO_DEV_6110)
5728cae868SHans Verkuil 		return;
5828cae868SHans Verkuil 
5928cae868SHans Verkuil 	if (++solo_dev->time_sync < 60)
6028cae868SHans Verkuil 		return;
6128cae868SHans Verkuil 
6228cae868SHans Verkuil 	solo_dev->time_sync = 0;
6328cae868SHans Verkuil 
6428cae868SHans Verkuil 	sec = solo_reg_read(solo_dev, SOLO_TIMER_SEC);
6528cae868SHans Verkuil 	usec = solo_reg_read(solo_dev, SOLO_TIMER_USEC);
6628cae868SHans Verkuil 
676c542426SArnd Bergmann 	ktime_get_ts64(&ts);
6828cae868SHans Verkuil 
696c542426SArnd Bergmann 	diff = (s32)ts.tv_sec - (s32)sec;
7028cae868SHans Verkuil 	diff = (diff * 1000000)
716c542426SArnd Bergmann 		+ ((s32)(ts.tv_nsec / NSEC_PER_USEC) - (s32)usec);
7228cae868SHans Verkuil 
7328cae868SHans Verkuil 	if (diff > 1000 || diff < -1000) {
7428cae868SHans Verkuil 		solo_set_time(solo_dev);
7528cae868SHans Verkuil 	} else if (diff) {
7628cae868SHans Verkuil 		long usec_lsb = solo_dev->usec_lsb;
7728cae868SHans Verkuil 
7828cae868SHans Verkuil 		usec_lsb -= diff / 4;
7928cae868SHans Verkuil 		if (usec_lsb < 0)
8028cae868SHans Verkuil 			usec_lsb = 0;
8128cae868SHans Verkuil 		else if (usec_lsb > 255)
8228cae868SHans Verkuil 			usec_lsb = 255;
8328cae868SHans Verkuil 
8428cae868SHans Verkuil 		solo_dev->usec_lsb = usec_lsb;
8528cae868SHans Verkuil 		solo_reg_write(solo_dev, SOLO_TIMER_USEC_LSB,
8628cae868SHans Verkuil 			       solo_dev->usec_lsb);
8728cae868SHans Verkuil 	}
8828cae868SHans Verkuil }
8928cae868SHans Verkuil 
solo_isr(int irq,void * data)9028cae868SHans Verkuil static irqreturn_t solo_isr(int irq, void *data)
9128cae868SHans Verkuil {
9228cae868SHans Verkuil 	struct solo_dev *solo_dev = data;
9328cae868SHans Verkuil 	u32 status;
9428cae868SHans Verkuil 	int i;
9528cae868SHans Verkuil 
9628cae868SHans Verkuil 	status = solo_reg_read(solo_dev, SOLO_IRQ_STAT);
9728cae868SHans Verkuil 	if (!status)
9828cae868SHans Verkuil 		return IRQ_NONE;
9928cae868SHans Verkuil 
1003c787b10SKrzysztof Hałasa 	/* Acknowledge all interrupts immediately */
1013c787b10SKrzysztof Hałasa 	solo_reg_write(solo_dev, SOLO_IRQ_STAT, status);
10228cae868SHans Verkuil 
10328cae868SHans Verkuil 	if (status & SOLO_IRQ_PCI_ERR)
10428cae868SHans Verkuil 		solo_p2m_error_isr(solo_dev);
10528cae868SHans Verkuil 
10628cae868SHans Verkuil 	for (i = 0; i < SOLO_NR_P2M; i++)
10728cae868SHans Verkuil 		if (status & SOLO_IRQ_P2M(i))
10828cae868SHans Verkuil 			solo_p2m_isr(solo_dev, i);
10928cae868SHans Verkuil 
11028cae868SHans Verkuil 	if (status & SOLO_IRQ_IIC)
11128cae868SHans Verkuil 		solo_i2c_isr(solo_dev);
11228cae868SHans Verkuil 
11328cae868SHans Verkuil 	if (status & SOLO_IRQ_VIDEO_IN) {
11428cae868SHans Verkuil 		solo_video_in_isr(solo_dev);
11528cae868SHans Verkuil 		solo_timer_sync(solo_dev);
11628cae868SHans Verkuil 	}
11728cae868SHans Verkuil 
11828cae868SHans Verkuil 	if (status & SOLO_IRQ_ENCODER)
11928cae868SHans Verkuil 		solo_enc_v4l2_isr(solo_dev);
12028cae868SHans Verkuil 
12128cae868SHans Verkuil 	if (status & SOLO_IRQ_G723)
12228cae868SHans Verkuil 		solo_g723_isr(solo_dev);
12328cae868SHans Verkuil 
12428cae868SHans Verkuil 	return IRQ_HANDLED;
12528cae868SHans Verkuil }
12628cae868SHans Verkuil 
free_solo_dev(struct solo_dev * solo_dev)12728cae868SHans Verkuil static void free_solo_dev(struct solo_dev *solo_dev)
12828cae868SHans Verkuil {
129d9b82522SKrzysztof Hałasa 	struct pci_dev *pdev = solo_dev->pdev;
13028cae868SHans Verkuil 
13128cae868SHans Verkuil 	if (solo_dev->dev.parent)
13228cae868SHans Verkuil 		device_unregister(&solo_dev->dev);
13328cae868SHans Verkuil 
13428cae868SHans Verkuil 	if (solo_dev->reg_base) {
13528cae868SHans Verkuil 		/* Bring down the sub-devices first */
13628cae868SHans Verkuil 		solo_g723_exit(solo_dev);
13728cae868SHans Verkuil 		solo_enc_v4l2_exit(solo_dev);
13828cae868SHans Verkuil 		solo_enc_exit(solo_dev);
13928cae868SHans Verkuil 		solo_v4l2_exit(solo_dev);
14028cae868SHans Verkuil 		solo_disp_exit(solo_dev);
14128cae868SHans Verkuil 		solo_gpio_exit(solo_dev);
14228cae868SHans Verkuil 		solo_p2m_exit(solo_dev);
14328cae868SHans Verkuil 		solo_i2c_exit(solo_dev);
14428cae868SHans Verkuil 
14528cae868SHans Verkuil 		/* Now cleanup the PCI device */
14628cae868SHans Verkuil 		solo_irq_off(solo_dev, ~0);
14728cae868SHans Verkuil 		free_irq(pdev->irq, solo_dev);
148dd43a627SKrzysztof Hałasa 		pci_iounmap(pdev, solo_dev->reg_base);
14928cae868SHans Verkuil 	}
15028cae868SHans Verkuil 
15128cae868SHans Verkuil 	pci_release_regions(pdev);
15228cae868SHans Verkuil 	pci_disable_device(pdev);
15328cae868SHans Verkuil 	v4l2_device_unregister(&solo_dev->v4l2_dev);
15428cae868SHans Verkuil 	pci_set_drvdata(pdev, NULL);
15528cae868SHans Verkuil 
15628cae868SHans Verkuil 	kfree(solo_dev);
15728cae868SHans Verkuil }
15828cae868SHans Verkuil 
eeprom_store(struct device * dev,struct device_attribute * attr,const char * buf,size_t count)15928cae868SHans Verkuil static ssize_t eeprom_store(struct device *dev, struct device_attribute *attr,
16028cae868SHans Verkuil 			    const char *buf, size_t count)
16128cae868SHans Verkuil {
16228cae868SHans Verkuil 	struct solo_dev *solo_dev =
16328cae868SHans Verkuil 		container_of(dev, struct solo_dev, dev);
164469ac53eSIsmael Luceno 	u16 *p = (u16 *)buf;
16528cae868SHans Verkuil 	int i;
16628cae868SHans Verkuil 
16728cae868SHans Verkuil 	if (count & 0x1)
16828cae868SHans Verkuil 		dev_warn(dev, "EEPROM Write not aligned (truncating)\n");
16928cae868SHans Verkuil 
17028cae868SHans Verkuil 	if (!full_eeprom && count > 64) {
17128cae868SHans Verkuil 		dev_warn(dev, "EEPROM Write truncated to 64 bytes\n");
17228cae868SHans Verkuil 		count = 64;
17328cae868SHans Verkuil 	} else if (full_eeprom && count > 128) {
17428cae868SHans Verkuil 		dev_warn(dev, "EEPROM Write truncated to 128 bytes\n");
17528cae868SHans Verkuil 		count = 128;
17628cae868SHans Verkuil 	}
17728cae868SHans Verkuil 
17828cae868SHans Verkuil 	solo_eeprom_ewen(solo_dev, 1);
17928cae868SHans Verkuil 
18028cae868SHans Verkuil 	for (i = full_eeprom ? 0 : 32; i < min((int)(full_eeprom ? 64 : 32),
18128cae868SHans Verkuil 					       (int)(count / 2)); i++)
18228cae868SHans Verkuil 		solo_eeprom_write(solo_dev, i, cpu_to_be16(p[i]));
18328cae868SHans Verkuil 
18428cae868SHans Verkuil 	solo_eeprom_ewen(solo_dev, 0);
18528cae868SHans Verkuil 
18628cae868SHans Verkuil 	return count;
18728cae868SHans Verkuil }
18828cae868SHans Verkuil 
eeprom_show(struct device * dev,struct device_attribute * attr,char * buf)18928cae868SHans Verkuil static ssize_t eeprom_show(struct device *dev, struct device_attribute *attr,
19028cae868SHans Verkuil 			   char *buf)
19128cae868SHans Verkuil {
19228cae868SHans Verkuil 	struct solo_dev *solo_dev =
19328cae868SHans Verkuil 		container_of(dev, struct solo_dev, dev);
194469ac53eSIsmael Luceno 	u16 *p = (u16 *)buf;
19528cae868SHans Verkuil 	int count = (full_eeprom ? 128 : 64);
19628cae868SHans Verkuil 	int i;
19728cae868SHans Verkuil 
19828cae868SHans Verkuil 	for (i = (full_eeprom ? 0 : 32); i < (count / 2); i++)
19928cae868SHans Verkuil 		p[i] = be16_to_cpu(solo_eeprom_read(solo_dev, i));
20028cae868SHans Verkuil 
20128cae868SHans Verkuil 	return count;
20228cae868SHans Verkuil }
20328cae868SHans Verkuil 
p2m_timeouts_show(struct device * dev,struct device_attribute * attr,char * buf)20428cae868SHans Verkuil static ssize_t p2m_timeouts_show(struct device *dev,
20528cae868SHans Verkuil 				 struct device_attribute *attr,
20628cae868SHans Verkuil 				 char *buf)
20728cae868SHans Verkuil {
20828cae868SHans Verkuil 	struct solo_dev *solo_dev =
20928cae868SHans Verkuil 		container_of(dev, struct solo_dev, dev);
21028cae868SHans Verkuil 
21128cae868SHans Verkuil 	return sprintf(buf, "%d\n", solo_dev->p2m_timeouts);
21228cae868SHans Verkuil }
21328cae868SHans Verkuil 
sdram_size_show(struct device * dev,struct device_attribute * attr,char * buf)21428cae868SHans Verkuil static ssize_t sdram_size_show(struct device *dev,
21528cae868SHans Verkuil 			       struct device_attribute *attr,
21628cae868SHans Verkuil 			       char *buf)
21728cae868SHans Verkuil {
21828cae868SHans Verkuil 	struct solo_dev *solo_dev =
21928cae868SHans Verkuil 		container_of(dev, struct solo_dev, dev);
22028cae868SHans Verkuil 
22128cae868SHans Verkuil 	return sprintf(buf, "%dMegs\n", solo_dev->sdram_size >> 20);
22228cae868SHans Verkuil }
22328cae868SHans Verkuil 
tw28xx_show(struct device * dev,struct device_attribute * attr,char * buf)22428cae868SHans Verkuil static ssize_t tw28xx_show(struct device *dev,
22528cae868SHans Verkuil 			   struct device_attribute *attr,
22628cae868SHans Verkuil 			   char *buf)
22728cae868SHans Verkuil {
22828cae868SHans Verkuil 	struct solo_dev *solo_dev =
22928cae868SHans Verkuil 		container_of(dev, struct solo_dev, dev);
23028cae868SHans Verkuil 
23128cae868SHans Verkuil 	return sprintf(buf, "tw2815[%d] tw2864[%d] tw2865[%d]\n",
23228cae868SHans Verkuil 		       hweight32(solo_dev->tw2815),
23328cae868SHans Verkuil 		       hweight32(solo_dev->tw2864),
23428cae868SHans Verkuil 		       hweight32(solo_dev->tw2865));
23528cae868SHans Verkuil }
23628cae868SHans Verkuil 
input_map_show(struct device * dev,struct device_attribute * attr,char * buf)23728cae868SHans Verkuil static ssize_t input_map_show(struct device *dev,
23828cae868SHans Verkuil 			      struct device_attribute *attr,
23928cae868SHans Verkuil 			      char *buf)
24028cae868SHans Verkuil {
24128cae868SHans Verkuil 	struct solo_dev *solo_dev =
24228cae868SHans Verkuil 		container_of(dev, struct solo_dev, dev);
24328cae868SHans Verkuil 	unsigned int val;
24428cae868SHans Verkuil 	char *out = buf;
24528cae868SHans Verkuil 
24628cae868SHans Verkuil 	val = solo_reg_read(solo_dev, SOLO_VI_CH_SWITCH_0);
24728cae868SHans Verkuil 	out += sprintf(out, "Channel 0   => Input %d\n", val & 0x1f);
24828cae868SHans Verkuil 	out += sprintf(out, "Channel 1   => Input %d\n", (val >> 5) & 0x1f);
24928cae868SHans Verkuil 	out += sprintf(out, "Channel 2   => Input %d\n", (val >> 10) & 0x1f);
25028cae868SHans Verkuil 	out += sprintf(out, "Channel 3   => Input %d\n", (val >> 15) & 0x1f);
25128cae868SHans Verkuil 	out += sprintf(out, "Channel 4   => Input %d\n", (val >> 20) & 0x1f);
25228cae868SHans Verkuil 	out += sprintf(out, "Channel 5   => Input %d\n", (val >> 25) & 0x1f);
25328cae868SHans Verkuil 
25428cae868SHans Verkuil 	val = solo_reg_read(solo_dev, SOLO_VI_CH_SWITCH_1);
25528cae868SHans Verkuil 	out += sprintf(out, "Channel 6   => Input %d\n", val & 0x1f);
25628cae868SHans Verkuil 	out += sprintf(out, "Channel 7   => Input %d\n", (val >> 5) & 0x1f);
25728cae868SHans Verkuil 	out += sprintf(out, "Channel 8   => Input %d\n", (val >> 10) & 0x1f);
25828cae868SHans Verkuil 	out += sprintf(out, "Channel 9   => Input %d\n", (val >> 15) & 0x1f);
25928cae868SHans Verkuil 	out += sprintf(out, "Channel 10  => Input %d\n", (val >> 20) & 0x1f);
26028cae868SHans Verkuil 	out += sprintf(out, "Channel 11  => Input %d\n", (val >> 25) & 0x1f);
26128cae868SHans Verkuil 
26228cae868SHans Verkuil 	val = solo_reg_read(solo_dev, SOLO_VI_CH_SWITCH_2);
26328cae868SHans Verkuil 	out += sprintf(out, "Channel 12  => Input %d\n", val & 0x1f);
26428cae868SHans Verkuil 	out += sprintf(out, "Channel 13  => Input %d\n", (val >> 5) & 0x1f);
26528cae868SHans Verkuil 	out += sprintf(out, "Channel 14  => Input %d\n", (val >> 10) & 0x1f);
26628cae868SHans Verkuil 	out += sprintf(out, "Channel 15  => Input %d\n", (val >> 15) & 0x1f);
26728cae868SHans Verkuil 	out += sprintf(out, "Spot Output => Input %d\n", (val >> 20) & 0x1f);
26828cae868SHans Verkuil 
26928cae868SHans Verkuil 	return out - buf;
27028cae868SHans Verkuil }
27128cae868SHans Verkuil 
p2m_timeout_store(struct device * dev,struct device_attribute * attr,const char * buf,size_t count)27228cae868SHans Verkuil static ssize_t p2m_timeout_store(struct device *dev,
27328cae868SHans Verkuil 				 struct device_attribute *attr,
27428cae868SHans Verkuil 				 const char *buf, size_t count)
27528cae868SHans Verkuil {
27628cae868SHans Verkuil 	struct solo_dev *solo_dev =
27728cae868SHans Verkuil 		container_of(dev, struct solo_dev, dev);
27828cae868SHans Verkuil 	unsigned long ms;
27928cae868SHans Verkuil 	int ret = kstrtoul(buf, 10, &ms);
28028cae868SHans Verkuil 
28128cae868SHans Verkuil 	if (ret < 0 || ms > 200)
28228cae868SHans Verkuil 		return -EINVAL;
28328cae868SHans Verkuil 	solo_dev->p2m_jiffies = msecs_to_jiffies(ms);
28428cae868SHans Verkuil 
28528cae868SHans Verkuil 	return count;
28628cae868SHans Verkuil }
28728cae868SHans Verkuil 
p2m_timeout_show(struct device * dev,struct device_attribute * attr,char * buf)28828cae868SHans Verkuil static ssize_t p2m_timeout_show(struct device *dev,
28928cae868SHans Verkuil 				struct device_attribute *attr,
29028cae868SHans Verkuil 				char *buf)
29128cae868SHans Verkuil {
29228cae868SHans Verkuil 	struct solo_dev *solo_dev =
29328cae868SHans Verkuil 		container_of(dev, struct solo_dev, dev);
29428cae868SHans Verkuil 
29528cae868SHans Verkuil 	return sprintf(buf, "%ums\n", jiffies_to_msecs(solo_dev->p2m_jiffies));
29628cae868SHans Verkuil }
29728cae868SHans Verkuil 
intervals_show(struct device * dev,struct device_attribute * attr,char * buf)29828cae868SHans Verkuil static ssize_t intervals_show(struct device *dev,
29928cae868SHans Verkuil 			      struct device_attribute *attr,
30028cae868SHans Verkuil 			      char *buf)
30128cae868SHans Verkuil {
30228cae868SHans Verkuil 	struct solo_dev *solo_dev =
30328cae868SHans Verkuil 		container_of(dev, struct solo_dev, dev);
30428cae868SHans Verkuil 	char *out = buf;
30528cae868SHans Verkuil 	int fps = solo_dev->fps;
30628cae868SHans Verkuil 	int i;
30728cae868SHans Verkuil 
30828cae868SHans Verkuil 	for (i = 0; i < solo_dev->nr_chans; i++) {
30928cae868SHans Verkuil 		out += sprintf(out, "Channel %d: %d/%d (0x%08x)\n",
31028cae868SHans Verkuil 			       i, solo_dev->v4l2_enc[i]->interval, fps,
31128cae868SHans Verkuil 			       solo_reg_read(solo_dev, SOLO_CAP_CH_INTV(i)));
31228cae868SHans Verkuil 	}
31328cae868SHans Verkuil 
31428cae868SHans Verkuil 	return out - buf;
31528cae868SHans Verkuil }
31628cae868SHans Verkuil 
sdram_offsets_show(struct device * dev,struct device_attribute * attr,char * buf)31728cae868SHans Verkuil static ssize_t sdram_offsets_show(struct device *dev,
31828cae868SHans Verkuil 				  struct device_attribute *attr,
31928cae868SHans Verkuil 				  char *buf)
32028cae868SHans Verkuil {
32128cae868SHans Verkuil 	struct solo_dev *solo_dev =
32228cae868SHans Verkuil 		container_of(dev, struct solo_dev, dev);
32328cae868SHans Verkuil 	char *out = buf;
32428cae868SHans Verkuil 
32528cae868SHans Verkuil 	out += sprintf(out, "DISP: 0x%08x @ 0x%08x\n",
32628cae868SHans Verkuil 		       SOLO_DISP_EXT_ADDR,
32728cae868SHans Verkuil 		       SOLO_DISP_EXT_SIZE);
32828cae868SHans Verkuil 
32928cae868SHans Verkuil 	out += sprintf(out, "EOSD: 0x%08x @ 0x%08x (0x%08x * %d)\n",
33028cae868SHans Verkuil 		       SOLO_EOSD_EXT_ADDR,
33128cae868SHans Verkuil 		       SOLO_EOSD_EXT_AREA(solo_dev),
33228cae868SHans Verkuil 		       SOLO_EOSD_EXT_SIZE(solo_dev),
33328cae868SHans Verkuil 		       SOLO_EOSD_EXT_AREA(solo_dev) /
33428cae868SHans Verkuil 		       SOLO_EOSD_EXT_SIZE(solo_dev));
33528cae868SHans Verkuil 
33628cae868SHans Verkuil 	out += sprintf(out, "MOTI: 0x%08x @ 0x%08x\n",
33728cae868SHans Verkuil 		       SOLO_MOTION_EXT_ADDR(solo_dev),
33828cae868SHans Verkuil 		       SOLO_MOTION_EXT_SIZE);
33928cae868SHans Verkuil 
34028cae868SHans Verkuil 	out += sprintf(out, "G723: 0x%08x @ 0x%08x\n",
34128cae868SHans Verkuil 		       SOLO_G723_EXT_ADDR(solo_dev),
34228cae868SHans Verkuil 		       SOLO_G723_EXT_SIZE);
34328cae868SHans Verkuil 
34428cae868SHans Verkuil 	out += sprintf(out, "CAPT: 0x%08x @ 0x%08x (0x%08x * %d)\n",
34528cae868SHans Verkuil 		       SOLO_CAP_EXT_ADDR(solo_dev),
34628cae868SHans Verkuil 		       SOLO_CAP_EXT_SIZE(solo_dev),
34728cae868SHans Verkuil 		       SOLO_CAP_PAGE_SIZE,
34828cae868SHans Verkuil 		       SOLO_CAP_EXT_SIZE(solo_dev) / SOLO_CAP_PAGE_SIZE);
34928cae868SHans Verkuil 
35028cae868SHans Verkuil 	out += sprintf(out, "EREF: 0x%08x @ 0x%08x (0x%08x * %d)\n",
35128cae868SHans Verkuil 		       SOLO_EREF_EXT_ADDR(solo_dev),
35228cae868SHans Verkuil 		       SOLO_EREF_EXT_AREA(solo_dev),
35328cae868SHans Verkuil 		       SOLO_EREF_EXT_SIZE,
35428cae868SHans Verkuil 		       SOLO_EREF_EXT_AREA(solo_dev) / SOLO_EREF_EXT_SIZE);
35528cae868SHans Verkuil 
35628cae868SHans Verkuil 	out += sprintf(out, "MPEG: 0x%08x @ 0x%08x\n",
35728cae868SHans Verkuil 		       SOLO_MP4E_EXT_ADDR(solo_dev),
35828cae868SHans Verkuil 		       SOLO_MP4E_EXT_SIZE(solo_dev));
35928cae868SHans Verkuil 
36028cae868SHans Verkuil 	out += sprintf(out, "JPEG: 0x%08x @ 0x%08x\n",
36128cae868SHans Verkuil 		       SOLO_JPEG_EXT_ADDR(solo_dev),
36228cae868SHans Verkuil 		       SOLO_JPEG_EXT_SIZE(solo_dev));
36328cae868SHans Verkuil 
36428cae868SHans Verkuil 	return out - buf;
36528cae868SHans Verkuil }
36628cae868SHans Verkuil 
sdram_show(struct file * file,struct kobject * kobj,struct bin_attribute * a,char * buf,loff_t off,size_t count)36728cae868SHans Verkuil static ssize_t sdram_show(struct file *file, struct kobject *kobj,
36828cae868SHans Verkuil 			  struct bin_attribute *a, char *buf,
36928cae868SHans Verkuil 			  loff_t off, size_t count)
37028cae868SHans Verkuil {
3710aa3bdcaSYang Li 	struct device *dev = kobj_to_dev(kobj);
37228cae868SHans Verkuil 	struct solo_dev *solo_dev =
37328cae868SHans Verkuil 		container_of(dev, struct solo_dev, dev);
37428cae868SHans Verkuil 	const int size = solo_dev->sdram_size;
37528cae868SHans Verkuil 
37628cae868SHans Verkuil 	if (off >= size)
37728cae868SHans Verkuil 		return 0;
37828cae868SHans Verkuil 
37928cae868SHans Verkuil 	if (off + count > size)
38028cae868SHans Verkuil 		count = size - off;
38128cae868SHans Verkuil 
38228cae868SHans Verkuil 	if (solo_p2m_dma(solo_dev, 0, buf, off, count, 0, 0))
38328cae868SHans Verkuil 		return -EIO;
38428cae868SHans Verkuil 
38528cae868SHans Verkuil 	return count;
38628cae868SHans Verkuil }
38728cae868SHans Verkuil 
38828cae868SHans Verkuil static const struct device_attribute solo_dev_attrs[] = {
38928cae868SHans Verkuil 	__ATTR(eeprom, 0640, eeprom_show, eeprom_store),
39028cae868SHans Verkuil 	__ATTR(p2m_timeout, 0644, p2m_timeout_show, p2m_timeout_store),
39128cae868SHans Verkuil 	__ATTR_RO(p2m_timeouts),
39228cae868SHans Verkuil 	__ATTR_RO(sdram_size),
39328cae868SHans Verkuil 	__ATTR_RO(tw28xx),
39428cae868SHans Verkuil 	__ATTR_RO(input_map),
39528cae868SHans Verkuil 	__ATTR_RO(intervals),
39628cae868SHans Verkuil 	__ATTR_RO(sdram_offsets),
39728cae868SHans Verkuil };
39828cae868SHans Verkuil 
solo_device_release(struct device * dev)39928cae868SHans Verkuil static void solo_device_release(struct device *dev)
40028cae868SHans Verkuil {
40128cae868SHans Verkuil 	/* Do nothing */
40228cae868SHans Verkuil }
40328cae868SHans Verkuil 
solo_sysfs_init(struct solo_dev * solo_dev)40428cae868SHans Verkuil static int solo_sysfs_init(struct solo_dev *solo_dev)
40528cae868SHans Verkuil {
40628cae868SHans Verkuil 	struct bin_attribute *sdram_attr = &solo_dev->sdram_attr;
40728cae868SHans Verkuil 	struct device *dev = &solo_dev->dev;
40828cae868SHans Verkuil 	const char *driver;
40928cae868SHans Verkuil 	int i;
41028cae868SHans Verkuil 
41128cae868SHans Verkuil 	if (solo_dev->type == SOLO_DEV_6110)
41228cae868SHans Verkuil 		driver = "solo6110";
41328cae868SHans Verkuil 	else
41428cae868SHans Verkuil 		driver = "solo6010";
41528cae868SHans Verkuil 
41628cae868SHans Verkuil 	dev->release = solo_device_release;
41728cae868SHans Verkuil 	dev->parent = &solo_dev->pdev->dev;
41828cae868SHans Verkuil 	set_dev_node(dev, dev_to_node(&solo_dev->pdev->dev));
41928cae868SHans Verkuil 	dev_set_name(dev, "%s-%d-%d", driver, solo_dev->vfd->num,
42028cae868SHans Verkuil 		     solo_dev->nr_chans);
42128cae868SHans Verkuil 
42228cae868SHans Verkuil 	if (device_register(dev)) {
423*262ad4f3SYang Yingliang 		put_device(dev);
42428cae868SHans Verkuil 		dev->parent = NULL;
42528cae868SHans Verkuil 		return -ENOMEM;
42628cae868SHans Verkuil 	}
42728cae868SHans Verkuil 
42828cae868SHans Verkuil 	for (i = 0; i < ARRAY_SIZE(solo_dev_attrs); i++) {
42928cae868SHans Verkuil 		if (device_create_file(dev, &solo_dev_attrs[i])) {
43028cae868SHans Verkuil 			device_unregister(dev);
43128cae868SHans Verkuil 			return -ENOMEM;
43228cae868SHans Verkuil 		}
43328cae868SHans Verkuil 	}
43428cae868SHans Verkuil 
43528cae868SHans Verkuil 	sysfs_attr_init(&sdram_attr->attr);
43628cae868SHans Verkuil 	sdram_attr->attr.name = "sdram";
43728cae868SHans Verkuil 	sdram_attr->attr.mode = 0440;
43828cae868SHans Verkuil 	sdram_attr->read = sdram_show;
43928cae868SHans Verkuil 	sdram_attr->size = solo_dev->sdram_size;
44028cae868SHans Verkuil 
44128cae868SHans Verkuil 	if (device_create_bin_file(dev, sdram_attr)) {
44228cae868SHans Verkuil 		device_unregister(dev);
44328cae868SHans Verkuil 		return -ENOMEM;
44428cae868SHans Verkuil 	}
44528cae868SHans Verkuil 
44628cae868SHans Verkuil 	return 0;
44728cae868SHans Verkuil }
44828cae868SHans Verkuil 
solo_pci_probe(struct pci_dev * pdev,const struct pci_device_id * id)44928cae868SHans Verkuil static int solo_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
45028cae868SHans Verkuil {
45128cae868SHans Verkuil 	struct solo_dev *solo_dev;
45228cae868SHans Verkuil 	int ret;
45328cae868SHans Verkuil 	u8 chip_id;
45428cae868SHans Verkuil 
45528cae868SHans Verkuil 	solo_dev = kzalloc(sizeof(*solo_dev), GFP_KERNEL);
45628cae868SHans Verkuil 	if (solo_dev == NULL)
45728cae868SHans Verkuil 		return -ENOMEM;
45828cae868SHans Verkuil 
45928cae868SHans Verkuil 	if (id->driver_data == SOLO_DEV_6010)
46028cae868SHans Verkuil 		dev_info(&pdev->dev, "Probing Softlogic 6010\n");
46128cae868SHans Verkuil 	else
46228cae868SHans Verkuil 		dev_info(&pdev->dev, "Probing Softlogic 6110\n");
46328cae868SHans Verkuil 
46428cae868SHans Verkuil 	solo_dev->type = id->driver_data;
46528cae868SHans Verkuil 	solo_dev->pdev = pdev;
46628cae868SHans Verkuil 	ret = v4l2_device_register(&pdev->dev, &solo_dev->v4l2_dev);
46728cae868SHans Verkuil 	if (ret)
46828cae868SHans Verkuil 		goto fail_probe;
46928cae868SHans Verkuil 
47028cae868SHans Verkuil 	/* Only for during init */
47128cae868SHans Verkuil 	solo_dev->p2m_jiffies = msecs_to_jiffies(100);
47228cae868SHans Verkuil 
47328cae868SHans Verkuil 	ret = pci_enable_device(pdev);
47428cae868SHans Verkuil 	if (ret)
47528cae868SHans Verkuil 		goto fail_probe;
47628cae868SHans Verkuil 
47728cae868SHans Verkuil 	pci_set_master(pdev);
47828cae868SHans Verkuil 
47928cae868SHans Verkuil 	/* RETRY/TRDY Timeout disabled */
48028cae868SHans Verkuil 	pci_write_config_byte(pdev, 0x40, 0x00);
48128cae868SHans Verkuil 	pci_write_config_byte(pdev, 0x41, 0x00);
48228cae868SHans Verkuil 
48328cae868SHans Verkuil 	ret = pci_request_regions(pdev, SOLO6X10_NAME);
48428cae868SHans Verkuil 	if (ret)
48528cae868SHans Verkuil 		goto fail_probe;
48628cae868SHans Verkuil 
48728cae868SHans Verkuil 	solo_dev->reg_base = pci_ioremap_bar(pdev, 0);
48828cae868SHans Verkuil 	if (solo_dev->reg_base == NULL) {
48928cae868SHans Verkuil 		ret = -ENOMEM;
49028cae868SHans Verkuil 		goto fail_probe;
49128cae868SHans Verkuil 	}
49228cae868SHans Verkuil 
49328cae868SHans Verkuil 	chip_id = solo_reg_read(solo_dev, SOLO_CHIP_OPTION) &
49428cae868SHans Verkuil 				SOLO_CHIP_ID_MASK;
49528cae868SHans Verkuil 	switch (chip_id) {
49628cae868SHans Verkuil 	case 7:
49728cae868SHans Verkuil 		solo_dev->nr_chans = 16;
49828cae868SHans Verkuil 		solo_dev->nr_ext = 5;
49928cae868SHans Verkuil 		break;
50028cae868SHans Verkuil 	case 6:
50128cae868SHans Verkuil 		solo_dev->nr_chans = 8;
50228cae868SHans Verkuil 		solo_dev->nr_ext = 2;
50328cae868SHans Verkuil 		break;
50428cae868SHans Verkuil 	default:
50528cae868SHans Verkuil 		dev_warn(&pdev->dev, "Invalid chip_id 0x%02x, assuming 4 ch\n",
50628cae868SHans Verkuil 			 chip_id);
5071771e9fbSGustavo A. R. Silva 		fallthrough;
50828cae868SHans Verkuil 	case 5:
50928cae868SHans Verkuil 		solo_dev->nr_chans = 4;
51028cae868SHans Verkuil 		solo_dev->nr_ext = 1;
51128cae868SHans Verkuil 	}
51228cae868SHans Verkuil 
51328cae868SHans Verkuil 	/* Disable all interrupts to start */
51428cae868SHans Verkuil 	solo_irq_off(solo_dev, ~0);
51528cae868SHans Verkuil 
51628cae868SHans Verkuil 	/* Initial global settings */
51728cae868SHans Verkuil 	if (solo_dev->type == SOLO_DEV_6010) {
51828cae868SHans Verkuil 		solo_dev->clock_mhz = 108;
51928cae868SHans Verkuil 		solo_dev->sys_config = SOLO_SYS_CFG_SDRAM64BIT
52028cae868SHans Verkuil 			| SOLO_SYS_CFG_INPUTDIV(25)
52128cae868SHans Verkuil 			| SOLO_SYS_CFG_FEEDBACKDIV(solo_dev->clock_mhz * 2 - 2)
52228cae868SHans Verkuil 			| SOLO_SYS_CFG_OUTDIV(3);
52328cae868SHans Verkuil 		solo_reg_write(solo_dev, SOLO_SYS_CFG, solo_dev->sys_config);
52428cae868SHans Verkuil 	} else {
52528cae868SHans Verkuil 		u32 divq, divf;
52628cae868SHans Verkuil 
52728cae868SHans Verkuil 		solo_dev->clock_mhz = 135;
52828cae868SHans Verkuil 
52928cae868SHans Verkuil 		if (solo_dev->clock_mhz < 125) {
53028cae868SHans Verkuil 			divq = 3;
53128cae868SHans Verkuil 			divf = (solo_dev->clock_mhz * 4) / 3 - 1;
53228cae868SHans Verkuil 		} else {
53328cae868SHans Verkuil 			divq = 2;
53428cae868SHans Verkuil 			divf = (solo_dev->clock_mhz * 2) / 3 - 1;
53528cae868SHans Verkuil 		}
53628cae868SHans Verkuil 
53728cae868SHans Verkuil 		solo_reg_write(solo_dev, SOLO_PLL_CONFIG,
53828cae868SHans Verkuil 			       (1 << 20) | /* PLL_RANGE */
53928cae868SHans Verkuil 			       (8 << 15) | /* PLL_DIVR  */
54028cae868SHans Verkuil 			       (divq << 12) |
54128cae868SHans Verkuil 			       (divf <<  4) |
54228cae868SHans Verkuil 			       (1 <<  1)   /* PLL_FSEN */);
54328cae868SHans Verkuil 
54428cae868SHans Verkuil 		solo_dev->sys_config = SOLO_SYS_CFG_SDRAM64BIT;
54528cae868SHans Verkuil 	}
54628cae868SHans Verkuil 
54728cae868SHans Verkuil 	solo_reg_write(solo_dev, SOLO_SYS_CFG, solo_dev->sys_config);
54828cae868SHans Verkuil 	solo_reg_write(solo_dev, SOLO_TIMER_CLOCK_NUM,
54928cae868SHans Verkuil 		       solo_dev->clock_mhz - 1);
55028cae868SHans Verkuil 
55128cae868SHans Verkuil 	/* PLL locking time of 1ms */
55228cae868SHans Verkuil 	mdelay(1);
55328cae868SHans Verkuil 
55428cae868SHans Verkuil 	ret = request_irq(pdev->irq, solo_isr, IRQF_SHARED, SOLO6X10_NAME,
55528cae868SHans Verkuil 			  solo_dev);
55628cae868SHans Verkuil 	if (ret)
55728cae868SHans Verkuil 		goto fail_probe;
55828cae868SHans Verkuil 
55928cae868SHans Verkuil 	/* Handle this from the start */
56028cae868SHans Verkuil 	solo_irq_on(solo_dev, SOLO_IRQ_PCI_ERR);
56128cae868SHans Verkuil 
56228cae868SHans Verkuil 	ret = solo_i2c_init(solo_dev);
56328cae868SHans Verkuil 	if (ret)
56428cae868SHans Verkuil 		goto fail_probe;
56528cae868SHans Verkuil 
56628cae868SHans Verkuil 	/* Setup the DMA engine */
56728cae868SHans Verkuil 	solo_reg_write(solo_dev, SOLO_DMA_CTRL,
56828cae868SHans Verkuil 		       SOLO_DMA_CTRL_REFRESH_CYCLE(1) |
56928cae868SHans Verkuil 		       SOLO_DMA_CTRL_SDRAM_SIZE(2) |
57028cae868SHans Verkuil 		       SOLO_DMA_CTRL_SDRAM_CLK_INVERT |
57128cae868SHans Verkuil 		       SOLO_DMA_CTRL_READ_CLK_SELECT |
57228cae868SHans Verkuil 		       SOLO_DMA_CTRL_LATENCY(1));
57328cae868SHans Verkuil 
57428cae868SHans Verkuil 	/* Undocumented crap */
57528cae868SHans Verkuil 	solo_reg_write(solo_dev, SOLO_DMA_CTRL1,
57628cae868SHans Verkuil 		       solo_dev->type == SOLO_DEV_6010 ? 0x100 : 0x300);
57728cae868SHans Verkuil 
57828cae868SHans Verkuil 	if (solo_dev->type != SOLO_DEV_6010) {
57928cae868SHans Verkuil 		solo_dev->usec_lsb = 0x3f;
58028cae868SHans Verkuil 		solo_set_time(solo_dev);
58128cae868SHans Verkuil 	}
58228cae868SHans Verkuil 
58328cae868SHans Verkuil 	/* Disable watchdog */
58428cae868SHans Verkuil 	solo_reg_write(solo_dev, SOLO_WATCHDOG, 0);
58528cae868SHans Verkuil 
58628cae868SHans Verkuil 	/* Initialize sub components */
58728cae868SHans Verkuil 
58828cae868SHans Verkuil 	ret = solo_p2m_init(solo_dev);
58928cae868SHans Verkuil 	if (ret)
59028cae868SHans Verkuil 		goto fail_probe;
59128cae868SHans Verkuil 
59228cae868SHans Verkuil 	ret = solo_disp_init(solo_dev);
59328cae868SHans Verkuil 	if (ret)
59428cae868SHans Verkuil 		goto fail_probe;
59528cae868SHans Verkuil 
59628cae868SHans Verkuil 	ret = solo_gpio_init(solo_dev);
59728cae868SHans Verkuil 	if (ret)
59828cae868SHans Verkuil 		goto fail_probe;
59928cae868SHans Verkuil 
60028cae868SHans Verkuil 	ret = solo_tw28_init(solo_dev);
60128cae868SHans Verkuil 	if (ret)
60228cae868SHans Verkuil 		goto fail_probe;
60328cae868SHans Verkuil 
60428cae868SHans Verkuil 	ret = solo_v4l2_init(solo_dev, video_nr);
60528cae868SHans Verkuil 	if (ret)
60628cae868SHans Verkuil 		goto fail_probe;
60728cae868SHans Verkuil 
60828cae868SHans Verkuil 	ret = solo_enc_init(solo_dev);
60928cae868SHans Verkuil 	if (ret)
61028cae868SHans Verkuil 		goto fail_probe;
61128cae868SHans Verkuil 
61228cae868SHans Verkuil 	ret = solo_enc_v4l2_init(solo_dev, video_nr);
61328cae868SHans Verkuil 	if (ret)
61428cae868SHans Verkuil 		goto fail_probe;
61528cae868SHans Verkuil 
61628cae868SHans Verkuil 	ret = solo_g723_init(solo_dev);
61728cae868SHans Verkuil 	if (ret)
61828cae868SHans Verkuil 		goto fail_probe;
61928cae868SHans Verkuil 
62028cae868SHans Verkuil 	ret = solo_sysfs_init(solo_dev);
62128cae868SHans Verkuil 	if (ret)
62228cae868SHans Verkuil 		goto fail_probe;
62328cae868SHans Verkuil 
62428cae868SHans Verkuil 	/* Now that init is over, set this lower */
62528cae868SHans Verkuil 	solo_dev->p2m_jiffies = msecs_to_jiffies(20);
62628cae868SHans Verkuil 
62728cae868SHans Verkuil 	return 0;
62828cae868SHans Verkuil 
62928cae868SHans Verkuil fail_probe:
63028cae868SHans Verkuil 	free_solo_dev(solo_dev);
63128cae868SHans Verkuil 	return ret;
63228cae868SHans Verkuil }
63328cae868SHans Verkuil 
solo_pci_remove(struct pci_dev * pdev)63428cae868SHans Verkuil static void solo_pci_remove(struct pci_dev *pdev)
63528cae868SHans Verkuil {
63628cae868SHans Verkuil 	struct v4l2_device *v4l2_dev = pci_get_drvdata(pdev);
63728cae868SHans Verkuil 	struct solo_dev *solo_dev = container_of(v4l2_dev, struct solo_dev, v4l2_dev);
63828cae868SHans Verkuil 
63928cae868SHans Verkuil 	free_solo_dev(solo_dev);
64028cae868SHans Verkuil }
64128cae868SHans Verkuil 
64228cae868SHans Verkuil static const struct pci_device_id solo_id_table[] = {
64328cae868SHans Verkuil 	/* 6010 based cards */
64428cae868SHans Verkuil 	{ PCI_DEVICE(PCI_VENDOR_ID_SOFTLOGIC, PCI_DEVICE_ID_SOLO6010),
64528cae868SHans Verkuil 	  .driver_data = SOLO_DEV_6010 },
64628cae868SHans Verkuil 	{ PCI_DEVICE(PCI_VENDOR_ID_BLUECHERRY, PCI_DEVICE_ID_NEUSOLO_4),
64728cae868SHans Verkuil 	  .driver_data = SOLO_DEV_6010 },
64828cae868SHans Verkuil 	{ PCI_DEVICE(PCI_VENDOR_ID_BLUECHERRY, PCI_DEVICE_ID_NEUSOLO_9),
64928cae868SHans Verkuil 	  .driver_data = SOLO_DEV_6010 },
65028cae868SHans Verkuil 	{ PCI_DEVICE(PCI_VENDOR_ID_BLUECHERRY, PCI_DEVICE_ID_NEUSOLO_16),
65128cae868SHans Verkuil 	  .driver_data = SOLO_DEV_6010 },
65228cae868SHans Verkuil 	{ PCI_DEVICE(PCI_VENDOR_ID_BLUECHERRY, PCI_DEVICE_ID_BC_SOLO_4),
65328cae868SHans Verkuil 	  .driver_data = SOLO_DEV_6010 },
65428cae868SHans Verkuil 	{ PCI_DEVICE(PCI_VENDOR_ID_BLUECHERRY, PCI_DEVICE_ID_BC_SOLO_9),
65528cae868SHans Verkuil 	  .driver_data = SOLO_DEV_6010 },
65628cae868SHans Verkuil 	{ PCI_DEVICE(PCI_VENDOR_ID_BLUECHERRY, PCI_DEVICE_ID_BC_SOLO_16),
65728cae868SHans Verkuil 	  .driver_data = SOLO_DEV_6010 },
65828cae868SHans Verkuil 	/* 6110 based cards */
65928cae868SHans Verkuil 	{ PCI_DEVICE(PCI_VENDOR_ID_SOFTLOGIC, PCI_DEVICE_ID_SOLO6110),
66028cae868SHans Verkuil 	  .driver_data = SOLO_DEV_6110 },
66128cae868SHans Verkuil 	{ PCI_DEVICE(PCI_VENDOR_ID_BLUECHERRY, PCI_DEVICE_ID_BC_6110_4),
66228cae868SHans Verkuil 	  .driver_data = SOLO_DEV_6110 },
66328cae868SHans Verkuil 	{ PCI_DEVICE(PCI_VENDOR_ID_BLUECHERRY, PCI_DEVICE_ID_BC_6110_8),
66428cae868SHans Verkuil 	  .driver_data = SOLO_DEV_6110 },
66528cae868SHans Verkuil 	{ PCI_DEVICE(PCI_VENDOR_ID_BLUECHERRY, PCI_DEVICE_ID_BC_6110_16),
66628cae868SHans Verkuil 	  .driver_data = SOLO_DEV_6110 },
66728cae868SHans Verkuil 	{0,}
66828cae868SHans Verkuil };
66928cae868SHans Verkuil 
67028cae868SHans Verkuil MODULE_DEVICE_TABLE(pci, solo_id_table);
67128cae868SHans Verkuil 
67228cae868SHans Verkuil static struct pci_driver solo_pci_driver = {
67328cae868SHans Verkuil 	.name = SOLO6X10_NAME,
67428cae868SHans Verkuil 	.id_table = solo_id_table,
67528cae868SHans Verkuil 	.probe = solo_pci_probe,
67628cae868SHans Verkuil 	.remove = solo_pci_remove,
67728cae868SHans Verkuil };
67828cae868SHans Verkuil 
67928cae868SHans Verkuil module_pci_driver(solo_pci_driver);
680