• Aucun résultat trouvé

Appendix : How to Apply These Terms to Your New Programs

the implied warranties of merchantability and fitness for a particular purpose. The entire risk as to the quality and performance of the Program is with you. Should the Program prove defective, you assume the cost of all necessary servicing, repair or correction.

12. In no event unless required by applicable law or agreed to in writing will any copyright holder, or any other party who may modify and/or redistribute the program as permitted above, be liable to you for damages, including any general, special, incidental or consequential damages arising out of the use or inability to use the program (including but not limited to loss of data or data being rendered inaccurate or losses sustained by you or third parties or a failure of the Program to operate with any other programs), even if such holder or other party has been advised of the possibility of such damages.

END OF TERMS AND CONDITIONS

A.3 Appendix : How to Apply These Terms to Your New Programs

If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.

To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty ; and each file should have at least the “copyright” line and a pointer to where the full notice is found.

<one line to give the program’s name and a brief idea of what it does.>

Copyright (C) 19yy <name of author>

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software

Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

Also add information on how to contact you by electronic and paper mail.

If the program is interactive, make it output a short notice like this when it starts in an interactive mode : Gnomovision version 69, Copyright (C) 19yy name of author

Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type ‘show w’.

This is free software, and you are welcome to redistribute it under certain conditions; type ‘show c’ for details.

The hypothetical commands ‘show w’ and ‘show c’ should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than ‘show w’ and ‘show c’ ; they could even be mouse-clicks or menu items–whatever suits your program.

You should also get your employer (if you work as a programmer) or your school, if any, to sign a “copyright disclaimer”

for the program, if necessary. Here is a sample ; alter the names :

Yoyodyne, Inc., hereby disclaims all copyright interest in the program

‘Gnomovision’ (which makes passes at compilers) written by James Hacker.

A.3. APPENDIX : HOW TO APPLY THESE TERMS TO YOUR NEW PROGRAMSANNEXE A. THE GNU GENERAL PUBLIC LICENCE

<signature of Ty Coon>, 1 April 1989 Ty Coon, President of Vice

This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License.

55

ANNEXE B. CODE SOURCES

B Code sources

B.1 Module Noyau

1 /*

2 * Display Driver for hx5116 controler for AMOLED 3 *

4 * Copyright (c) 2009 Fabien Marteau - ARMadeus Systems 5 *

6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License version 2 as 8 * published by the Free Software Foundation.

9 *

24 #include <mach/imxfb.h> /* Backlight machinfo struct is defined here */

25 #include <mach/hardware.h>

31 #define DRIVER_VERSION " 0 . 1 "

32

33 static int lcd_ts_write(struct lcd_ts * lcd_ts_dev,u8 address, u16 data){

34

35 u8 command[2];

36 int ret;

37 /* Address */

38 command[0] = (address << 1) | HX5116_SPI_WRITE;

39 command[1] = data;

40 ret = spi_write(lcd_ts_dev->spi, command, 2);

41 if (ret < 0)

42 printk("ERROR : c a n ’ t w r i t e on hx5116 \ n ");

43 44 } 45

