login
Login
/
Register
Search
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
July
»
10
Re: Drivers for selfmade hardware
view
thread
!MAILaRCHIVE_VOTE_RePLACE
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From:
Andrew Morton <akpm@...>
To: Michael Buesch <mb@...>
Cc: linux-kernel <linux-kernel@...>
Subject:
Re: Drivers for selfmade hardware
Date: Thursday, July 10, 2008 - 1:45 am
On Sun, 29 Jun 2008 21:47:52 +0200 Michael Buesch <mb@bu3sch.de> wrote:
quoted text
> I'm wondering what the policy is for selfmade hardware > or other hardware where only a few pieces exist. Is it desired > to get drivers for this kind of hardware merged upstream into the > mainline kernel? > > I have a tiny driver that can be used to drive a modified > Brooktree 8xx based card in 24-port GPIO mode. > So the card can be used as a cheap digital PCI GPIO card. > This hardware can be built with some soldering skills, a tiny > soldering tip and a few hours of free time. > > So what's the policy? Push to mainline or keep as seperate > patch? > > (The following patch is not complete, but just what I have for now > to show you...) > > ... > > +#ifdef CONFIG_PM > +static int btgpio_suspend(struct pci_dev *pdev, pm_message_t state) > +{ > + struct btgpio *bg = pci_get_drvdata(pdev); > + unsigned long flags; > + > + spin_lock_irqsave(&bg->lock, flags); > + > + bg->saved_outen = bgread(BT848_GPIO_OUT_EN); > + bg->saved_data = bgread(BT848_GPIO_DATA); > + > + bgwrite(0, BT848_INT_MASK); > + bgwrite(~0x0, BT848_INT_STAT); > + bgwrite(0x0, BT848_GPIO_OUT_EN); > + > + spin_unlock_irqrestore(&bg->lock, flags); > + > + pci_save_state(pdev); > + pci_disable_device(pdev); > + pci_set_power_state(pdev, pci_choose_state(pdev, state)); > + > + return 0; > +} > + > +static int btgpio_resume(struct pci_dev *pdev) > +{ > + struct btgpio *bg = pci_get_drvdata(pdev); > + unsigned long flags; > + int err; > + > + pci_set_power_state(pdev, 0); > + err = pci_enable_device(pdev); > + if (err) > + return err; > + pci_restore_state(pdev); > + > + spin_lock_irqsave(&bg->lock, flags); > + > + bgwrite(0, BT848_INT_MASK); > + bgwrite(0, BT848_GPIO_REG_INP); > + bgwrite(bg->saved_outen, BT848_GPIO_OUT_EN); > + bgwrite(bg->saved_data, BT848_GPIO_DATA); > + > + spin_unlock_irqrestore(&bg->lock, flags); > + > + return 0; > +}
#else #define btgpio_suspend NULL #define btgpio_resume NULL
quoted text
> +#endif /* CONFIG_PM */ > + > +static struct pci_device_id btgpio_pci_tbl[] = { > + { PCI_DEVICE(PCI_VENDOR_ID_BROOKTREE, PCI_DEVICE_ID_BT848) }, > + { PCI_DEVICE(PCI_VENDOR_ID_BROOKTREE, PCI_DEVICE_ID_BT849) }, > + { PCI_DEVICE(PCI_VENDOR_ID_BROOKTREE, PCI_DEVICE_ID_BT878) }, > + { PCI_DEVICE(PCI_VENDOR_ID_BROOKTREE, PCI_DEVICE_ID_BT879) }, > + { 0, }, > +}; > +MODULE_DEVICE_TABLE(pci, btgpio_pci_tbl); > + > +static struct pci_driver btgpio_pci_driver = { > + .name = "btgpio", > + .id_table = btgpio_pci_tbl, > + .probe = btgpio_probe, > + .remove = btgpio_remove, > +#ifdef CONFIG_PM
dd
quoted text
> + .suspend = btgpio_suspend, > + .resume = btgpio_resume, > +#endif
dd
quoted text
> +}; > +
--
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
Drivers for selfmade hardware
, Michael Buesch
, (Sun Jun 29, 3:47 pm)
Re: Drivers for selfmade hardware
, Andrew Morton
, (Thu Jul 10, 1:45 am)
Re: Drivers for selfmade hardware
, Michael Buesch
, (Thu Jul 10, 8:57 am)
Re: Drivers for selfmade hardware
, Andrew Morton
, (Thu Jul 10, 9:13 am)
Re: Drivers for selfmade hardware
, Miguel Ojeda
, (Mon Jun 30, 11:37 am)
Re: Drivers for selfmade hardware
, Hans J. Koch
, (Mon Jun 30, 5:50 am)
Re: Drivers for selfmade hardware
, Michael Buesch
, (Mon Jun 30, 6:00 am)
Re: Drivers for selfmade hardware
, Alan Cox
, (Sun Jun 29, 5:26 pm)
Re: Drivers for selfmade hardware
, Christoph Hellwig
, (Sun Jun 29, 4:01 pm)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Greg Kroah-Hartman
[PATCH 005/196] Chinese: add translation of SubmittingDrivers
David Woodhouse
[PATCHv2 00/28] Allow built-in firmware to be accessed by request_firmware()
Tarkan Erimer
Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3
Mike Travis
[RFC 00/15] x86_64: Optimize percpu accesses
git
:
linux-netdev
:
Gerrit Renker
[PATCH 0/37] dccp: Feature negotiation - last call for comments
David Miller
Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock().
Natalie Protasevich
[BUG] New Kernel Bugs
David Miller
[GIT]: Networking
openbsd-misc
:
Colocation donated by:
Who's online
There are currently
0 users
and
704 guests
online.
Syndicate