I've tested this patch and it works, thanks. Only issue, git could not
apply it so I've join a patch generated by git, so hopefully it will
apply cleanly.

Andy, any reason why this is not in andy-tracking yet ?  It's really
handy to be able to force a phone shutdown without having to remove the
battery.

Nicolas

Le samedi 14 mars 2009 à 23:09 +0100, Ondrej Zary a écrit :
> Hello,
> this patch adds "force-shutdown" feature for GTA02. When the power button is
> held pressed for 8 seconds, the power is turned off. No need to remove the
> battery anymore. Patch is against andy-tracking.
> 
> Signed-off-by: Ondrej Zary <[email protected]>
> 
> 
> diff -ur linux-2.6-orig/arch/arm/mach-s3c2442/mach-gta02.c 
> linux-2.6/arch/arm/mach-s3c2442/mach-gta02.c
> --- linux-2.6-orig/arch/arm/mach-s3c2442/mach-gta02.c 2009-03-14 
> 13:49:08.000000000 +0100
> +++ linux-2.6/arch/arm/mach-s3c2442/mach-gta02.c      2009-03-14 
> 13:33:34.000000000 +0100
> @@ -459,6 +459,12 @@
>       }
>  }
>  
> +static void gta02_pmu_force_shutdown(struct pcf50633 *pcf)
> +{
> +     pcf50633_reg_set_bit_mask(pcf, PCF50633_REG_OOCSHDWN,
> +               PCF50633_OOCSHDWN_GOSTDBY, PCF50633_OOCSHDWN_GOSTDBY);
> +}
> +
>  static void gta02_udc_vbus_draw(unsigned int ma)
>  {
>          if (!gta02_pcf)
> @@ -685,6 +691,7 @@
>       .probe_done = gta02_pmu_attach_child_devices,
>       .regulator_registered = gta02_pmu_regulator_registered,
>       .mbc_event_callback = gta02_pmu_event_callback,
> +     .force_shutdown = gta02_pmu_force_shutdown,
>  };
>  
>  static void mangle_pmu_pdata_by_system_rev(void)
> 
> 
diff --git a/arch/arm/mach-s3c2442/mach-gta02.c b/arch/arm/mach-s3c2442/mach-gta02.c
index 229271b..e1f8b9b 100644
--- a/arch/arm/mach-s3c2442/mach-gta02.c
+++ b/arch/arm/mach-s3c2442/mach-gta02.c
@@ -459,6 +459,13 @@ static void gta02_pmu_event_callback(struct pcf50633 *pcf, int irq)
 	}
 }
 
+static void gta02_pmu_force_shutdown(struct pcf50633 *pcf)
+{
+	pcf50633_reg_set_bit_mask(pcf, PCF50633_REG_OOCSHDWN,
+			PCF50633_OOCSHDWN_GOSTDBY, PCF50633_OOCSHDWN_GOSTDBY);
+}
+
+
 static void gta02_udc_vbus_draw(unsigned int ma)
 {
         if (!gta02_pcf)
@@ -685,6 +692,7 @@ struct pcf50633_platform_data gta02_pcf_pdata = {
 	.probe_done = gta02_pmu_attach_child_devices,
 	.regulator_registered = gta02_pmu_regulator_registered,
 	.mbc_event_callback = gta02_pmu_event_callback,
+	.force_shutdown = gta02_pmu_force_shutdown,
 };
 
 static void mangle_pmu_pdata_by_system_rev(void)

Reply via email to