46 static int lcd_ts_init_screen( struct lcd_ts * lcd_ts_dev){

47

48 /* gpio_set_value(lcd_ts_dev->resetpin,1); */

49

50 /* initial procedure for 24-bit parallel RGB (DE) */

51 lcd_ts_write (lcd_ts_dev, 0x04, 0x23); /*set display mode 24-bit parallel RGB (DE)*/

52 lcd_ts_write (lcd_ts_dev, 0x05, 0x82); /*set display mode*/

53 lcd_ts_write (lcd_ts_dev, 0x07, 0x0F); /*set driver capability*/

54 lcd_ts_write (lcd_ts_dev, 0x34, 0x18); /*set display timing*/

55 lcd_ts_write (lcd_ts_dev, 0x35, 0x28); /*set display timing*/

56 lcd_ts_write (lcd_ts_dev, 0x36, 0x16); /*set display timing*/

57 lcd_ts_write (lcd_ts_dev, 0x37, 0x01); /*set display timing*/

58 lcd_ts_write (lcd_ts_dev, 0x02, 0x02); /*OTP On*/

59 lcd_ts_write (lcd_ts_dev, 0x0A, 0x79); /*VGHVGL=+/-6V*/

60 lcd_ts_write (lcd_ts_dev, 0x09, 0x20); /*VGAM1OUT=4.85V*/

61 lcd_ts_write (lcd_ts_dev, 0x10, 0x6A); /*set R slop*/

62 lcd_ts_write (lcd_ts_dev, 0x11, 0x6A); /*set G slop*/

63 lcd_ts_write (lcd_ts_dev, 0x12, 0x68); /*set B slop*/

64 lcd_ts_write (lcd_ts_dev, 0x13, 0x00); /*set R_0*/

65 lcd_ts_write (lcd_ts_dev, 0x14, 0x04); /*set R_10*/

B.1. MODULE NOYAU ANNEXE B. CODE SOURCES

66 lcd_ts_write (lcd_ts_dev, 0x15, 0x05); /*set R_36*/

67 lcd_ts_write (lcd_ts_dev, 0x16, 0x05); /*set R_80*/

68 lcd_ts_write (lcd_ts_dev, 0x17, 0x04); /*set R_124*/

69 lcd_ts_write (lcd_ts_dev, 0x18, 0x03); /*set R_168*/

70 lcd_ts_write (lcd_ts_dev, 0x19, 0x02); /*set R_212*/

71 lcd_ts_write (lcd_ts_dev, 0x1A, 0x02); /*set R_255*/

72 lcd_ts_write (lcd_ts_dev, 0x1B, 0x00); /*set G_0*/

73 lcd_ts_write (lcd_ts_dev, 0x1C, 0x06); /*set G_10*/

74 lcd_ts_write (lcd_ts_dev, 0x1D, 0x05); /*set G_36*/

75 lcd_ts_write (lcd_ts_dev, 0x1E, 0x06); /*set G_80*/

76 lcd_ts_write (lcd_ts_dev, 0x1F, 0x06); /*set G_124*/

77 lcd_ts_write (lcd_ts_dev, 0x20, 0x05); /*set G_168*/

78 lcd_ts_write (lcd_ts_dev, 0x21, 0x05); /*set G_212*/

79 lcd_ts_write (lcd_ts_dev, 0x22, 0x07); /*set G_255*/

80 lcd_ts_write (lcd_ts_dev, 0x23, 0x00); /*set G_0*/

81 lcd_ts_write (lcd_ts_dev, 0x24, 0x07); /*set B_10*/

82 lcd_ts_write (lcd_ts_dev, 0x25, 0x06); /*set B_36*/

83 lcd_ts_write (lcd_ts_dev, 0x26, 0x07); /*set B_80*/

84 lcd_ts_write (lcd_ts_dev, 0x27, 0x07); /*set B_124*/

85 lcd_ts_write (lcd_ts_dev, 0x28, 0x06); /*set B_168*/

86 lcd_ts_write (lcd_ts_dev, 0x29, 0x04); /*set B_212*/

87 lcd_ts_write (lcd_ts_dev, 0x2A, 0x07); /*set B_255*/

88 lcd_ts_write (lcd_ts_dev, 0x06, 0x03); /*set display on*/

89

90 /* gpio_set_value(lcd_ts_dev->resetpin,1);*/

91 }

92 static int lcd_ts_probe (struct spi_device *spi_device){

93 94

95 printk("LCD SPI Bus R e g i s t r a t i o n \ n ");

96 struct lcd_ts *lcd_data;

97 int err = -EINVAL;

98 lcd_data = (struct lcd_ts *)(spi_device->dev.platform_data);

99 lcd_data->init(spi_device); /* Initialise GPIO */

100

114 static int lcd_ts_remove(struct spi_device *spi_device){

115

116 struct lcd_ts * lcd_data ;

117 lcd_data = (struct lcd_ts * )(spi_device->dev.platform_data);

118

119 lcd_data->exit(spi_device); /* Free GPIO */

120 /* Init Sequence */

126 static int lcd_ts_shutdown(struct spi_device *spi_device){

127

128 return 0;

129 130 } 131

132 static int lcd_ts_suspend(struct spi_device *spi_device){

133 return 0;

134 135 136 }

137 static int lcd_ts_resume(struct spi_device *spi_device){

138

139 return 0;

140 141 }

142 static struct spi_driver lcd_ts_driver = {

57

Documents relatifs