staging/dream: add gpio and pmem support
Subsystems (3)
This adds generic_gpio and pmem support, both are needed for other dream drivers.
drivers/staging/dream/generic_gpio.c new file +274 -0
@@ -0,0 +1,274 @@ +/* arch/arm/mach-msm/generic_gpio.c +* +* Copyright (C) 2007 Google, Inc. +* +* This software is licensed under the terms of the GNU General Public +* License version 2, as published by the Free Software Foundation, and +* may be copied, distributed, and modified under those terms. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +*/ + +#include <linux/kernel.h> +#include <linux/module.h> +#include <linux/errno.h> +#include <linux/slab.h> +#include <linux/spinlock.h> +#include <asm/gpio.h> +#include "gpio_chip.h" + +#define GPIO_NUM_TO_CHIP_INDEX (gpio) ((gpio)>>5) + +struct gpio_state { +unsigned long flags; +int refcount; +}; + +static DEFINE_SPINLOCK (gpio_chips_lock); +static LIST_HEAD (gpio_chip_list); +static struct gpio_chip **gpio_chip_array; +static unsigned long gpio_chip_array_size; + +int register_gpio_chip (struct gpio_chip *new_gpio_chip) +{ +int err =0 ; +struct gpio_chip *gpio_chip; +int i; +unsigned long irq_flags; +unsigned int chip_array_start_index, chip_array_end_index; + + new_gpio_chip->state =kzalloc ((new_gpio_chip->end +1 - new_gpio_chip->start) *sizeof (new_gpio_chip->state[0 ]),GFP_KERNEL ); +if (new_gpio_chip->state ==NULL ) { +printk (KERN_ERR "register_gpio_chip: failed to allocate state\n" ); +return -ENOMEM ; + } + +spin_lock_irqsave (&gpio_chips_lock, irq_flags); + chip_array_start_index =GPIO_NUM_TO_CHIP_INDEX (new_gpio_chip->start); + chip_array_end_index =GPIO_NUM_TO_CHIP_INDEX (new_gpio_chip->end); +if (chip_array_end_index >= gpio_chip_array_size) { +struct gpio_chip **new_gpio_chip_array; +unsigned long new_gpio_chip_array_size = chip_array_end_index +1 ; + + new_gpio_chip_array =kmalloc (new_gpio_chip_array_size *sizeof (new_gpio_chip_array[0 ]),GFP_ATOMIC ); +if (new_gpio_chip_array ==NULL ) { +printk (KERN_ERR "register_gpio_chip: failed to allocate array\n" ); + err = -ENOMEM ; + goto failed; + } +for (i =0 ; i < gpio_chip_array_size; i++) + new_gpio_chip_array[i] = gpio_chip_array[i]; +for (i = gpio_chip_array_size; i < new_gpio_chip_array_size; i++) + new_gpio_chip_array[i] =NULL ; + gpio_chip_array = new_gpio_chip_array; + gpio_chip_array_size = new_gpio_chip_array_size; + } +list_for_each_entry (gpio_chip, &gpio_chip_list, list) { +if (gpio_chip->start > new_gpio_chip->end) { +list_add_tail (&new_gpio_chip->list, &gpio_chip->list); + goto added; + } +if (gpio_chip->end >= new_gpio_chip->start) { +printk (KERN_ERR "register_gpio_source %u-%u overlaps with %u-%u\n" , + new_gpio_chip->start, new_gpio_chip->end, + gpio_chip->start, gpio_chip->end); + err = -EBUSY ; + goto failed; + } + } +list_add_tail (&new_gpio_chip->list, &gpio_chip_list); +added: +for (i = chip_array_start_index; i <= chip_array_end_index; i++) { +if (gpio_chip_array[i] ==NULL || gpio_chip_array[i]->start > new_gpio_chip->start) + gpio_chip_array[i] = new_gpio_chip; + } +failed: +spin_unlock_irqrestore (&gpio_chips_lock, irq_flags); +if (err) +kfree (new_gpio_chip->state); +return err; +} + +static struct gpio_chip *get_gpio_chip_locked (unsigned int gpio) +{ +unsigned long i; +struct gpio_chip *chip; + + i =GPIO_NUM_TO_CHIP_INDEX (gpio); +if (i >= gpio_chip_array_size) +return NULL ; + chip = gpio_chip_array[i]; +if (chip ==NULL ) +return NULL ; +list_for_each_entry_from (chip, &gpio_chip_list, list) { +if (gpio < chip->start) +return NULL ; +if (gpio <= chip->end) +return chip; + } +return NULL ; +} + +static int request_gpio (unsigned int gpio,unsigned long flags) +{ +int err =0 ; +struct gpio_chip *chip; +unsigned long irq_flags; +unsigned long chip_index; + +spin_lock_irqsave (&gpio_chips_lock, irq_flags); + chip =get_gpio_chip_locked (gpio); +if (chip ==NULL ) { + err = -EINVAL ; + goto err; + } + chip_index = gpio - chip->start; +if (chip->state[chip_index].refcount ==0 ) { + chip->configure (chip, gpio, flags); + chip->state[chip_index].flags = flags; + chip->state[chip_index].refcount++; + }else if ((flags &IRQF_SHARED ) && (chip->state[chip_index].flags &IRQF_SHARED )) + chip->state[chip_index].refcount++; +else + err = -EBUSY ; +err: +spin_unlock_irqrestore (&gpio_chips_lock, irq_flags); +return err; +} + +int gpio_request (unsigned gpio,const char *label) +{ +return request_gpio (gpio,0 ); +} +EXPORT_SYMBOL (gpio_request); + +void gpio_free (unsigned gpio) +{ +struct gpio_chip *chip; +unsigned long irq_flags; +unsigned long chip_index; + +spin_lock_irqsave (&gpio_chips_lock, irq_flags); + chip =get_gpio_chip_locked (gpio); +if (chip) { + chip_index = gpio - chip->start; + chip->state[chip_index].refcount--; + } +spin_unlock_irqrestore (&gpio_chips_lock, irq_flags); +} +EXPORT_SYMBOL (gpio_free); + +static int gpio_get_irq_num (unsigned int gpio,unsigned int *irqp,unsigned long *irqnumflagsp) +{ +int ret = -ENOTSUPP ; +struct gpio_chip *chip; +unsigned long irq_flags; + +spin_lock_irqsave (&gpio_chips_lock, irq_flags); + chip =get_gpio_chip_locked (gpio); +if (chip && chip->get_irq_num) + ret = chip->get_irq_num (chip, gpio, irqp, irqnumflagsp); +spin_unlock_irqrestore (&gpio_chips_lock, irq_flags); +return ret; +} + +int gpio_to_irq (unsigned gpio) +{ +int ret, irq; + ret =gpio_get_irq_num (gpio, &irq,NULL ); +if (ret) +return ret; +return irq; +} +EXPORT_SYMBOL (gpio_to_irq); + +int gpio_configure (unsigned int gpio,unsigned long flags) +{ +int ret = -ENOTSUPP ; +struct gpio_chip *chip; +unsigned long irq_flags; + +spin_lock_irqsave (&gpio_chips_lock, irq_flags); + chip =get_gpio_chip_locked (gpio); +if (chip) + ret = chip->configure (chip, gpio, flags); +spin_unlock_irqrestore (&gpio_chips_lock, irq_flags); +return ret; +} +EXPORT_SYMBOL (gpio_configure); + +int gpio_direction_input (unsigned gpio) +{ +return gpio_configure (gpio,GPIOF_INPUT ); +} +EXPORT_SYMBOL (gpio_direction_input); + +int gpio_direction_output (unsigned gpio,int value) +{ +gpio_set_value (gpio, value); +return gpio_configure (gpio,GPIOF_DRIVE_OUTPUT ); +} +EXPORT_SYMBOL (gpio_direction_output); + +int gpio_get_value (unsigned gpio) +{ +int ret = -ENOTSUPP ; +struct gpio_chip *chip; +unsigned long irq_flags; + +spin_lock_irqsave (&gpio_chips_lock, irq_flags); + chip =get_gpio_chip_locked (gpio); +if (chip && chip->read) + ret = chip->read (chip, gpio); +spin_unlock_irqrestore (&gpio_chips_lock, irq_flags); +return ret; +} +EXPORT_SYMBOL (gpio_get_value); + +void gpio_set_value (unsigned gpio,int on) +{ +int ret = -ENOTSUPP ; +struct gpio_chip *chip; +unsigned long irq_flags; + +spin_lock_irqsave (&gpio_chips_lock, irq_flags); + chip =get_gpio_chip_locked (gpio); +if (chip && chip->write) + ret = chip->write (chip, gpio, on); +spin_unlock_irqrestore (&gpio_chips_lock, irq_flags); +} +EXPORT_SYMBOL (gpio_set_value); + +int gpio_read_detect_status (unsigned int gpio) +{ +int ret = -ENOTSUPP ; +struct gpio_chip *chip; +unsigned long irq_flags; + +spin_lock_irqsave (&gpio_chips_lock, irq_flags); + chip =get_gpio_chip_locked (gpio); +if (chip && chip->read_detect_status) + ret = chip->read_detect_status (chip, gpio); +spin_unlock_irqrestore (&gpio_chips_lock, irq_flags); +return ret; +} +EXPORT_SYMBOL (gpio_read_detect_status); + +int gpio_clear_detect_status (unsigned int gpio) +{ +int ret = -ENOTSUPP ; +struct gpio_chip *chip; +unsigned long irq_flags; + +spin_lock_irqsave (&gpio_chips_lock, irq_flags); + chip =get_gpio_chip_locked (gpio); +if (chip && chip->clear_detect_status) + ret = chip->clear_detect_status (chip, gpio); +spin_unlock_irqrestore (&gpio_chips_lock, irq_flags); +return ret; +} +EXPORT_SYMBOL (gpio_clear_detect_status);
drivers/staging/dream/pmem.c new file +1335 -0
1,335 lines not on this page · raw message
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 5 lines · Pavel Machek
This adds
generic_gpioand pmem support, both are needed for other dream drivers.Signed-off-by Pavel Machek <[email protected]>
I'd prefer to get the existing code building, before adding new stuff :(
thanks,
greg k-h
Hi!
Quoted 6 lines
Quoted 4 lines
This adds
generic_gpioand pmem support, both are needed for other dream drivers.Signed-off-by Pavel Machek <[email protected]>I'd prefer to get the existing code building, before adding new stuff :(
Well, unfortunately other pieces depend on these.
I have it building with this patch (but note that it uses -I magic; I started to write script rewriting files so that -I is not neccessary, but I did not have time to finish it yet).
---
Add missing files/includes neccessary for Dream compilation.
drivers/staging/dream/Kconfig +36 -1
@@ -2,11 +2,46 @@ source "drivers/staging/dream/smd/Kconfig" source "drivers/staging/dream/camera/Kconfig" +config MSM_AMSS_VERSION + int + default 6210 if MSM_AMSS_VERSION_6210 + default 6220 if MSM_AMSS_VERSION_6220 + default 6225 if MSM_AMSS_VERSION_6225 + default 6350 if MSM_AMSS_VERSION_6350 + +choice + prompt "AMSS modem firmware version" + + default MSM_AMSS_VERSION_6225 + + config MSM_AMSS_VERSION_6210 + bool "6.2.10" + + config MSM_AMSS_VERSION_6220 + bool "6.2.20" + + config MSM_AMSS_VERSION_6225 + bool "6.2.20 + New ADSP" + + config MSM_AMSS_VERSION_6350 + bool "6.3.50" +endchoice + +config MSM_ADSP + tristate "MSM ADSP driver" + default y + help + Provides access to registers needed by the userspace aDSP library. config INPUT_GPIO tristate "GPIO driver support" help Say Y here if you want to support gpio based keys, wheels etc... +config GENERIC_GPIO + bool + default y - +config ANDROID_PMEM + bool "Android pmem allocator" + default y
drivers/staging/dream/Makefile +3 -0
@@ -1,4 +1,7 @@ +EXTRA_CFLAGS=-Idrivers/staging/dream/include obj-$(CONFIG_MSM_ADSP) += qdsp5/ smd/ obj-$(CONFIG_MSM_CAMERA) += camera/ obj-$(CONFIG_INPUT_GPIO) += gpio_axis.o gpio_event.o gpio_input.o gpio_matrix.o gpio_output.o +obj-$(CONFIG_ANDROID_PMEM) += pmem.o +obj-y += generic_gpio.o
drivers/staging/dream/camera/Kconfig +1 -1
@@ -15,7 +15,7 @@ config MSM_CAMERA_DEBUG config MSM_CAMERA_FLASH bool "Qualcomm MSM camera flash support" - depends on MSM_CAMERA + depends on MSM_CAMERA && BROKEN ---help--- Enable support for LED flash for msm camera
drivers/staging/dream/camera/Makefile +1 -0
@@ -1,3 +1,4 @@ +EXTRA_CFLAGS=-Idrivers/staging/dream/include obj-$(CONFIG_MT9T013) += mt9t013.o mt9t013_reg.o obj-$(CONFIG_MT9D112) += mt9d112.o mt9d112_reg.o obj-$(CONFIG_MT9P012) += mt9p012_fox.o mt9p012_reg.o
drivers/staging/dream/include/linux/android_pmem.h new file +80 -0
80 lines not on this page · raw message
drivers/staging/dream/include/linux/gpio_event.h new file +154 -0
154 lines not on this page · raw message
drivers/staging/dream/include/linux/msm_adsp.h new file +84 -0
84 lines not on this page · raw message
drivers/staging/dream/include/linux/msm_audio.h new file +115 -0
115 lines not on this page · raw message
drivers/staging/dream/include/linux/msm_rpcrouter.h new file +47 -0
47 lines not on this page · raw message
drivers/staging/dream/include/linux/wakelock.h new file +91 -0
91 lines not on this page · raw message
drivers/staging/dream/include/mach/camera.h new file +279 -0
279 lines not on this page · raw message
drivers/staging/dream/include/mach/msm_adsp.h new file +112 -0
112 lines not on this page · raw message
drivers/staging/dream/include/mach/msm_rpcrouter.h new file +179 -0
179 lines not on this page · raw message
drivers/staging/dream/include/mach/msm_smd.h new file +107 -0
107 lines not on this page · raw message
drivers/staging/dream/include/mach/qdsp5/qdsp5audplaycmdi.h new file +94 -0
94 lines not on this page · raw message
drivers/staging/dream/include/mach/qdsp5/qdsp5audplaymsg.h new file +70 -0
70 lines not on this page · raw message
drivers/staging/dream/include/mach/qdsp5/qdsp5audppcmdi.h new file +914 -0
914 lines not on this page · raw message
drivers/staging/dream/include/mach/qdsp5/qdsp5audppmsg.h new file +318 -0
318 lines not on this page · raw message
drivers/staging/dream/include/mach/qdsp5/qdsp5audpreproccmdi.h new file +256 -0
256 lines not on this page · raw message
drivers/staging/dream/include/mach/qdsp5/qdsp5audpreprocmsg.h new file +85 -0
34 lines not on this page · raw message
drivers/staging/dream/include/mach/qdsp5/qdsp5audreccmdi.h new file +176 -0
176 lines not on this page · raw message
drivers/staging/dream/include/mach/qdsp5/qdsp5audrecmsg.h new file +127 -0
127 lines not on this page · raw message
drivers/staging/dream/include/mach/qdsp5/qdsp5jpegcmdi.h new file +376 -0
376 lines not on this page · raw message
drivers/staging/dream/include/mach/qdsp5/qdsp5jpegmsg.h new file +177 -0
177 lines not on this page · raw message
drivers/staging/dream/include/mach/qdsp5/qdsp5lpmcmdi.h new file +82 -0
82 lines not on this page · raw message
drivers/staging/dream/include/mach/qdsp5/qdsp5lpmmsg.h new file +80 -0
80 lines not on this page · raw message
drivers/staging/dream/include/mach/qdsp5/qdsp5vdeccmdi.h new file +235 -0
235 lines not on this page · raw message
drivers/staging/dream/include/mach/qdsp5/qdsp5vdecmsg.h new file +107 -0
107 lines not on this page · raw message
drivers/staging/dream/include/mach/qdsp5/qdsp5venccmdi.h new file +212 -0
212 lines not on this page · raw message
drivers/staging/dream/include/mach/qdsp5/qdsp5vfecmdi.h new file +910 -0
910 lines not on this page · raw message
drivers/staging/dream/include/mach/qdsp5/qdsp5vfemsg.h new file +290 -0
290 lines not on this page · raw message
drivers/staging/dream/include/media/msm_camera.h new file +388 -0
388 lines not on this page · raw message
include/linux/msm_mdp.h new file +86 -0
86 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Part of the diff is not shown here. View the raw message.
Quoted 10 lines · Pavel Machek
Hi!
Quoted 6 lines
Quoted 4 lines
This adds
generic_gpioand pmem support, both are needed for other dream drivers.Signed-off-by Pavel Machek <[email protected]>I'd prefer to get the existing code building, before adding new stuff :(
Well, unfortunately other pieces depend on these.
The pieces already in the tree? Why are you sending me patches that do not build?
Quoted 3 lines
I have it building with this patch (but note that it uses -I magic; I started to write script rewriting files so that -I is not neccessary, but I did not have time to finish it yet).
Ok, should I just delete the whole drivers/staging/dream/ directory as there seems no goal to get this to build properly? I've just marked the code as BROKEN, any chance to get it building again soon?
thanks,
greg k-h
Quoted 6 lines · Greg KH
Quoted 5 lines · Pavel Machek
Hi!
Quoted 3 lines
Quoted 3 lines
This adds
generic_gpioand pmem support, both are needed for other dream drivers.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Pavel Machek <[email protected]>I'd prefer to get the existing code building, before adding new stuff :(
Well, unfortunately other pieces depend on these.
The pieces already in the tree?
Yes :-(.
Quoted 2 lines
Why are you sending me patches that do
not build?
I did not realize how much was those drivers depenend on arch-specific part.
Quoted 7 lines
Quoted 3 lines
I have it building with this patch (but note that it uses -I magic; I started to write script rewriting files so that -I is not neccessary, but I did not have time to finish it yet).
Ok, should I just delete the whole
drivers/staging/dream/directory as there seems no goal to get this to build properly? I've just marked the code as BROKEN, any chance to get it building again soon?
Could we perhaps use -I to let it build before I find time to do search&replace of 100 #includes? Yes, I'm working on that, but no, it obviously does not progress as fast as I expected...
Pavel
Add missing files/includes neccessary for Dream compilation.
drivers/staging/dream/Kconfig +36 -1
@@ -2,11 +2,46 @@ source "drivers/staging/dream/smd/Kconfig" source "drivers/staging/dream/camera/Kconfig" +config MSM_AMSS_VERSION + int + default 6210 if MSM_AMSS_VERSION_6210 + default 6220 if MSM_AMSS_VERSION_6220 + default 6225 if MSM_AMSS_VERSION_6225 + default 6350 if MSM_AMSS_VERSION_6350 + +choice + prompt "AMSS modem firmware version" + + default MSM_AMSS_VERSION_6225 + + config MSM_AMSS_VERSION_6210 + bool "6.2.10" + + config MSM_AMSS_VERSION_6220 + bool "6.2.20" + + config MSM_AMSS_VERSION_6225 + bool "6.2.20 + New ADSP" + + config MSM_AMSS_VERSION_6350 + bool "6.3.50" +endchoice + +config MSM_ADSP + tristate "MSM ADSP driver" + default y + help + Provides access to registers needed by the userspace aDSP library. config INPUT_GPIO tristate "GPIO driver support" help Say Y here if you want to support gpio based keys, wheels etc... +config GENERIC_GPIO + bool + default y - +config ANDROID_PMEM + bool "Android pmem allocator" + default y
drivers/staging/dream/Makefile +3 -0
@@ -1,4 +1,7 @@ +EXTRA_CFLAGS=-Idrivers/staging/dream/include obj-$(CONFIG_MSM_ADSP) += qdsp5/ smd/ obj-$(CONFIG_MSM_CAMERA) += camera/ obj-$(CONFIG_INPUT_GPIO) += gpio_axis.o gpio_event.o gpio_input.o gpio_matrix.o gpio_output.o +obj-$(CONFIG_ANDROID_PMEM) += pmem.o +obj-y += generic_gpio.o
drivers/staging/dream/camera/Kconfig +1 -1
@@ -15,7 +15,7 @@ config MSM_CAMERA_DEBUG config MSM_CAMERA_FLASH bool "Qualcomm MSM camera flash support" - depends on MSM_CAMERA + depends on MSM_CAMERA && BROKEN ---help--- Enable support for LED flash for msm camera
drivers/staging/dream/camera/Makefile +1 -0
@@ -1,3 +1,4 @@ +EXTRA_CFLAGS=-Idrivers/staging/dream/include obj-$(CONFIG_MT9T013) += mt9t013.o mt9t013_reg.o obj-$(CONFIG_MT9D112) += mt9d112.o mt9d112_reg.o obj-$(CONFIG_MT9P012) += mt9p012_fox.o mt9p012_reg.o
drivers/staging/dream/include/linux/android_pmem.h new file +80 -0
80 lines not on this page · raw message
drivers/staging/dream/include/linux/gpio_event.h new file +154 -0
154 lines not on this page · raw message
drivers/staging/dream/include/linux/msm_adsp.h new file +84 -0
84 lines not on this page · raw message
drivers/staging/dream/include/linux/msm_audio.h new file +115 -0
115 lines not on this page · raw message
drivers/staging/dream/include/linux/msm_rpcrouter.h new file +47 -0
47 lines not on this page · raw message
drivers/staging/dream/include/linux/wakelock.h new file +91 -0
91 lines not on this page · raw message
drivers/staging/dream/include/mach/camera.h new file +279 -0
279 lines not on this page · raw message
drivers/staging/dream/include/mach/msm_adsp.h new file +112 -0
112 lines not on this page · raw message
drivers/staging/dream/include/mach/msm_rpcrouter.h new file +179 -0
179 lines not on this page · raw message
drivers/staging/dream/include/mach/msm_smd.h new file +107 -0
107 lines not on this page · raw message
drivers/staging/dream/include/mach/qdsp5/qdsp5audplaycmdi.h new file +94 -0
94 lines not on this page · raw message
drivers/staging/dream/include/mach/qdsp5/qdsp5audplaymsg.h new file +70 -0
70 lines not on this page · raw message
drivers/staging/dream/include/mach/qdsp5/qdsp5audppcmdi.h new file +914 -0
914 lines not on this page · raw message
drivers/staging/dream/include/mach/qdsp5/qdsp5audppmsg.h new file +318 -0
318 lines not on this page · raw message
drivers/staging/dream/include/mach/qdsp5/qdsp5audpreproccmdi.h new file +256 -0
256 lines not on this page · raw message
drivers/staging/dream/include/mach/qdsp5/qdsp5audpreprocmsg.h new file +85 -0
34 lines not on this page · raw message
drivers/staging/dream/include/mach/qdsp5/qdsp5audreccmdi.h new file +176 -0
176 lines not on this page · raw message
drivers/staging/dream/include/mach/qdsp5/qdsp5audrecmsg.h new file +127 -0
127 lines not on this page · raw message
drivers/staging/dream/include/mach/qdsp5/qdsp5jpegcmdi.h new file +376 -0
376 lines not on this page · raw message
drivers/staging/dream/include/mach/qdsp5/qdsp5jpegmsg.h new file +177 -0
177 lines not on this page · raw message
drivers/staging/dream/include/mach/qdsp5/qdsp5lpmcmdi.h new file +82 -0
82 lines not on this page · raw message
drivers/staging/dream/include/mach/qdsp5/qdsp5lpmmsg.h new file +80 -0
80 lines not on this page · raw message
drivers/staging/dream/include/mach/qdsp5/qdsp5vdeccmdi.h new file +235 -0
235 lines not on this page · raw message
drivers/staging/dream/include/mach/qdsp5/qdsp5vdecmsg.h new file +107 -0
107 lines not on this page · raw message
drivers/staging/dream/include/mach/qdsp5/qdsp5venccmdi.h new file +212 -0
212 lines not on this page · raw message
drivers/staging/dream/include/mach/qdsp5/qdsp5vfecmdi.h new file +910 -0
910 lines not on this page · raw message
drivers/staging/dream/include/mach/qdsp5/qdsp5vfemsg.h new file +290 -0
290 lines not on this page · raw message
drivers/staging/dream/include/media/msm_camera.h new file +388 -0
388 lines not on this page · raw message
include/linux/msm_mdp.h new file +86 -0
86 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 7 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Part of the diff is not shown here. View the raw message.
Quoted 34 lines · Pavel Machek
Quoted 6 lines · Greg KH
Quoted 5 lines · Pavel Machek
Hi!
Quoted 3 lines
Quoted 3 lines
This adds
generic_gpioand pmem support, both are needed for other dream drivers.Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
Signed-off-by Pavel Machek <[email protected]>I'd prefer to get the existing code building, before adding new stuff :(
Well, unfortunately other pieces depend on these.
The pieces already in the tree?
Yes :-(.
Quoted 2 lines
Why are you sending me patches that do
not build?I did not realize how much was those drivers depenend on arch-specific part.
Quoted 7 lines
Quoted 3 lines
I have it building with this patch (but note that it uses -I magic; I started to write script rewriting files so that -I is not neccessary, but I did not have time to finish it yet).
Ok, should I just delete the whole
drivers/staging/dream/directory as there seems no goal to get this to build properly? I've just marked the code as BROKEN, any chance to get it building again soon?Could we perhaps use -I to let it build before I find time to do search&replace of 100 #includes? Yes, I'm working on that, but no, it obviously does not progress as fast as I expected...
Quoted 5 lines
Pavel
Add missing files/includes neccessary for Dream compilation.
Signed-off-by Pavel Machek <[email protected]>
Ick, no. I'm not going to take the wakelock and other header files that are "generic" to android into the dream subdir. That's not ok.
If this code requires this mess to build, I think we should just delete the whole thing and start over with patches that add code that can actually build properly.
Any objection to that?
thanks,
greg k-h
Hi!
Quoted 10 lines
Quoted 7 lines
Could we perhaps use -I to let it build before I find time to do search&replace of 100 #includes? Yes, I'm working on that, but no, it obviously does not progress as fast as I expected...
Add missing files/includes neccessary for Dream compilation.
Signed-off-by Pavel Machek <[email protected]>Ick, no. I'm not going to take the wakelock and other header files that are "generic" to android into the dream subdir. That's not ok.
What is so wrong with wakelocks? They are just nops in this case.
Quoted 3 lines
If this code requires this mess to build, I think we should just delete the whole thing and start over with patches that add code that can actually build properly.
Well, crap is easier to clean up when it compiles (and is in tree -- that's point of staging -- right?), and it is not particulary bad crap in this case.
Quoted 1 line
Any objection to that?
Yes; dropping the code now will not help anything. Merging it to this point was not easy, and forcing me to redo it will just delay me from cleaning it up.
Merging crappy Windows driver to staging is easy:
1) you verify it is GPL
2) you submit it
[and then, clean it in tree].
I tried same process with dream support:
1) driver was GPLed
2) I tried submitting
3) I was told to split it according to authors. In Windows driver world, that would be show-stopper. Thanks to Google support, I figured authors.
4) I'm told that -I is not acceptable, not even inside staging. Windows drivers regulary have way worse build system abuses. (Of course, those need to be fixed before merging into kernel proper; fortunately they are easy to do incrementally).
Now, I see that wakelocks are show-stopper for merging into kernel proper, but what is the problem for staging? We merged drivers with OS_MEMORY_ALLOCATE(); wakelocks are just nops in this case.
Could we please clean this driver in-tree? (Wakelocks are already nops due to #ifdef magic, cleaning them incrementally is easy.)
(Plus, of course I'd like some help, but google people seem very silent :-( ).
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 6 lines · Pavel Machek
Hi!
Quoted 4 lines
Quoted 4 lines
Could we perhaps use -I to let it build before I find time to do search&replace of 100 #includes? Yes, I'm working on that, but no, it obviously does not progress as fast as I expected...
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Add missing files/includes neccessary for Dream compilation.
Signed-off-by Pavel Machek <[email protected]>Ick, no. I'm not going to take the wakelock and other header files that are "generic" to android into the dream subdir. That's not ok.
What is so wrong with wakelocks? They are just nops in this case.
Are they really? Then why is the whole large file needed?
Quoted 14 lines
Quoted 3 lines
If this code requires this mess to build, I think we should just delete the whole thing and start over with patches that add code that can actually build properly.
Well, crap is easier to clean up when it compiles (and is in tree -- that's point of staging -- right?), and it is not particulary bad crap in this case.
Quoted 1 line
Any objection to that?
Yes; dropping the code now will not help anything. Merging it to this point was not easy, and forcing me to redo it will just delay me from cleaning it up.
Quoted 5 lines
Merging crappy Windows driver to staging is easy:
1) you verify it is GPL
2) you submit it
Wait, it has to BUILD! This code has never been able to be built. Only after I disabled it from the CONFIG_ANDROID have I noticed this, which is my fault. But it needs to get fixed, and taking a bunch of code in addition to the mess we have now, seems like the wrong way to do it.
Quoted 7 lines
[and then, clean it in tree].
I tried same process with dream support:
1) driver was GPLed
2) I tried submitting
It did not BUILD!!!
Quoted 8 lines
3) I was told to split it according to authors. In Windows driver world, that would be show-stopper. Thanks to Google support, I figured authors.
4) I'm told that -I is not acceptable, not even inside staging. Windows drivers regulary have way worse build system abuses. (Of course, those need to be fixed before merging into kernel proper; fortunately they are easy to do incrementally).
I have never taken a driver in staging that was not self-contained or needed any -I funkyness.
Quoted 6 lines
Now, I see that wakelocks are show-stopper for merging into kernel proper, but what is the problem for staging? We merged drivers with
OS_MEMORY_ALLOCATE(); wakelocks are just nops in this case.Could we please clean this driver in-tree? (Wakelocks are already nops due to #ifdef magic, cleaning them incrementally is easy.)
With this patch, will it build properly?
Quoted 2 lines
(Plus, of course I'd like some help, but google people seem very silent :-( ).
Google has abandonded upstream Android development, which is a very sad state of being :(
thanks,
greg k-h
Hi!
Quoted 3 lines
Quoted 1 line
What is so wrong with wakelocks? They are just nops in this case.
Are they really? Then why is the whole large file needed?
It is probably not, I went to "submit vendor code, then clean it up" mode. CONFIG_HAS_WAKELOCK should be disabled, so it basically stubs itself out.
Quoted 6 lines
Quoted 1 line
2) you submit it
Wait, it has to BUILD! This code has never been able to be built. Only after I disabled it from the
CONFIG_ANDROIDhave I noticed this, which is my fault. But it needs to get fixed, and taking a bunch of code in addition to the mess we have now, seems like the wrong way to do it.
It seems to be the only reasonable way. gpio is used from all the other stuff, and removing it is not really an option.
Quoted 8 lines
Quoted 6 lines
Now, I see that wakelocks are show-stopper for merging into kernel proper, but what is the problem for staging? We merged drivers with
OS_MEMORY_ALLOCATE(); wakelocks are just nops in this case.Could we please clean this driver in-tree? (Wakelocks are already nops due to #ifdef magic, cleaning them incrementally is easy.)
With this patch, will it build properly?
Its certainly way closer to building... it builds for me, with something like below; platform devices really are initialized from board-* files and get passed parameters.
I should get some sleep now, I'll take closer look tommorow.
Pavel
arch/arm/mach-msm/include/mach/board.h +46 -0
@@ -35,4 +61,50 @@ void __init msm_init_irq(void);void __init msm_init_gpio (void );void __init msm_clock_init (void ); +struct msm_camera_io_ext { +uint32_t mdcphy; +uint32_t mdcsz; +uint32_t appphy; +uint32_t appsz; +}; + +struct msm_camera_device_platform_data { +void (*camera_gpio_on) (void ); +void (*camera_gpio_off)(void ); +struct msm_camera_io_ext ioext; +}; + +#ifdef CONFIG_SENSORS_MT9T013 +struct msm_camera_legacy_device_platform_data { +int sensor_reset; +int sensor_pwd; +int vcm_pwd; +void (*config_gpio_on) (void ); +void (*config_gpio_off)(void ); +}; +#endif + +#define MSM_CAMERA_FLASH_NONE 0 +#define MSM_CAMERA_FLASH_LED 1 + +struct msm_camera_sensor_info { +const char *sensor_name; +int sensor_reset; +int sensor_pwd; +int vcm_pwd; +int mclk; +int flash_type; +struct msm_camera_device_platform_data *pdata; +}; + +struct snd_endpoint { +int id; +const char *name; +}; + +struct msm_snd_endpoints { +struct snd_endpoint *endpoints; +unsigned num; +}; +#endif
arch/arm/mach-msm/include/mach/msm_iomap.h +1 -0
@@ -116,6 +116,7 @@#define MSM_AD5_PHYS 0xAC000000#define MSM_AD5_SIZE (SZ_1M*13) +#define MSM_AD5_BASE IOMEM(0xE0300000)#endif
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 24 lines · Pavel Machek
Hi!
Quoted 3 lines
Quoted 1 line
What is so wrong with wakelocks? They are just nops in this case.
Are they really? Then why is the whole large file needed?
It is probably not, I went to "submit vendor code, then clean it up" mode.
CONFIG_HAS_WAKELOCKshould be disabled, so it basically stubs itself out.Quoted 6 lines
Quoted 1 line
2) you submit it
Wait, it has to BUILD! This code has never been able to be built. Only after I disabled it from the
CONFIG_ANDROIDhave I noticed this, which is my fault. But it needs to get fixed, and taking a bunch of code in addition to the mess we have now, seems like the wrong way to do it.It seems to be the only reasonable way. gpio is used from all the other stuff, and removing it is not really an option.
Quoted 4 lines
Quoted 4 lines
Now, I see that wakelocks are show-stopper for merging into kernel proper, but what is the problem for staging? We merged drivers with
OS_MEMORY_ALLOCATE(); wakelocks are just nops in this case.
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Could we please clean this driver in-tree? (Wakelocks are already nops due to #ifdef magic, cleaning them incrementally is easy.)
With this patch, will it build properly?
Its certainly way closer to building... it builds for me, with something like below; platform devices really are initialized from board-* files and get passed parameters.
Ick. This isn't ok, we can't take patches for staging stuff in files outside of drivers/staging/
So for now, I've deleted the drivers/staging/dream/ directory from my tree, which will get pushed for 2.6.33. Please clean the code up and get it into buildable shape and I will be glad to add the drivers back into the staging directory at that time.
thanks,
greg k-h
Quoted 9 lines
Quoted 6 lines
Quoted 2 lines
With this patch, will it build properly?
Its certainly way closer to building... it builds for me, with something like below; platform devices really are initialized from board-* files and get passed parameters.
Ick. This isn't ok, we can't take patches for staging stuff in files outside of
drivers/staging/
I know, I was trying to show that ammount of required changes is very small.
Quoted 4 lines
So for now, I've deleted the
drivers/staging/dream/directory from my tree, which will get pushed for 2.6.33. Please clean the code up and get it into buildable shape and I will be glad to add the drivers back into the staging directory at that time.
Ok, I got something that builds; verifying it on device is hard, as last kernel that boots there is 2.6.29...
Should I turn it into series and submit?
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 17 lines · Pavel Machek
Quoted 9 lines
Quoted 6 lines
Quoted 2 lines
With this patch, will it build properly?
Its certainly way closer to building... it builds for me, with something like below; platform devices really are initialized from board-* files and get passed parameters.
Ick. This isn't ok, we can't take patches for staging stuff in files outside of
drivers/staging/I know, I was trying to show that ammount of required changes is very small.
Quoted 4 lines
So for now, I've deleted the
drivers/staging/dream/directory from my tree, which will get pushed for 2.6.33. Please clean the code up and get it into buildable shape and I will be glad to add the drivers back into the staging directory at that time.
Quoted 4 lines
Ok, I got something that builds; verifying it on device is hard, as last kernel that boots there is 2.6.29...
Should I turn it into series and submit?
Yes please.
thanks,
greg k-h
Quoted 18 lines · Greg KH
Quoted 17 lines · Pavel Machek
Quoted 9 lines
Quoted 6 lines
Quoted 2 lines
With this patch, will it build properly?
Its certainly way closer to building... it builds for me, with something like below; platform devices really are initialized from board-* files and get passed parameters.
Ick. This isn't ok, we can't take patches for staging stuff in files outside of
drivers/staging/I know, I was trying to show that ammount of required changes is very small.
Quoted 4 lines
So for now, I've deleted the
drivers/staging/dream/directory from my tree, which will get pushed for 2.6.33. Please clean the code up and get it into buildable shape and I will be glad to add the drivers back into the staging directory at that time.
Quoted 6 lines
Quoted 4 lines
Ok, I got something that builds; verifying it on device is hard, as last kernel that boots there is 2.6.29...
Should I turn it into series and submit?
Yes please.
Ok, here you go. These are against your tree before your "rm -r" patch. I hope I did not make mistake somewhere.
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 3 lines · Pavel Machek
(Plus, of course I'd like some help, but google people seem very silent :-( ).
Hi Pavel,
The Android kernel team is completely buried in issues related to fall 09 devices -- we're just not going to have cycles for sorting out stuff related to going upstream until we're past that (probably mid-late November). Yeah, this totally sucks, but that's where we are. We're definitely going to be rebasing all our working trees up to 2.6.32/33 for the end of the year and doing a push to get more stuff cleaned up and push towards mainline.
My hope remains that once we get more of the core msm support and device support out there we can get patches send upstream more incrementally in the future instead of these big blobs of code. We need to adjust our working model to be more involved with the mainline day-by-day while still supporting "stable" branches that can make it into production hardware. Fun times.
Brian
Quoted 9 lines · Brian Swetland
Quoted 3 lines · Pavel Machek
(Plus, of course I'd like some help, but google people seem very silent :-( ).
Hi Pavel,
The Android kernel team is completely buried in issues related to fall 09 devices -- we're just not going to have cycles for sorting out
Given how Android is spreading between phones -- like a wildfire -- I'm not surprised. But it is very unfortunate -- exactly because Android is extremely important mobile platform :-(.
I can still hope that Google opens developer centre in Prague and starts hiring :-).
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Quoted 3 lines · Pavel Machek
This adds
generic_gpioand pmem support, both are needed for other dream drivers.
Why you are not using existing gpiolib? That would make your driver a lot smaller and cleaner... and possibly with less bugs...
Why not split gpio and pmem into separate patches?
Quoted 1 line
Signed-off-by Pavel Machek<[email protected]>
Quoted 7 lines · Paulius Zaleckas
Quoted 3 lines · Pavel Machek
This adds
generic_gpioand pmem support, both are needed for other dream drivers.Why you are not using existing gpiolib? That would make your driver a lot smaller and cleaner... and possibly with less bugs...
That can be cleaned up later.
Quoted 1 line
Why not split gpio and pmem into separate patches?
General overload? Can you help?
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html