@@ -825,7 +825,8 @@ static void lcd_write_cmd_s(int cmd)
825
825
lcd_send_serial (0x1F ); /* R/W=W, RS=0 */
826
826
lcd_send_serial (cmd & 0x0F );
827
827
lcd_send_serial ((cmd >> 4 ) & 0x0F );
828
- udelay (40 ); /* the shortest command takes at least 40 us */
828
+ /* the shortest command takes at least 40 us */
829
+ usleep_range (40 , 100 );
829
830
spin_unlock_irq (& pprt_lock );
830
831
}
831
832
@@ -836,7 +837,8 @@ static void lcd_write_data_s(int data)
836
837
lcd_send_serial (0x5F ); /* R/W=W, RS=1 */
837
838
lcd_send_serial (data & 0x0F );
838
839
lcd_send_serial ((data >> 4 ) & 0x0F );
839
- udelay (40 ); /* the shortest data takes at least 40 us */
840
+ /* the shortest data takes at least 40 us */
841
+ usleep_range (40 , 100 );
840
842
spin_unlock_irq (& pprt_lock );
841
843
}
842
844
@@ -846,19 +848,20 @@ static void lcd_write_cmd_p8(int cmd)
846
848
spin_lock_irq (& pprt_lock );
847
849
/* present the data to the data port */
848
850
w_dtr (pprt , cmd );
849
- udelay (20 ); /* maintain the data during 20 us before the strobe */
851
+ /* maintain the data during 20 us before the strobe */
852
+ usleep_range (20 , 100 );
850
853
851
854
bits .e = BIT_SET ;
852
855
bits .rs = BIT_CLR ;
853
856
bits .rw = BIT_CLR ;
854
857
set_ctrl_bits ();
855
858
856
- udelay (40 ); /* maintain the strobe during 40 us */
859
+ usleep_range (40 , 100 ); /* maintain the strobe during 40 us */
857
860
858
861
bits .e = BIT_CLR ;
859
862
set_ctrl_bits ();
860
863
861
- udelay (120 ); /* the shortest command takes at least 120 us */
864
+ usleep_range (120 , 500 ); /* the shortest command takes at least 120 us */
862
865
spin_unlock_irq (& pprt_lock );
863
866
}
864
867
@@ -868,19 +871,20 @@ static void lcd_write_data_p8(int data)
868
871
spin_lock_irq (& pprt_lock );
869
872
/* present the data to the data port */
870
873
w_dtr (pprt , data );
871
- udelay (20 ); /* maintain the data during 20 us before the strobe */
874
+ /* maintain the data during 20 us before the strobe */
875
+ usleep_range (20 , 100 );
872
876
873
877
bits .e = BIT_SET ;
874
878
bits .rs = BIT_SET ;
875
879
bits .rw = BIT_CLR ;
876
880
set_ctrl_bits ();
877
881
878
- udelay (40 ); /* maintain the strobe during 40 us */
882
+ usleep_range (40 , 100 ); /* maintain the strobe during 40 us */
879
883
880
884
bits .e = BIT_CLR ;
881
885
set_ctrl_bits ();
882
886
883
- udelay (45 ); /* the shortest data takes at least 45 us */
887
+ usleep_range (45 , 100 ); /* the shortest data takes at least 45 us */
884
888
spin_unlock_irq (& pprt_lock );
885
889
}
886
890
@@ -890,7 +894,7 @@ static void lcd_write_cmd_tilcd(int cmd)
890
894
spin_lock_irq (& pprt_lock );
891
895
/* present the data to the control port */
892
896
w_ctr (pprt , cmd );
893
- udelay (60 );
897
+ usleep_range (60 , 120 );
894
898
spin_unlock_irq (& pprt_lock );
895
899
}
896
900
@@ -900,7 +904,7 @@ static void lcd_write_data_tilcd(int data)
900
904
spin_lock_irq (& pprt_lock );
901
905
/* present the data to the data port */
902
906
w_dtr (pprt , data );
903
- udelay (60 );
907
+ usleep_range (60 , 120 );
904
908
spin_unlock_irq (& pprt_lock );
905
909
}
906
910
@@ -943,7 +947,7 @@ static void lcd_clear_fast_s(void)
943
947
lcd_send_serial (0x5F ); /* R/W=W, RS=1 */
944
948
lcd_send_serial (' ' & 0x0F );
945
949
lcd_send_serial ((' ' >> 4 ) & 0x0F );
946
- udelay (40 ); /* the shortest data takes at least 40 us */
950
+ usleep_range (40 , 100 ); /* the shortest data takes at least 40 us */
947
951
}
948
952
spin_unlock_irq (& pprt_lock );
949
953
@@ -967,21 +971,21 @@ static void lcd_clear_fast_p8(void)
967
971
w_dtr (pprt , ' ' );
968
972
969
973
/* maintain the data during 20 us before the strobe */
970
- udelay (20 );
974
+ usleep_range (20 , 100 );
971
975
972
976
bits .e = BIT_SET ;
973
977
bits .rs = BIT_SET ;
974
978
bits .rw = BIT_CLR ;
975
979
set_ctrl_bits ();
976
980
977
981
/* maintain the strobe during 40 us */
978
- udelay (40 );
982
+ usleep_range (40 , 100 );
979
983
980
984
bits .e = BIT_CLR ;
981
985
set_ctrl_bits ();
982
986
983
987
/* the shortest data takes at least 45 us */
984
- udelay (45 );
988
+ usleep_range (45 , 100 );
985
989
}
986
990
spin_unlock_irq (& pprt_lock );
987
991
@@ -1003,7 +1007,7 @@ static void lcd_clear_fast_tilcd(void)
1003
1007
for (pos = 0 ; pos < lcd .height * lcd .hwidth ; pos ++ ) {
1004
1008
/* present the data to the data port */
1005
1009
w_dtr (pprt , ' ' );
1006
- udelay (60 );
1010
+ usleep_range (60 , 120 );
1007
1011
}
1008
1012
1009
1013
spin_unlock_irq (& pprt_lock );
0 commit comments