Problem with patch implementation
Subsystems (5)
Hi All,
I am trying to apply patch through poky but it is not working. My patch is working when I'm trying it manually with following message :
surya@spectracore-Vostro-220s-Series:~/Desktop/my_kernel/linux$ patch -Np1 -i ../../../Surya/pro/kernel_patch/beagle.patch patching file arch/arm/mach-omap2/board-omap3beagle.c Hunk #7 FAILED at 336. Hunk #8 succeeded at 376 (offset 6 lines). Hunk #9 succeeded at 406 (offset 6 lines). Hunk #10 succeeded at 422 (offset 6 lines). Hunk #11 succeeded at 463 (offset 6 lines). Hunk #12 succeeded at 514 (offset 6 lines). Hunk #13 succeeded at 572 (offset 6 lines). Hunk #14 succeeded at 654 (offset 6 lines). Hunk #15 succeeded at 670 (offset 6 lines). 1 out of 15 hunks FAILED -- saving rejects to file arch/arm/mach-omap2/board-omap3beagle.c.rej patching file drivers/input/touchscreen/tsc2007.c patching file drivers/video/omap2/displays/Kconfig patching file drivers/video/omap2/displays/Makefile patching file drivers/video/omap2/displays/panel-cmel-oled43.c
but with poky do_patch is getting failed.
I'm sending my PATCH FILE and ERROR LOG in attachments.
Please help me to resolve this problem. Thanks in advance
Sparsh
arch/arm/mach-omap2/board-omap3beagle.c +125 -14
@@ -31,6 +31,8 @@#include <linux/regulator/machine.h> #include <linux/i2c/twl.h> +#include <linux/i2c.h> +#include <linux/i2c/tsc2007.h> #include <mach/hardware.h> #include <asm/mach-types.h>
@@ -196,12 +198,13 @@static struct omap_dss_device beagle_dvi_device = { .type =OMAP_DISPLAY_TYPE_DPI , - .name ="dvi" , - .driver_name ="generic_panel" , - .phy.dpi.data_lines =24 , - .reset_gpio =170 , - .platform_enable = beagle_enable_dvi, - .platform_disable = beagle_disable_dvi, + .name ="dvi" , + .driver_name ="generic_panel" , + .phy.dpi.data_lines =24 , + .reset_gpio =170 , +// .platform_enable = beagle_enable_dvi, +// .platform_disable = beagle_disable_dvi, + };static struct omap_dss_device beagle_tv_device = {
@@ -211,15 +214,39 @@ .phy.venc.type = OMAP_DSS_VENC_TYPE_SVIDEO, }; +static int beagle_enable_lcd (struct omap_dss_device *dssdev) +{ +if (gpio_is_valid (dssdev->reset_gpio)) +gpio_set_value (dssdev->reset_gpio,1 ); + +return 0 ; +} + +static void beagle_disable_lcd (struct omap_dss_device *dssdev) +{ +if (gpio_is_valid (dssdev->reset_gpio)) +gpio_set_value (dssdev->reset_gpio,0 ); +} + +static struct omap_dss_device beagle_lcd_device = { + .name ="lcd" , + .driver_name ="cmel_oled43_panel" , + .type =OMAP_DISPLAY_TYPE_DPI , + .phy.dpi.data_lines =24 , + .reset_gpio =157 , + +}; +static struct omap_dss_device *beagle_dss_devices[] = { - &beagle_dvi_device, - &beagle_tv_device, +// &beagle_dvi_device, +// &beagle_tv_device, + &beagle_lcd_device, };static struct omap_dss_board_info beagle_dss_data = { .num_devices =ARRAY_SIZE (beagle_dss_devices), .devices = beagle_dss_devices, - .default_device = &beagle_dvi_device, + .default_device = &beagle_lcd_device, };static struct platform_device beagle_dss_device = {
@@ -240,13 +267,13 @@ {int r; - r =gpio_request (beagle_dvi_device.reset_gpio,"DVI reset" ); + r =gpio_request (beagle_lcd_device.reset_gpio,"DVI reset" );if (r <0 ) {printk (KERN_ERR "Unable to get DVI reset GPIO\n" );return ; } -gpio_direction_output (beagle_dvi_device.reset_gpio,0 ); +gpio_direction_output (beagle_lcd_device.reset_gpio,0 ); }#include "sdram-micron-mt46h32m32lf-6.h"
@@ -260,6 +287,10 @@ {}/* Terminator */ }; +static struct omap_lcd_config omap3_beagle_lcd_config__initdata = { + .ctrl_name ="internal" , +}; +static struct regulator_consumer_supply beagle_vmmc1_supply = { .supply ="vmmc" , };
@@ -268,6 +299,14 @@ .supply = "vmmc_aux", }; +static struct regulator_consumer_supply beagle_vdda_dac_supply = +REGULATOR_SUPPLY ("vdda_dac" ,"omapdss" ); + +static struct regulator_consumer_supply beagle_vdds_supplies[] = { +REGULATOR_SUPPLY ("vdds_sdi" ,"omapdss" ), +REGULATOR_SUPPLY ("vdds_dsi" ,"omapdss" ), +}; +static struct gpio_led gpio_leds[]; static int beagle_twl_gpio_setup(struct device *dev,
@@ -297,9 +336,15 @@gpio_request (gpio +1 ,"EHCI_nOC" );gpio_direction_input (gpio +1 ); -/* TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, active low) */ +/* +* TWL4030_GPIO_MAX + 0 == ledA, EHCI nEN_USB_PWR (out, XM active +* high / others active low) +*/ gpio_request (gpio +TWL4030_GPIO_MAX ,"nEN_USB_PWR" ); -gpio_direction_output (gpio +TWL4030_GPIO_MAX ,0 ); +if (omap3_beagle_get_rev () ==OMAP3BEAGLE_BOARD_XM ) +gpio_direction_output (gpio +TWL4030_GPIO_MAX ,1 ); +else +gpio_direction_output (gpio +TWL4030_GPIO_MAX ,0 );/* TWL4030_GPIO_MAX + 1 == ledB, PMU_STAT (out, active low LED) */ gpio_leds[2 ].gpio = gpio +TWL4030_GPIO_MAX +1 ;
@@ -331,6 +376,7 @@ }, .num_consumer_supplies = 1, .consumer_supplies = &beagle_vmmc1_supply, + };/* VSIM for MMC1 pins DAT4..DAT7 (2 mA, plus card == max 50 mA) */
@@ -360,6 +406,7 @@ }, .num_consumer_supplies = 1, .consumer_supplies = &beagle_vdac_supply, +// .consumer_supplies = &beagle_vdda_dac_supply, };/* VPLL2 for digital video outputs */
@@ -375,6 +422,9 @@ }, .num_consumer_supplies = 1, .consumer_supplies = &beagle_vdvi_supply, +// .num_consumer_supplies = ARRAY_SIZE(beagle_vdds_supplies), +// .consumer_supplies = beagle_vdds_supplies, + };static struct twl4030_usb_data beagle_usb_data = {
@@ -413,6 +463,45 @@ }, }; +/* TouchScreen */ +#define OMAP3_BEAGLETOUCH_TS_GPIO 136 +static int tsc2007_get_pendown_state (void ) +{ +return !gpio_get_value (OMAP3_BEAGLETOUCH_TS_GPIO ); +} + +static int omap3beagletouch_tsc2007_init (void ) +{ +int gpio =OMAP3_BEAGLETOUCH_TS_GPIO ; +int ret =0 ; + + ret =gpio_request (gpio,"tsc2007_pen_down" ); +if (ret <0 ) { +printk (KERN_ERR "Failed to request GPIO %d for " +"tsc2007 pen down IRQ\n" , gpio); +return ret; + } + +gpio_direction_input (gpio); + +return ret; +} + +static struct tsc2007_platform_data tsc2007_info = { + .model =2007 , + .x_plate_ohms =180 , + .get_pendown_state = tsc2007_get_pendown_state, + .init_platform_hw = omap3beagletouch_tsc2007_init, +}; + +static struct i2c_board_info __initdata ts_i2c_clients[] = { + { +I2C_BOARD_INFO ("tsc2007" ,0x48 ), + .irq =OMAP_GPIO_IRQ (OMAP3_BEAGLETOUCH_TS_GPIO ), + .platform_data = &tsc2007_info, + }, +}; +static struct i2c_board_info __initdata beagle_i2c_eeprom[] = { {I2C_BOARD_INFO ("eeprom" ,0x50 ),
@@ -425,7 +514,8 @@ ARRAY_SIZE(beagle_i2c_boardinfo));/* Bus 3 is attached to the DVI port where devices like the pico DLP * projector don't work reliably with 400kHz */ -omap_register_i2c_bus (3 ,100 , beagle_i2c_eeprom,ARRAY_SIZE (beagle_i2c_eeprom)); +// omap_register_i2c_bus(3, 100, beagle_i2c_eeprom, ARRAY_SIZE(beagle_i2c_eeprom)); +omap_register_i2c_bus (3 ,100 , ts_i2c_clients,ARRAY_SIZE (ts_i2c_clients));return 0 ; }
@@ -482,8 +572,14 @@ }, }; +static struct omap_board_config_kernel omap3_beagle_config[]__initdata = { + {OMAP_TAG_LCD , &omap3_beagle_lcd_config }, +}; +static void __init omap3_beagle_init_irq (void ) { + omap_board_config = omap3_beagle_config; + omap_board_config_size =ARRAY_SIZE (omap3_beagle_config);omap2_init_common_hw (mt46h32m32lf6_sdrc_params, mt46h32m32lf6_sdrc_params);omap_init_irq ();
@@ -558,6 +654,13 @@ .power = 100, }; +/* Pins for the BeagleTouch OLED */ +#define CS_PIN 139 +#define MOSI_PIN 144 +#define CLK_PIN 138 +#define RESET_PIN 137 +#define PANEL_PWR_PIN 143 +static void __init omap3_beagle_init (void ) {omap3_mux_init (board_mux,OMAP_PACKAGE_CBB );
@@ -567,6 +670,14 @@ ARRAY_SIZE(omap3_beagle_devices));omap_serial_init (); +/* BeagleTouch OLED */ +omap_mux_init_gpio (CS_PIN ,OMAP_PIN_OUTPUT ); +omap_mux_init_gpio (MOSI_PIN ,OMAP_PIN_OUTPUT ); +omap_mux_init_gpio (CLK_PIN ,OMAP_PIN_OUTPUT ); +omap_mux_init_gpio (RESET_PIN ,OMAP_PIN_OUTPUT ); +omap_mux_init_gpio (PANEL_PWR_PIN ,OMAP_PIN_OUTPUT ); +omap_mux_init_gpio (OMAP3_BEAGLETOUCH_TS_GPIO ,OMAP_PIN_INPUT_PULLUP ); +omap_mux_init_gpio (170 ,OMAP_PIN_INPUT );gpio_request (170 ,"DVI_nPD" );/* REVISIT leave DVI powered down until it's needed ... */
drivers/input/touchscreen/tsc2007.c +13 -1
@@ -311,12 +311,24 @@if (pdata->init_platform_hw) pdata->init_platform_hw (); - +/* err = request_irq(ts->irq, tsc2007_irq, 0, client->dev.driver->name, ts); if (err < 0) { dev_err(&client->dev, "irq %d busy?\n", ts->irq); goto err_free_mem; +} */ + +if (request_irq (ts->irq, tsc2007_irq,IRQF_TRIGGER_FALLING , + client->dev.driver->name, ts)) { +dev_info (&client->dev,"trying pin change workaround on irq %d\n" , ts->irq); + + err =request_irq (ts->irq, tsc2007_irq,IRQF_TRIGGER_FALLING |IRQF_TRIGGER_RISING , + client->dev.driver->name, ts); +if (err) { +dev_err (&client->dev,"irq %d busy?\n" , ts->irq); + goto err_free_mem; + } }/* Prepare for touch readings - power down ADC and enable PENIRQ */
drivers/video/omap2/displays/Kconfig +6 -0
@@ -44,4 +44,10 @@ select BACKLIGHT_CLASS_DEVICE help This is the LCD panel used on Nokia N900 + +config PANEL_CMEL_OLED43 + tristate "CMEL OLED43 LCD Panel" + depends on OMAP2_DSS + help + OLED Panel used on BeagleSlide endmenu
drivers/video/omap2/displays/Makefile +1 -0
@@ -1,4 +1,5 @@ obj-$(CONFIG_PANEL_GENERIC) += panel-generic.o +obj-$(CONFIG_PANEL_CMEL_OLED43) += panel-cmel-oled43.o obj-$(CONFIG_PANEL_SHARP_LS037V7DW01) += panel-sharp-ls037v7dw01.o obj-$(CONFIG_PANEL_SHARP_LQ043T1DG01) += panel-sharp-lq043t1dg01.o
drivers/video/omap2/displays/panel-cmel-oled43.c +325 -0
325 lines not on this page · raw message
Quoted 21 lines · Sparsh Wid hope
I am trying to apply patch through poky but it is not working. My patch is working when I'm trying it manually with following message :
surya@spectracore-Vostro-220s-Series:~/Desktop/my_kernel/linux$ patch -Np1 -i ../../../Surya/pro/kernel_patch/beagle.patch patching file arch/arm/mach-omap2/board-omap3beagle.c Hunk #7 FAILED at 336. Hunk #8 succeeded at 376 (offset 6 lines). Hunk #9 succeeded at 406 (offset 6 lines). Hunk #10 succeeded at 422 (offset 6 lines). Hunk #11 succeeded at 463 (offset 6 lines). Hunk #12 succeeded at 514 (offset 6 lines). Hunk #13 succeeded at 572 (offset 6 lines). Hunk #14 succeeded at 654 (offset 6 lines). Hunk #15 succeeded at 670 (offset 6 lines). 1 out of 15 hunks FAILED -- saving rejects to file arch/arm/mach-omap2/board-omap3beagle.c.rej patching file drivers/input/touchscreen/tsc2007.c patching file drivers/video/omap2/displays/Kconfig patching file drivers/video/omap2/displays/Makefile patching file drivers/video/omap2/displays/panel-cmel-oled43.c
Quoted 3 lines
but with poky
do_patchis getting failed.
I'm sending my PATCH FILE and ERROR LOG in attachments.
This is not a working patch, it has rejects as shown by the message "1 out of 15 hunks FAILED -- saving rejects to file". The offsets also show the patch has issues too which should be fixed. Poky is perfectly correct in failing to apply the patch as the patch is broken.
Cheers,
Richard