The gta02 header file still uses the old S3C2410_GPJx defines instead of the
S3C2410_GPJ(x) macro. Since the S3C2410_GPJx defines have already been removed
this causes the following build failure:
sound/soc/samsung/neo1973_wm8753.c: In function 'lm4853_set_spk':
sound/soc/samsung/neo1973_wm8753.c:259: error: 'S3C2440_GPJ2' undeclared (first use in this function)
sound/soc/samsung/neo1973_wm8753.c:259: error: (Each undeclared identifier is reported only once
sound/soc/samsung/neo1973_wm8753.c:259: error: for each function it appears in.)
sound/soc/samsung/neo1973_wm8753.c: In function 'lm4853_get_spk':
sound/soc/samsung/neo1973_wm8753.c:267: error: 'S3C2440_GPJ2' undeclared (first use in this function)
sound/soc/samsung/neo1973_wm8753.c: In function 'lm4853_event':
sound/soc/samsung/neo1973_wm8753.c:276: error: 'S3C2440_GPJ1' undeclared (first use in this function)
sound/soc/samsung/neo1973_wm8753.c: At top level:
sound/soc/samsung/neo1973_wm8753.c:439: error: 'S3C2440_GPJ2' undeclared here (not in a function)
sound/soc/samsung/neo1973_wm8753.c:440: error: 'S3C2440_GPJ1' undeclared here (not in a function)
This patches fixes the issue by doing a s,S3C2410_GPJ([\d]+),S3C2410_GPJ(\1),g
on the file.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
arch/arm/mach-s3c2440/include/mach/gta02.h | 26 +++++++++++++-------------
1 files changed, 13 insertions(+), 13 deletions(-)
The ASoC multi-component patch introduced a new pcm platform device, which needs
to be registered by board files in order for sound to work.
This patch does this for the gta02 board.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
arch/arm/mach-s3c2440/mach-gta02.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
The gta02 mach file references the ohci device.
So we need to select S3C_DEV_USB_HOST to have the device available.
This fixes the following linker errors:
arch/arm/mach-s3c2440/built-in.o: In function `gta02_machine_init':
mach-gta02.c:(.init.text+0x370): undefined reference to `s3c_ohci_set_platdata'
arch/arm/mach-s3c2440/built-in.o:(.init.data+0xac): undefined reference to `s3c_device_ohci'
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
arch/arm/mach-s3c2440/Kconfig | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
At the end of gta02_pmu_attach_child_devices all drivers should have taken
control of their regulators and we can tell the regulator core to disable all
regulators which are currently not in use.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
arch/arm/mach-s3c2440/mach-gta02.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
Request the gpio pin used to control the usb pullup before using it to avoid a
runtime warning about an auto-requested gpio.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
arch/arm/mach-s3c2440/mach-gta02.c | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)
@@ -572,11 +572,24 @@ static void gta02_poweroff(void)pcf50633_reg_set_bit_mask(gta02_pcf,PCF50633_REG_OOCSHDWN,1,1);}+staticvoidgta02_request_gpios(void)+{+intret;+ret=gpio_request_one(GTA02_GPIO_USB_PULLUP,GPIOF_OUT_INIT_LOW,+"USB pullup");+if(ret){+printk(KERN_ERR"Failed to request USB pullup gpio pin: %d\n",+ret);+}+}+staticvoid__initgta02_machine_init(void){/* Set the panic callback to turn AUX LED on or off. */panic_blink=gta02_panic_blink;+gta02_request_gpios();+s3c_pm_init();#ifdef CONFIG_CHARGER_PCF50633
This patch registers the s3c touchscreen and adc devices to add touchscreen
support for the gta02.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
arch/arm/mach-s3c2440/mach-gta02.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
@@ -480,6 +482,13 @@ static struct s3c2410_hcd_info gta02_usb_info __initdata = {},};+/* Touchscreen */+staticstructs3c2410_ts_mach_infogta02_ts_info={+.delay=10000,+.presc=0xff,/* slow as we can go */+.oversampling_shift=2,+};+/* Buttons */staticstructgpio_keys_buttongta02_buttons[]={{
@@ -533,6 +542,8 @@ static struct platform_device *gta02_devices[] __initdata = {&samsung_asoc_dma,&s3c_device_i2c0,>a02_buttons_device,+&s3c_device_adc,+&s3c_device_ts,};/* These guys DO need to be children of PMU. */
The pcf50633 regulator driver does not use the state_mem constraints, so there
is no use in setting them.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
arch/arm/mach-s3c2440/mach-gta02.c | 15 ---------------
1 files changed, 0 insertions(+), 15 deletions(-)
The REGULATOR_CHANGE_STATUS flag needs to be set on valid_ops_mask, otherwise it
a driver wont be able to turn the regulator on or off.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
arch/arm/mach-s3c2440/mach-gta02.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
This patch adds support for the two buttons found on the gta02 device, which are
connectd to gpio pins, using the gpio-keys driver.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
arch/arm/mach-s3c2440/mach-gta02.c | 34 ++++++++++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
@@ -511,6 +544,7 @@ static struct platform_device *gta02_devices[] __initdata = {&s3c_device_iis,&samsung_asoc_dma,&s3c_device_i2c0,+>a02_buttons_device,};/* These guys DO need to be children of PMU. */
From: Mark Brown <hidden> Date: 2011-02-07 11:58:58
On Mon, Feb 07, 2011 at 02:51:59AM +0100, Lars-Peter Clausen wrote:
At the end of gta02_pmu_attach_child_devices all drivers should have taken
control of their regulators and we can tell the regulator core to disable all
regulators which are currently not in use.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
You're misunderstanding this API. It can be called at any time and will
only actually do anything at the end of init. You should just call it
from your machine init.
This allows the regulator core to disable all regulators which are not in use
at the end of the kernel init phase.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
arch/arm/mach-s3c2440/mach-gta02.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
The gta02 header file still uses the old S3C2410_GPJx defines instead of the
S3C2410_GPJ(x) macro. Since the S3C2410_GPJx defines have already been removed
this causes the following build failure:
sound/soc/samsung/neo1973_wm8753.c: In function 'lm4853_set_spk':
sound/soc/samsung/neo1973_wm8753.c:259: error: 'S3C2440_GPJ2' undeclared (first use in this function)
sound/soc/samsung/neo1973_wm8753.c:259: error: (Each undeclared identifier is reported only once
sound/soc/samsung/neo1973_wm8753.c:259: error: for each function it appears in.)
sound/soc/samsung/neo1973_wm8753.c: In function 'lm4853_get_spk':
sound/soc/samsung/neo1973_wm8753.c:267: error: 'S3C2440_GPJ2' undeclared (first use in this function)
sound/soc/samsung/neo1973_wm8753.c: In function 'lm4853_event':
sound/soc/samsung/neo1973_wm8753.c:276: error: 'S3C2440_GPJ1' undeclared (first use in this function)
sound/soc/samsung/neo1973_wm8753.c: At top level:
sound/soc/samsung/neo1973_wm8753.c:439: error: 'S3C2440_GPJ2' undeclared here (not in a function)
sound/soc/samsung/neo1973_wm8753.c:440: error: 'S3C2440_GPJ1' undeclared here (not in a function)
This patches fixes the issue by doing a s,S3C2410_GPJ([\d]+),S3C2410_GPJ(\1),g
on the file.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Hi
Ben or Kukjin could you take a look at this series and merge it, if it is ok?
- Lars
From: Kukjin Kim <hidden> Date: 2011-02-21 09:58:35
Lasrs-Peter Clausen wrote:
On 02/07/2011 02:51 AM, Lars-Peter Clausen wrote:
quoted
The gta02 header file still uses the old S3C2410_GPJx defines instead of
the
quoted
S3C2410_GPJ(x) macro. Since the S3C2410_GPJx defines have already been
removed
quoted
this causes the following build failure:
sound/soc/samsung/neo1973_wm8753.c: In function 'lm4853_set_spk':
sound/soc/samsung/neo1973_wm8753.c:259: error: 'S3C2440_GPJ2'
on the file.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Hi
Ben or Kukjin could you take a look at this series and merge it, if it is
ok?
Hi Lars-Peter,
Basically, the maintainer of mach-s3c* is Ben Dooks.
I think, he will review this series but if he can't soon, I will/can do it.
Ben, could you please review this patches?
If you're busy, please let me know :)
Thanks.
Best regards,
Kgene.
--
Kukjin Kim [off-list ref], Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
Please group same/similar inclusion together like following.
<linux/...> <asm/...> then <mach/...> or <plat/...>
In other words, please add your <plat/ts.h> inclusion after other <plat/...>
= {
},
};
+/* Touchscreen */
+static struct s3c2410_ts_mach_info gta02_ts_info = {
+ .delay = 10000,
+ .presc = 0xff, /* slow as we can go */
+ .oversampling_shift = 2,
+};
How about to use tab between member and = like following?
static struct s3c2410_ts_mach_info gta02_ts_info = {
.delay = 10000,
.presc = 0xff, /* slow as we can go */
.oversampling_shift = 2,
};
No need to build plat-samsung/dev-adc.c for this?
If you want to add '&s3c_deivce_adc', should add 'select SAMSUNG_DEV_ADC'
into "config MACH_NEO1973_GTA02".
+ &s3c_device_ts,
'select SAMSUNG_DEV_TS'
quoted hunk
};
/* These guys DO need to be children of PMU. */
How about following instead?
gpio_request(GTA02_GPIO_USB_PULLUP, "USB_PULLUP");
gpio_direction_output(GTA02_GPIO_USB_PULLUP, 1);
gpio_free(GTA02_GPIO_USB_PULLUP);
quoted hunk
break;
case S3C2410_UDC_P_DISABLE:
pr_debug("%s S3C2410_UDC_P_DISABLE\n", __func__);
- gpio_direction_output(GTA02_GPIO_USB_PULLUP, 0);
+ gpio_set_value(GTA02_GPIO_USB_PULLUP, 0);
break;
case S3C2410_UDC_P_RESET:
pr_debug("%s S3C2410_UDC_P_RESET\n", __func__);
@@ -572,11 +572,24 @@ static void gta02_poweroff(void) pcf50633_reg_set_bit_mask(gta02_pcf, PCF50633_REG_OOCSHDWN, 1, 1); }+static void gta02_request_gpios(void)+{+ int ret;+ ret = gpio_request_one(GTA02_GPIO_USB_PULLUP, GPIOF_OUT_INIT_LOW,+ "USB pullup");+ if (ret) {+ printk(KERN_ERR "Failed to request USB pullup gpio pin:
%d\n",
+ ret);
+ }
+}
+
static void __init gta02_machine_init(void)
{
/* Set the panic callback to turn AUX LED on or off. */
panic_blink = gta02_panic_blink;
+ gta02_request_gpios();
+
s3c_pm_init();
#ifdef CONFIG_CHARGER_PCF50633
--
Thanks.
Best regards,
Kgene.
--
Kukjin Kim [off-list ref], Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
From: Kukjin Kim <hidden> Date: 2011-02-28 06:26:08
Lars-Peter Clausen wrote:
quoted hunk
The pcf50633 regulator driver does not use the state_mem constraints, so
there
is no use in setting them.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
arch/arm/mach-s3c2440/mach-gta02.c | 15 ---------------
1 files changed, 0 insertions(+), 15 deletions(-)
Don't we need regulator_suspend_mem_state_show() on PCF50633?
Thanks.
Best regards,
Kgene.
--
Kukjin Kim [off-list ref], Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
From: Kukjin Kim <hidden> Date: 2011-02-28 06:31:36
Lars-Peter Clausen wrote:
quoted hunk
The gta02 mach file references the ohci device.
So we need to select S3C_DEV_USB_HOST to have the device available.
This fixes the following linker errors:
arch/arm/mach-s3c2440/built-in.o: In function `gta02_machine_init':
mach-gta02.c:(.init.text+0x370): undefined reference to
`s3c_ohci_set_platdata'
arch/arm/mach-s3c2440/built-in.o:(.init.data+0xac): undefined
reference to `s3c_device_ohci'
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
arch/arm/mach-s3c2440/Kconfig | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
From: Kukjin Kim <hidden> Date: 2011-02-28 06:38:55
Lars-Peter Clausen wrote:
quoted hunk
The ASoC multi-component patch introduced a new pcm platform device, which
needs
to be registered by board files in order for sound to work.
This patch does this for the gta02 board.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
arch/arm/mach-s3c2440/mach-gta02.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
From: Kukjin Kim <hidden> Date: 2011-02-28 06:43:18
Lars-Peter Clausen wrote:
The gta02 header file still uses the old S3C2410_GPJx defines instead of
the
S3C2410_GPJ(x) macro. Since the S3C2410_GPJx defines have already been
removed
this causes the following build failure:
sound/soc/samsung/neo1973_wm8753.c: In function 'lm4853_set_spk':
sound/soc/samsung/neo1973_wm8753.c:259: error: 'S3C2440_GPJ2'
undeclared (first use in this function)
sound/soc/samsung/neo1973_wm8753.c:259: error: (Each undeclared
identifier is reported only once
sound/soc/samsung/neo1973_wm8753.c:259: error: for each function it
appears in.)
sound/soc/samsung/neo1973_wm8753.c: In function 'lm4853_get_spk':
sound/soc/samsung/neo1973_wm8753.c:267: error: 'S3C2440_GPJ2'
undeclared (first use in this function)
sound/soc/samsung/neo1973_wm8753.c: In function 'lm4853_event':
sound/soc/samsung/neo1973_wm8753.c:276: error: 'S3C2440_GPJ1'
undeclared (first use in this function)
sound/soc/samsung/neo1973_wm8753.c: At top level:
sound/soc/samsung/neo1973_wm8753.c:439: error: 'S3C2440_GPJ2'
undeclared here (not in a function)
sound/soc/samsung/neo1973_wm8753.c:440: error: 'S3C2440_GPJ1'
undeclared here (not in a function)
This patches fixes the issue by doing a
s,S3C2410_GPJ([\d]+),S3C2410_GPJ(\1),g
Yeah, old S3C2440_GPJx has removed.
Is the S3C2410_GPJ(1) right instead of S3C2440_GPJ1?
Thanks.
Best regards,
Kgene.
--
Kukjin Kim [off-list ref], Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
From: Kukjin Kim <hidden> Date: 2011-02-28 06:48:13
Lars-Peter Clausen wrote:
The REGULATOR_CHANGE_STATUS flag needs to be set on valid_ops_mask,
otherwise
quoted hunk
it
a driver wont be able to turn the regulator on or off.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
arch/arm/mach-s3c2440/mach-gta02.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
From: Kukjin Kim <hidden> Date: 2011-02-28 06:48:48
Lars-Peter Clausen wrote:
This allows the regulator core to disable all regulators which are not in
use
quoted hunk
at the end of the kernel init phase.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
arch/arm/mach-s3c2440/mach-gta02.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
How about following instead?
gpio_request(GTA02_GPIO_USB_PULLUP, "USB_PULLUP");
gpio_direction_output(GTA02_GPIO_USB_PULLUP, 1);
gpio_free(GTA02_GPIO_USB_PULLUP);
I don't think that is a good idea. This gpio should really be reserved for the
udc driver. If it is freed again, it could be requested from someone else which
could lead to undefined behaviour.
quoted
break;
case S3C2410_UDC_P_DISABLE:
pr_debug("%s S3C2410_UDC_P_DISABLE\n", __func__);
- gpio_direction_output(GTA02_GPIO_USB_PULLUP, 0);
+ gpio_set_value(GTA02_GPIO_USB_PULLUP, 0);
break;
case S3C2410_UDC_P_RESET:
pr_debug("%s S3C2410_UDC_P_RESET\n", __func__);
@@ -572,11 +572,24 @@ static void gta02_poweroff(void) pcf50633_reg_set_bit_mask(gta02_pcf, PCF50633_REG_OOCSHDWN, 1, 1); }+static void gta02_request_gpios(void)+{+ int ret;+ ret = gpio_request_one(GTA02_GPIO_USB_PULLUP, GPIOF_OUT_INIT_LOW,+ "USB pullup");+ if (ret) {+ printk(KERN_ERR "Failed to request USB pullup gpio pin:
%d\n",
quoted
+ ret);
+ }
+}
+
static void __init gta02_machine_init(void)
{
/* Set the panic callback to turn AUX LED on or off. */
panic_blink = gta02_panic_blink;
+ gta02_request_gpios();
+
s3c_pm_init();
#ifdef CONFIG_CHARGER_PCF50633
--
Thanks.
Best regards,
Kgene.
--
Kukjin Kim [off-list ref], Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
The pcf50633 regulator driver does not use the state_mem constraints, so
there
is no use in setting them.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
arch/arm/mach-s3c2440/mach-gta02.c | 15 ---------------
1 files changed, 0 insertions(+), 15 deletions(-)
Don't we need regulator_suspend_mem_state_show() on PCF50633?
No. The pcf50633 driver has no set_suspend_enable or set_suspend_disable ops.
So the 'suspend_mem_state' sysfs file does not get registered and that function
is never called.
- Lars
Please group same/similar inclusion together like following.
<linux/...> <asm/...> then <mach/...> or <plat/...>
In other words, please add your <plat/ts.h> inclusion after other <plat/...>
= {
},
};
+/* Touchscreen */
+static struct s3c2410_ts_mach_info gta02_ts_info = {
+ .delay = 10000,
+ .presc = 0xff, /* slow as we can go */
+ .oversampling_shift = 2,
+};
How about to use tab between member and = like following?
static struct s3c2410_ts_mach_info gta02_ts_info = {
.delay = 10000,
.presc = 0xff, /* slow as we can go */
.oversampling_shift = 2,
};
No need to build plat-samsung/dev-adc.c for this?
If you want to add '&s3c_deivce_adc', should add 'select SAMSUNG_DEV_ADC'
into "config MACH_NEO1973_GTA02".
There appear to be two different definitions for s3c_deivce_adc one is in
plat-samsung/dev-adc.c the other is in plat-s3c24xx/devs.c. So if I select
SAMSUNG_DEV_ADC I'll actually get compile errors.
The definition in plat-s3c24xx/devs.c should probably be dropped, but thats
something for a different patch.
quoted
+ &s3c_device_ts,
'select SAMSUNG_DEV_TS'
Same here.
quoted
};
/* These guys DO need to be children of PMU. */
How about following instead?
gpio_request(GTA02_GPIO_USB_PULLUP, "USB_PULLUP");
gpio_direction_output(GTA02_GPIO_USB_PULLUP, 1);
gpio_free(GTA02_GPIO_USB_PULLUP);
I don't think that is a good idea. This gpio should really be reserved for
the
udc driver. If it is freed again, it could be requested from someone else
which
could lead to undefined behaviour.
Yes right, but I mean the board designer already knows the usage of
regarding GPIOs on his board.
So why do we really need gpio_request for it?...
Thanks.
Best regards,
Kgene.
--
Kukjin Kim [off-list ref], Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
The gta02 header file still uses the old S3C2410_GPJx defines instead of
the
quoted
S3C2410_GPJ(x) macro. Since the S3C2410_GPJx defines have already been
removed
this causes the following build failure:
sound/soc/samsung/neo1973_wm8753.c: In function 'lm4853_set_spk':
sound/soc/samsung/neo1973_wm8753.c:259: error: 'S3C2440_GPJ2'
undeclared (first use in this function)
sound/soc/samsung/neo1973_wm8753.c:259: error: (Each undeclared
identifier is reported only once
sound/soc/samsung/neo1973_wm8753.c:259: error: for each function it
appears in.)
sound/soc/samsung/neo1973_wm8753.c: In function 'lm4853_get_spk':
sound/soc/samsung/neo1973_wm8753.c:267: error: 'S3C2440_GPJ2'
undeclared (first use in this function)
sound/soc/samsung/neo1973_wm8753.c: In function 'lm4853_event':
sound/soc/samsung/neo1973_wm8753.c:276: error: 'S3C2440_GPJ1'
undeclared (first use in this function)
sound/soc/samsung/neo1973_wm8753.c: At top level:
sound/soc/samsung/neo1973_wm8753.c:439: error: 'S3C2440_GPJ2'
undeclared here (not in a function)
sound/soc/samsung/neo1973_wm8753.c:440: error: 'S3C2440_GPJ1'
undeclared here (not in a function)
This patches fixes the issue by doing a
s,S3C2410_GPJ([\d]+),S3C2410_GPJ(\1),g
From: Kukjin Kim <hidden> Date: 2011-02-28 10:50:05
Lars-Peter Clausen wrote:
On 02/28/2011 07:41 AM, Kukjin Kim wrote:
quoted
Lars-Peter Clausen wrote:
(snip)
quoted
Yeah, old S3C2440_GPJx has removed.
Is the S3C2410_GPJ(1) right instead of S3C2440_GPJ1?
I think so. At least the the compile errors are gone and the drivers using
these gpios work as expected.
Ok, you mean test it on board...so will apply into my s5p-fixes-for-linus
for 38-rc.
Thanks.
Best regards,
Kgene.
--
Kukjin Kim [off-list ref], Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
No need to build plat-samsung/dev-adc.c for this?
If you want to add '&s3c_deivce_adc', should add 'select
SAMSUNG_DEV_ADC'
quoted
into "config MACH_NEO1973_GTA02".
There appear to be two different definitions for s3c_deivce_adc one is in
plat-samsung/dev-adc.c the other is in plat-s3c24xx/devs.c. So if I select
SAMSUNG_DEV_ADC I'll actually get compile errors.
The definition in plat-s3c24xx/devs.c should probably be dropped, but
thats
something for a different patch.
Oops, you're right...ok, please keep your current code.
If required, we can do it later :)
(snip)
Thanks.
Best regards,
Kgene.
--
Kukjin Kim [off-list ref], Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
How about following instead?
gpio_request(GTA02_GPIO_USB_PULLUP, "USB_PULLUP");
gpio_direction_output(GTA02_GPIO_USB_PULLUP, 1);
gpio_free(GTA02_GPIO_USB_PULLUP);
I don't think that is a good idea. This gpio should really be reserved for
the
udc driver. If it is freed again, it could be requested from someone else
which
could lead to undefined behaviour.
Yes right, but I mean the board designer already knows the usage of
regarding GPIOs on his board.
So why do we really need gpio_request for it?...
Well, for one because it's part of the gpio-api. You should not call any other
gpio functions on a pin unless you've successfully requested that pin.
On the other hand this helps debugging and ensures that the same gpio is not
used by two drivers accident. For example it is also possible to request gpios
from userspace using the gpio sysfs. So by keeping the gpio requested it wont
be possible to request it from userspace by accident. And the gpio will also be
listed in the gpio debugfs file, which can be helpful for debugging as well.
- Lars
From: Kukjin Kim <hidden> Date: 2011-02-28 10:58:16
Lars-Peter Clausen wrote:
On 02/28/2011 07:26 AM, Kukjin Kim wrote:
quoted
Lars-Peter Clausen wrote:
quoted
The pcf50633 regulator driver does not use the state_mem constraints,
so
quoted
quoted
there
is no use in setting them.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
arch/arm/mach-s3c2440/mach-gta02.c | 15 ---------------
1 files changed, 0 insertions(+), 15 deletions(-)
This patch adds registers the s3c touchscreen and adc devices to add touchscreen
support for the gta02.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
arch/arm/mach-s3c2440/mach-gta02.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
@@ -480,6 +482,13 @@ static struct s3c2410_hcd_info gta02_usb_info __initdata = {},};+/* Touchscreen */+staticstructs3c2410_ts_mach_infogta02_ts_info={+.delay=10000,+.presc=0xff,/* slow as we can go */+.oversampling_shift=2,+};+/* Buttons */staticstructgpio_keys_buttongta02_buttons[]={{
@@ -533,6 +542,8 @@ static struct platform_device *gta02_devices[] __initdata = {&samsung_asoc_dma,&s3c_device_i2c0,>a02_buttons_device,+&s3c_device_adc,+&s3c_device_ts,};/* These guys DO need to be children of PMU. */
From: Kukjin Kim <hidden> Date: 2011-02-28 11:56:18
Lars-Peter Clausen wrote:
quoted hunk
This patch adds registers the s3c touchscreen and adc devices to add
touchscreen
support for the gta02.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
arch/arm/mach-s3c2440/mach-gta02.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
= {
&samsung_asoc_dma,
&s3c_device_i2c0,
>a02_buttons_device,
+ &s3c_device_adc,
+ &s3c_device_ts,
};
/* These guys DO need to be children of PMU. */
How about following instead?
gpio_request(GTA02_GPIO_USB_PULLUP, "USB_PULLUP");
gpio_direction_output(GTA02_GPIO_USB_PULLUP, 1);
gpio_free(GTA02_GPIO_USB_PULLUP);
I don't think that is a good idea. This gpio should really be reserved
for
quoted
quoted
quoted
the
udc driver. If it is freed again, it could be requested from someone
else
quoted
quoted
quoted
which
could lead to undefined behaviour.
Yes right, but I mean the board designer already knows the usage of
regarding GPIOs on his board.
So why do we really need gpio_request for it?...
Well, for one because it's part of the gpio-api. You should not call any
other
gpio functions on a pin unless you've successfully requested that pin.
On the other hand this helps debugging and ensures that the same gpio is
not
quoted
used by two drivers accident. For example it is also possible to request
gpios
from userspace using the gpio sysfs. So by keeping the gpio requested it
wont
quoted
be possible to request it from userspace by accident. And the gpio will
also
quoted
be
listed in the gpio debugfs file, which can be helpful for debugging as
well.
quoted
- Lars
Hi Lars,
Ok, will apply :)
Thanks.
Best regards,
Kgene.
--
Kukjin Kim [off-list ref], Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.
Hi Kgene
Actually I've prepared another patch, which I'm was about to send in a few
minutes, which moves the controlling of the pullup pin to the udc driver.
- Lars
How about following instead?
gpio_request(GTA02_GPIO_USB_PULLUP, "USB_PULLUP");
gpio_direction_output(GTA02_GPIO_USB_PULLUP, 1);
gpio_free(GTA02_GPIO_USB_PULLUP);
I don't think that is a good idea. This gpio should really be reserved
for
quoted
quoted
the
udc driver. If it is freed again, it could be requested from someone
else
quoted
quoted
which
could lead to undefined behaviour.
Yes right, but I mean the board designer already knows the usage of
regarding GPIOs on his board.
So why do we really need gpio_request for it?...
Well, for one because it's part of the gpio-api. You should not call any
other
gpio functions on a pin unless you've successfully requested that pin.
On the other hand this helps debugging and ensures that the same gpio is
not
used by two drivers accident. For example it is also possible to request
gpios
from userspace using the gpio sysfs. So by keeping the gpio requested it
wont
be possible to request it from userspace by accident. And the gpio will
also
be
listed in the gpio debugfs file, which can be helpful for debugging as
well.
- Lars
Hi Lars,
Ok, will apply :)
Thanks.
Best regards,
Kgene.
--
Kukjin Kim [off-list ref], Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.