Skip to content

Commit b64a1cb

Browse files
sudipm-mukherjeegregkh
authored andcommitted
Revert "Staging: panel: usleep_range is preferred over udelay"
This reverts commit ebd4351. We should not be sleeping inside spin_lock. Fixes: ebd4351 ("Staging: panel: usleep_range is preferred over udelay") Cc: Sirnam Swetha <theonly.ultimate@gmail.com> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Reported-by: Huang, Ying <ying.huang@intel.com> Tested-by: Huang, Ying <ying.huang@intel.com> Cc: stable <stable@vger.kernel.org> # 4.4 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f744c42 commit b64a1cb

File tree

1 file changed

+15
-19
lines changed

1 file changed

+15
-19
lines changed

drivers/staging/panel/panel.c

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -825,8 +825,7 @@ static void lcd_write_cmd_s(int cmd)
825825
lcd_send_serial(0x1F); /* R/W=W, RS=0 */
826826
lcd_send_serial(cmd & 0x0F);
827827
lcd_send_serial((cmd >> 4) & 0x0F);
828-
/* the shortest command takes at least 40 us */
829-
usleep_range(40, 100);
828+
udelay(40); /* the shortest command takes at least 40 us */
830829
spin_unlock_irq(&pprt_lock);
831830
}
832831

@@ -837,8 +836,7 @@ static void lcd_write_data_s(int data)
837836
lcd_send_serial(0x5F); /* R/W=W, RS=1 */
838837
lcd_send_serial(data & 0x0F);
839838
lcd_send_serial((data >> 4) & 0x0F);
840-
/* the shortest data takes at least 40 us */
841-
usleep_range(40, 100);
839+
udelay(40); /* the shortest data takes at least 40 us */
842840
spin_unlock_irq(&pprt_lock);
843841
}
844842

@@ -848,20 +846,19 @@ static void lcd_write_cmd_p8(int cmd)
848846
spin_lock_irq(&pprt_lock);
849847
/* present the data to the data port */
850848
w_dtr(pprt, cmd);
851-
/* maintain the data during 20 us before the strobe */
852-
usleep_range(20, 100);
849+
udelay(20); /* maintain the data during 20 us before the strobe */
853850

854851
bits.e = BIT_SET;
855852
bits.rs = BIT_CLR;
856853
bits.rw = BIT_CLR;
857854
set_ctrl_bits();
858855

859-
usleep_range(40, 100); /* maintain the strobe during 40 us */
856+
udelay(40); /* maintain the strobe during 40 us */
860857

861858
bits.e = BIT_CLR;
862859
set_ctrl_bits();
863860

864-
usleep_range(120, 500); /* the shortest command takes at least 120 us */
861+
udelay(120); /* the shortest command takes at least 120 us */
865862
spin_unlock_irq(&pprt_lock);
866863
}
867864

@@ -871,20 +868,19 @@ static void lcd_write_data_p8(int data)
871868
spin_lock_irq(&pprt_lock);
872869
/* present the data to the data port */
873870
w_dtr(pprt, data);
874-
/* maintain the data during 20 us before the strobe */
875-
usleep_range(20, 100);
871+
udelay(20); /* maintain the data during 20 us before the strobe */
876872

877873
bits.e = BIT_SET;
878874
bits.rs = BIT_SET;
879875
bits.rw = BIT_CLR;
880876
set_ctrl_bits();
881877

882-
usleep_range(40, 100); /* maintain the strobe during 40 us */
878+
udelay(40); /* maintain the strobe during 40 us */
883879

884880
bits.e = BIT_CLR;
885881
set_ctrl_bits();
886882

887-
usleep_range(45, 100); /* the shortest data takes at least 45 us */
883+
udelay(45); /* the shortest data takes at least 45 us */
888884
spin_unlock_irq(&pprt_lock);
889885
}
890886

@@ -894,7 +890,7 @@ static void lcd_write_cmd_tilcd(int cmd)
894890
spin_lock_irq(&pprt_lock);
895891
/* present the data to the control port */
896892
w_ctr(pprt, cmd);
897-
usleep_range(60, 120);
893+
udelay(60);
898894
spin_unlock_irq(&pprt_lock);
899895
}
900896

@@ -904,7 +900,7 @@ static void lcd_write_data_tilcd(int data)
904900
spin_lock_irq(&pprt_lock);
905901
/* present the data to the data port */
906902
w_dtr(pprt, data);
907-
usleep_range(60, 120);
903+
udelay(60);
908904
spin_unlock_irq(&pprt_lock);
909905
}
910906

@@ -947,7 +943,7 @@ static void lcd_clear_fast_s(void)
947943
lcd_send_serial(0x5F); /* R/W=W, RS=1 */
948944
lcd_send_serial(' ' & 0x0F);
949945
lcd_send_serial((' ' >> 4) & 0x0F);
950-
usleep_range(40, 100); /* the shortest data takes at least 40 us */
946+
udelay(40); /* the shortest data takes at least 40 us */
951947
}
952948
spin_unlock_irq(&pprt_lock);
953949

@@ -971,21 +967,21 @@ static void lcd_clear_fast_p8(void)
971967
w_dtr(pprt, ' ');
972968

973969
/* maintain the data during 20 us before the strobe */
974-
usleep_range(20, 100);
970+
udelay(20);
975971

976972
bits.e = BIT_SET;
977973
bits.rs = BIT_SET;
978974
bits.rw = BIT_CLR;
979975
set_ctrl_bits();
980976

981977
/* maintain the strobe during 40 us */
982-
usleep_range(40, 100);
978+
udelay(40);
983979

984980
bits.e = BIT_CLR;
985981
set_ctrl_bits();
986982

987983
/* the shortest data takes at least 45 us */
988-
usleep_range(45, 100);
984+
udelay(45);
989985
}
990986
spin_unlock_irq(&pprt_lock);
991987

@@ -1007,7 +1003,7 @@ static void lcd_clear_fast_tilcd(void)
10071003
for (pos = 0; pos < lcd.height * lcd.hwidth; pos++) {
10081004
/* present the data to the data port */
10091005
w_dtr(pprt, ' ');
1010-
usleep_range(60, 120);
1006+
udelay(60);
10111007
}
10121008

10131009
spin_unlock_irq(&pprt_lock);

0 commit comments

Comments
 (0)