[linux-yocto] [PATCH 2/2] valleyisland-io: add patch for Valley Island SPI controller support in ACPI mode

Bruce Ashfield bruce.ashfield at windriver.com
Mon Dec 2 22:07:40 PST 2013


On 12/2/2013, 9:09 PM, rebecca.swee.fun.chang at intel.com wrote:
> From: "Chang, Rebecca Swee Fun" <rebecca.swee.fun.chang at intel.com>
>
> spidev: Enable SPI support in ACPI mode.

Is this change also destined for the mainline kernel ?

Bruce

>
> Signed-off-by: Chang, Rebecca Swee Fun <rebecca.swee.fun.chang at intel.com>
> ---
>   ...d-support-for-SPI-controller-in-ACPI-mode.patch |   69 ++++++++++++++++++++
>   1 file changed, 69 insertions(+)
>   create mode 100644 meta/cfg/kernel-cache/features/valleyisland-io/0018-spidev-add-support-for-SPI-controller-in-ACPI-mode.patch
>
> diff --git a/meta/cfg/kernel-cache/features/valleyisland-io/0018-spidev-add-support-for-SPI-controller-in-ACPI-mode.patch b/meta/cfg/kernel-cache/features/valleyisland-io/0018-spidev-add-support-for-SPI-controller-in-ACPI-mode.patch
> new file mode 100644
> index 0000000..72754f2
> --- /dev/null
> +++ b/meta/cfg/kernel-cache/features/valleyisland-io/0018-spidev-add-support-for-SPI-controller-in-ACPI-mode.patch
> @@ -0,0 +1,69 @@
> +spidev: add support for SPI controller in ACPI mode
> +
> +Code changes are specific to Valley Island platform.
> +
> +Signed-off-by: Chang, Rebecca Swee Fun <rebecca.swee.fun.chang at intel.com>
> +---
> + drivers/spi/spidev.c |   13 +++++++++++++
> + 1 file changed, 13 insertions(+)
> +
> +diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
> +index 2e0655d..10e7cc4 100644
> +--- a/drivers/spi/spidev.c
> ++++ b/drivers/spi/spidev.c
> +@@ -33,6 +33,7 @@
> + #include <linux/compat.h>
> + #include <linux/of.h>
> + #include <linux/of_device.h>
> ++#include <linux/acpi.h>
> +
> + #include <linux/spi/spi.h>
> + #include <linux/spi/spidev.h>
> +@@ -579,6 +580,8 @@ static int spidev_probe(struct spi_device *spi)
> + 	int			status;
> + 	unsigned long		minor;
> +
> ++	printk("%s:enter spidev_probe\n", __func__);
> ++
> + 	/* Allocate driver data */
> + 	spidev = kzalloc(sizeof(*spidev), GFP_KERNEL);
> + 	if (!spidev)
> +@@ -597,6 +600,7 @@ static int spidev_probe(struct spi_device *spi)
> + 	mutex_lock(&device_list_lock);
> + 	minor = find_first_zero_bit(minors, N_SPI_MINORS);
> + 	if (minor < N_SPI_MINORS) {
> ++		printk("%s:enter 1. bus_num %d, chipselect %d\n", __func__, spi->master->bus_num, spi->chip_select);
> + 		struct device *dev;
> +
> + 		spidev->devt = MKDEV(SPIDEV_MAJOR, minor);
> +@@ -605,6 +609,7 @@ static int spidev_probe(struct spi_device *spi)
> + 				    spi->master->bus_num, spi->chip_select);
> + 		status = IS_ERR(dev) ? PTR_ERR(dev) : 0;
> + 	} else {
> ++		printk("%s:no minor num available\n");
> + 		dev_dbg(&spi->dev, "no minor number available!\n");
> + 		status = -ENODEV;
> + 	}
> +@@ -651,11 +656,19 @@ static const struct of_device_id spidev_dt_ids[] = {
> +
> + MODULE_DEVICE_TABLE(of, spidev_dt_ids);
> +
> ++static struct acpi_device_id spidev_acpi_match[] = {
> ++	{ "AUTH2750", 0 },
> ++	{ "SPI1001", 0 },
> ++	{},
> ++};
> ++MODULE_DEVICE_TABLE(acpi, spidev_acpi_match);
> ++
> + static struct spi_driver spidev_spi_driver = {
> + 	.driver = {
> + 		.name =		"spidev",
> + 		.owner =	THIS_MODULE,
> + 		.of_match_table = of_match_ptr(spidev_dt_ids),
> ++		.acpi_match_table = ACPI_PTR(spidev_acpi_match),
> + 	},
> + 	.probe =	spidev_probe,
> + 	.remove =	spidev_remove,
> +--
> +1.7.10.4
> +
>



More information about the linux-yocto mailing list