summaryrefslogtreecommitdiff
path: root/polux/linux-2.6.10
diff options
context:
space:
mode:
authorYacine Belkadi2012-02-24 11:41:13 +0100
committerYacine Belkadi2012-06-11 13:39:47 +0200
commit93f63568f88d8f922301381bb6ef598a8e9c3356 (patch)
treea3f72fd32b86d99b4acc4c0b0f93e7d529250ca9 /polux/linux-2.6.10
parent4a4feb5ea154b56d1eeba7394db12a98b048721c (diff)
polux/linux: adapt the SPI framework, refs #2964
- In 2.6.25, the signature of device_attribute.show() contains a "struct device_attribute *" which isn't present in 2.6.10. Anyway, modalias_show() was not using it. - bus_type.hotplug() add_hotplug_env_var() are what became bus_type.uevent() and add_uevent_var() in 2.6.25. TODO: - adapt class-sysfs code - check drivers unregistration, especially in light of the comment "/* note: before about 2.6.14-rc1 this would corrupt memory: */"
Diffstat (limited to 'polux/linux-2.6.10')
-rw-r--r--polux/linux-2.6.10/drivers/spi/Kconfig184
-rw-r--r--polux/linux-2.6.10/drivers/spi/Makefile21
-rw-r--r--polux/linux-2.6.10/drivers/spi/spi.c27
-rw-r--r--polux/linux-2.6.10/include/linux/spi/spi.h2
4 files changed, 19 insertions, 215 deletions
diff --git a/polux/linux-2.6.10/drivers/spi/Kconfig b/polux/linux-2.6.10/drivers/spi/Kconfig
index 498c6cef03..cde08ce5dd 100644
--- a/polux/linux-2.6.10/drivers/spi/Kconfig
+++ b/polux/linux-2.6.10/drivers/spi/Kconfig
@@ -6,7 +6,6 @@
# fully appropriate there, so it'd need some thought to do well.
#
menu "SPI support"
- depends on HAS_IOMEM
config SPI
bool "SPI support"
@@ -52,160 +51,6 @@ config SPI_MASTER
comment "SPI Master Controller Drivers"
depends on SPI_MASTER
-config SPI_ATMEL
- tristate "Atmel SPI Controller"
- depends on (ARCH_AT91 || AVR32) && SPI_MASTER
- help
- This selects a driver for the Atmel SPI Controller, present on
- many AT32 (AVR32) and AT91 (ARM) chips.
-
-config SPI_SPC300
- tristate "SPiDCOM SPI Controller"
- depends on (ARCH_SPC300) && SPI_MASTER
- help
- This selects a driver for the SPiDCOM SPI Controller, present on
- SPC300 (ARM) chips.
-
-config SPI_BFIN
- tristate "SPI controller driver for ADI Blackfin5xx"
- depends on SPI_MASTER && BLACKFIN
- help
- This is the SPI controller master driver for Blackfin 5xx processor.
-
-config SPI_AU1550
- tristate "Au1550/Au12x0 SPI Controller"
- depends on SPI_MASTER && (SOC_AU1550 || SOC_AU1200) && EXPERIMENTAL
- select SPI_BITBANG
- help
- If you say yes to this option, support will be included for the
- Au1550 SPI controller (may also work with Au1200,Au1210,Au1250).
-
- This driver can also be built as a module. If so, the module
- will be called au1550_spi.
-
-config SPI_BITBANG
- tristate "Bitbanging SPI master"
- depends on SPI_MASTER && EXPERIMENTAL
- help
- With a few GPIO pins, your system can bitbang the SPI protocol.
- Select this to get SPI support through I/O pins (GPIO, parallel
- port, etc). Or, some systems' SPI master controller drivers use
- this code to manage the per-word or per-transfer accesses to the
- hardware shift registers.
-
- This is library code, and is automatically selected by drivers that
- need it. You only need to select this explicitly to support driver
- modules that aren't part of this kernel tree.
-
-config SPI_BUTTERFLY
- tristate "Parallel port adapter for AVR Butterfly (DEVELOPMENT)"
- depends on SPI_MASTER && PARPORT && EXPERIMENTAL
- select SPI_BITBANG
- help
- This uses a custom parallel port cable to connect to an AVR
- Butterfly <http://www.atmel.com/products/avr/butterfly>, an
- inexpensive battery powered microcontroller evaluation board.
- This same cable can be used to flash new firmware.
-
-config SPI_IMX
- tristate "Freescale iMX SPI controller"
- depends on SPI_MASTER && ARCH_IMX && EXPERIMENTAL
- help
- This enables using the Freescale iMX SPI controller in master
- mode.
-
-config SPI_LM70_LLP
- tristate "Parallel port adapter for LM70 eval board (DEVELOPMENT)"
- depends on SPI_MASTER && PARPORT && EXPERIMENTAL
- select SPI_BITBANG
- help
- This driver supports the NS LM70 LLP Evaluation Board,
- which interfaces to an LM70 temperature sensor using
- a parallel port.
-
-config SPI_MPC52xx_PSC
- tristate "Freescale MPC52xx PSC SPI controller"
- depends on SPI_MASTER && PPC_MPC52xx && EXPERIMENTAL
- help
- This enables using the Freescale MPC52xx Programmable Serial
- Controller in master SPI mode.
-
-config SPI_MPC83xx
- tristate "Freescale MPC83xx/QUICC Engine SPI controller"
- depends on SPI_MASTER && (PPC_83xx || QUICC_ENGINE) && EXPERIMENTAL
- select SPI_BITBANG
- help
- This enables using the Freescale MPC83xx and QUICC Engine SPI
- controllers in master mode.
-
- Note, this driver uniquely supports the SPI controller on the MPC83xx
- family of PowerPC processors, plus processors with QUICC Engine
- technology. This driver uses a simple set of shift registers for data
- (opposed to the CPM based descriptor model).
-
-config SPI_OMAP_UWIRE
- tristate "OMAP1 MicroWire"
- depends on SPI_MASTER && ARCH_OMAP1
- select SPI_BITBANG
- help
- This hooks up to the MicroWire controller on OMAP1 chips.
-
-config SPI_OMAP24XX
- tristate "McSPI driver for OMAP24xx/OMAP34xx"
- depends on SPI_MASTER && (ARCH_OMAP24XX || ARCH_OMAP34XX)
- help
- SPI master controller for OMAP24xx/OMAP34xx Multichannel SPI
- (McSPI) modules.
-
-config SPI_PXA2XX
- tristate "PXA2xx SSP SPI master"
- depends on SPI_MASTER && ARCH_PXA && EXPERIMENTAL
- select PXA_SSP
- help
- This enables using a PXA2xx SSP port as a SPI master controller.
- The driver can be configured to use any SSP port and additional
- documentation can be found a Documentation/spi/pxa2xx.
-
-config SPI_S3C24XX
- tristate "Samsung S3C24XX series SPI"
- depends on SPI_MASTER && ARCH_S3C2410 && EXPERIMENTAL
- select SPI_BITBANG
- help
- SPI driver for Samsung S3C24XX series ARM SoCs
-
-config SPI_S3C24XX_GPIO
- tristate "Samsung S3C24XX series SPI by GPIO"
- depends on SPI_MASTER && ARCH_S3C2410 && EXPERIMENTAL
- select SPI_BITBANG
- help
- SPI driver for Samsung S3C24XX series ARM SoCs using
- GPIO lines to provide the SPI bus. This can be used where
- the inbuilt hardware cannot provide the transfer mode, or
- where the board is using non hardware connected pins.
-
-config SPI_SH_SCI
- tristate "SuperH SCI SPI controller"
- depends on SPI_MASTER && SUPERH
- select SPI_BITBANG
- help
- SPI driver for SuperH SCI blocks.
-
-config SPI_TXX9
- tristate "Toshiba TXx9 SPI controller"
- depends on SPI_MASTER && GENERIC_GPIO && CPU_TX49XX
- help
- SPI driver for Toshiba TXx9 MIPS SoCs
-
-config SPI_XILINX
- tristate "Xilinx SPI controller"
- depends on SPI_MASTER && XILINX_VIRTEX && EXPERIMENTAL
- select SPI_BITBANG
- help
- This exposes the SPI controller IP from the Xilinx EDK.
-
- See the "OPB Serial Peripheral Interface (SPI) (v1.00e)"
- Product Specification document (DS464) for hardware details.
-
#
# Add new SPI master controllers in alphabetical order above this line
#
@@ -217,35 +62,6 @@ config SPI_XILINX
comment "SPI Protocol Masters"
depends on SPI_MASTER
-config SPI_AT25
- tristate "SPI EEPROMs from most vendors"
- depends on SPI_MASTER && SYSFS
- help
- Enable this driver to get read/write support to most SPI EEPROMs,
- after you configure the board init code to know about each eeprom
- on your target board.
-
- This driver can also be built as a module. If so, the module
- will be called at25.
-
-config SPI_SPIDEV
- tristate "User mode SPI device driver support"
- depends on SPI_MASTER && EXPERIMENTAL
- help
- This supports user mode SPI protocol drivers.
-
- Note that this application programming interface is EXPERIMENTAL
- and hence SUBJECT TO CHANGE WITHOUT NOTICE while it stabilizes.
-
-config SPI_TLE62X0
- tristate "Infineon TLE62X0 (for power switching)"
- depends on SPI_MASTER && SYSFS
- help
- SPI driver for Infineon TLE62X0 series line driver chips,
- such as the TLE6220, TLE6230 and TLE6240. This provides a
- sysfs interface, with each line presented as a kind of GPIO
- exposing both switch control and diagnostic feedback.
-
#
# Add new SPI protocol masters in alphabetical order above this line
#
diff --git a/polux/linux-2.6.10/drivers/spi/Makefile b/polux/linux-2.6.10/drivers/spi/Makefile
index 1b15600c1a..afd2321753 100644
--- a/polux/linux-2.6.10/drivers/spi/Makefile
+++ b/polux/linux-2.6.10/drivers/spi/Makefile
@@ -11,30 +11,9 @@ endif
obj-$(CONFIG_SPI_MASTER) += spi.o
# SPI master controller drivers (bus)
-obj-$(CONFIG_SPI_ATMEL) += atmel_spi.o
-obj-$(CONFIG_SPI_BFIN) += spi_bfin5xx.o
-obj-$(CONFIG_SPI_BITBANG) += spi_bitbang.o
-obj-$(CONFIG_SPI_AU1550) += au1550_spi.o
-obj-$(CONFIG_SPI_BUTTERFLY) += spi_butterfly.o
-obj-$(CONFIG_SPI_IMX) += spi_imx.o
-obj-$(CONFIG_SPI_LM70_LLP) += spi_lm70llp.o
-obj-$(CONFIG_SPI_PXA2XX) += pxa2xx_spi.o
-obj-$(CONFIG_SPI_OMAP_UWIRE) += omap_uwire.o
-obj-$(CONFIG_SPI_OMAP24XX) += omap2_mcspi.o
-obj-$(CONFIG_SPI_MPC52xx_PSC) += mpc52xx_psc_spi.o
-obj-$(CONFIG_SPI_MPC83xx) += spi_mpc83xx.o
-obj-$(CONFIG_SPI_S3C24XX_GPIO) += spi_s3c24xx_gpio.o
-obj-$(CONFIG_SPI_S3C24XX) += spi_s3c24xx.o
-obj-$(CONFIG_SPI_TXX9) += spi_txx9.o
-obj-$(CONFIG_SPI_XILINX) += xilinx_spi.o
-obj-$(CONFIG_SPI_SH_SCI) += spi_sh_sci.o
-obj-$(CONFIG_SPI_SPC300) += spc300_spi.o
# ... add above this line ...
# SPI protocol drivers (device/link on bus)
-obj-$(CONFIG_SPI_AT25) += at25.o
-obj-$(CONFIG_SPI_SPIDEV) += spidev.o
-obj-$(CONFIG_SPI_TLE62X0) += tle62x0.o
# ... add above this line ...
# SPI slave controller drivers (upstream link)
diff --git a/polux/linux-2.6.10/drivers/spi/spi.c b/polux/linux-2.6.10/drivers/spi/spi.c
index 1ad12afc6b..f196dba214 100644
--- a/polux/linux-2.6.10/drivers/spi/spi.c
+++ b/polux/linux-2.6.10/drivers/spi/spi.c
@@ -43,7 +43,7 @@ static void spidev_release(struct device *dev)
}
static ssize_t
-modalias_show(struct device *dev, struct device_attribute *a, char *buf)
+modalias_show(struct device *dev, char *buf)
{
const struct spi_device *spi = to_spi_device(dev);
@@ -66,11 +66,15 @@ static int spi_match_device(struct device *dev, struct device_driver *drv)
return strncmp(spi->modalias, drv->name, BUS_ID_SIZE) == 0;
}
-static int spi_uevent(struct device *dev, struct kobj_uevent_env *env)
+static int spi_hotplug(struct device *dev, char **envp, int num_envp,
+ char *buffer, int buffer_size)
{
+ int cur_index = 0;
+ int cur_len = 0;
const struct spi_device *spi = to_spi_device(dev);
- add_uevent_var(env, "MODALIAS=%s", spi->modalias);
+ add_hotplug_env_var(envp, num_envp, &cur_index, buffer, buffer_size,
+ &cur_len, "MODALIAS=%s", spi->modalias);
return 0;
}
@@ -115,7 +119,7 @@ struct bus_type spi_bus_type = {
.name = "spi",
.dev_attrs = spi_dev_attrs,
.match = spi_match_device,
- .uevent = spi_uevent,
+ .hotplug = spi_hotplug,
.suspend = spi_suspend,
.resume = spi_resume,
};
@@ -330,7 +334,7 @@ static void scan_boardinfo(struct spi_master *master)
}
/*-------------------------------------------------------------------------*/
-
+#if 0
static void spi_master_release(struct device *dev)
{
struct spi_master *master;
@@ -339,10 +343,12 @@ static void spi_master_release(struct device *dev)
kfree(master);
}
+#endif /* 0 */
+
static struct class spi_master_class = {
.name = "spi_master",
- .owner = THIS_MODULE,
- .dev_release = spi_master_release,
+ //.owner = THIS_MODULE,
+ //.dev_release = spi_master_release,
};
@@ -377,7 +383,7 @@ struct spi_master *spi_alloc_master(struct device *dev, unsigned size)
return NULL;
device_initialize(&master->dev);
- master->dev.class = &spi_master_class;
+ //master->dev.class = &spi_master_class;
master->dev.parent = get_device(dev);
spi_master_set_devdata(master, &master[1]);
@@ -478,6 +484,8 @@ void spi_unregister_master(struct spi_master *master)
}
EXPORT_SYMBOL_GPL(spi_unregister_master);
+#if 0
+
static int __spi_master_match(struct device *dev, void *data)
{
struct spi_master *m;
@@ -487,6 +495,7 @@ static int __spi_master_match(struct device *dev, void *data)
return m->bus_num == *bus_num;
}
+
/**
* spi_busnum_to_master - look up master associated with bus_num
* @bus_num: the master's bus number
@@ -511,6 +520,7 @@ struct spi_master *spi_busnum_to_master(u16 bus_num)
}
EXPORT_SYMBOL_GPL(spi_busnum_to_master);
+#endif /* 0 */
/*-------------------------------------------------------------------------*/
@@ -674,4 +684,3 @@ err0:
* include needing to have boardinfo data structures be much more public.
*/
subsys_initcall(spi_init);
-
diff --git a/polux/linux-2.6.10/include/linux/spi/spi.h b/polux/linux-2.6.10/include/linux/spi/spi.h
index 387e428f1c..1f323176e6 100644
--- a/polux/linux-2.6.10/include/linux/spi/spi.h
+++ b/polux/linux-2.6.10/include/linux/spi/spi.h
@@ -169,7 +169,7 @@ struct spi_driver {
int (*probe)(struct spi_device *spi);
int (*remove)(struct spi_device *spi);
void (*shutdown)(struct spi_device *spi);
- int (*suspend)(struct spi_device *spi, pm_message_t mesg);
+ int (*suspend)(struct spi_device *spi);
int (*resume)(struct spi_device *spi);
struct device_driver driver;
};