12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510 |
- #include <linux/module.h>
- #include <linux/i2c.h>
- #include <linux/delay.h>
- #include "ark_camera.h"
- #include "ark_isp_exposure_cmos.h"
- #include "Gem_isp_io.h"
- static u32_t isp_video_width = 1920;
- static u32_t isp_video_height = 1080;
- static u32_t isp_sensor_bit = ARKN141_ISP_SENSOR_BIT_10;
- static unsigned int isp_yuv_format = ARKN141_ISP_YUV_FORMAT_Y_UV420; // ISP??YUV??????脢陆????
- static unsigned int isp_sensor_fps = 0;
- // 猫沤路氓聫鈥揑SP猫搂鈥犆┞⑩€樏�♀€灻�锯€溍モ€÷好ヂ奥好ヂ�该ヂ�∶ぢ光€�(1080P忙藛鈥撁ㄢ偓鈥�720P)
- u32_t isp_get_video_width (void)
- {
- return isp_video_width;
- }
- u32_t isp_get_video_height (void)
- {
- return isp_video_height;
- }
- //0茂录拧y_uv420 1:y_uv422 2:yuv420 3:yuv422
- unsigned int isp_get_video_format (void)
- {
- return isp_yuv_format;
- }
- unsigned int isp_get_video_image_size (void)
- {
- if(isp_yuv_format == ARKN141_ISP_YUV_FORMAT_Y_UV420 || isp_yuv_format == ARKN141_ISP_YUV_FORMAT_YUV420)
- return isp_video_width * isp_video_height * 3 / 2;
- else // ARKN141_ISP_YUV_FORMAT_Y_UV422 ARKN141_ISP_YUV_FORMAT_Y_UV422
- return isp_video_width * isp_video_height * 2;
- }
- unsigned int isp_get_sensor_bit (void)
- {
- return isp_sensor_bit;
- }
- unsigned int isp_get_sensor_fps(void)
- {
- return isp_sensor_fps;
- }
- static struct i2c_client *i2c_client;
- static int I2C_WRITE (unsigned int addr, unsigned int data)
- {
- return i2c_smbus_write_byte_data(i2c_client, addr, data);
- }
- static unsigned int I2C_READ (unsigned int addr)
- {
- return i2c_smbus_read_byte_data(i2c_client, addr);
- }
- typedef struct stSensor_cfg {
- unsigned int addr;
- unsigned char data;
- } sensor_cfg;
- static struct stSensor_cfg stSensor_cfg_1080P25FPS_10bit[] =
- {
- //window_size=1920*1080
- //mclk=24mhz,pclk=74.25mhz
- //pixel_line_total=2640,line_frame_total=1125
- //row_time=35.55usus,frame_rate=25fps
- /*system*/
- 0xfe,0x80,
- 0xfe,0x80,
- 0xfe,0x80,
- 0xfe,0x00,
- 0xf2,0x00,//[1]I2C_open_ena [0]pwd_dn
- 0xf3,0x0f,//00[3]Sdata_pad_io [2:0]Ssync_pad_io
- 0xf4,0x36,//[6:4]pll_ldo_set
- 0xf5,0xc0,//[7]soc_mclk_enable [6]pll_ldo_en [5:4]cp_clk_sel [3:0]cp_clk_div
- 0xf6,0x44,//[7:3]wpllclk_div [2:0]refmp_div
- 0xf7,0x01,//[7]refdiv2d5_en [6]refdiv1d5_en [5:4]scaler_mode [3]refmp_enb [1]div2en [0]pllmp_en
- 0xf8,0x63,//38////38//[7:0]pllmp_div
- 0xf9,0x40,//82//[7:3]rpllclk_div [2:1]pllmp_prediv [0]analog_pwc
- 0xfc,0x8e,
- /*cisctl&analog*/
- 0xfe,0x00,
- 0x87,0x18, //[6]aec_delay_mode
- 0xee,0x30, //[5:4]dwen_sramen
- 0xd0,0xb7, //ramp_en
- 0x03,0x04,
- 0x04,0x60,
- 0x05,0x05,// 0x528 = 1320
- 0x06,0x28,//
- 0x07,0x00,
- 0x08,0x11, //19
- 0x09,0x00,
- 0x0a,0x02, //cisctl row start
- 0x0b,0x00,
- 0x0c,0x02, //cisctl col start
- 0x0d,0x04,
- 0x0e,0x40, //38
- 0x12,0xe2, //vsync_ahead_mode
- 0x13,0x16,
- 0x19,0x0a, //ad_pipe_num
- 0x21,0x1c, //eqc1fc_eqc2fc_sw
- 0x28,0x0a, //16//eqc2_c2clpen_sw
- 0x29,0x24, //eq_post_width
- 0x2b,0x04, //c2clpen --eqc2
- 0x32,0xf8, //[5]txh_en ->avdd28
- 0x37,0x03, //[3:2]eqc2sel=0
- 0x39,0x15,//17 //[3:0]rsgl
- 0x43,0x07,//vclamp
- 0x44,0x40, //0e//post_tx_width
- 0x46,0x0b,
- 0x4b,0x20, //rst_tx_width
- 0x4e,0x08, //12//ramp_t1_width
- 0x55,0x20, //read_tx_width_pp
- 0x66,0x05, //18//stspd_width_r1
- 0x67,0x05, //40//5//stspd_width_r
- 0x77,0x01, //dacin offset x31
- 0x78,0x00, //dacin offset
- 0x7c,0x93, //[1:0] co1comp
- 0x8c,0x12, //12 ramp_t1_ref
- 0x8d,0x92,//90
- 0x90,0x01,
- 0x9d,0x10,
- 0xce,0x7c,//70//78//[4:2]c1isel
- 0xd2,0x41,//[5:3]c2clamp
- 0xd3,0xdc,//ec//0x39[7]=0,0xd3[3]=1 rsgh=vref
- 0xe6,0x50,//ramps offset
- /*gain*/
- 0xb6,0xc0,
- 0xb0,0x70,
- 0xb1,0x01,
- 0xb2,0x00,
- 0xb3,0x00,
- 0xb4,0x00,
- 0xb8,0x01,
- 0xb9,0x00,
- /*blk*/
- 0x26,0x30,//23 //[4]氓鈥犫劉0茂录艗氓鈥β╪ mode
- 0xfe,0x01,
- 0x40,0x23,
- 0x55,0x07,
- 0x60,0x40, //[7:0]WB_offset
- 0xfe,0x04,
- 0x14,0x78, //g1 ratio
- 0x15,0x78, //r ratio
- 0x16,0x78, //b ratio
- 0x17,0x78, //g2 ratio
- /*window*/
- 0xfe,0x01,
- 0x92,0x00, //win y1
- 0x94,0x03, //win x1
- 0x95,0x04,
- 0x96,0x38, //[10:0]out_height
- 0x97,0x07,
- 0x98,0x80, //[11:0]out_width
- /*ISP*/
- 0xfe,0x01,
- 0x01,0x05,//03//[3]dpc blending mode [2]noise_mode [1:0]center_choose 2b'11:median 2b'10:avg 2'b00:near
- 0x02,0x89, //[7:0]BFF_sram_mode
- 0x04,0x01, //[0]DD_en
- 0x07,0xa6,
- 0x08,0xa9,
- 0x09,0xa8,
- 0x0a,0xa7,
- 0x0b,0xff,
- 0x0c,0xff,
- 0x0f,0x00,
- 0x50,0x1c,
- 0x89,0x03,
- 0xfe,0x04,
- 0x28,0x86,//84
- 0x29,0x86,//84
- 0x2a,0x86,//84
- 0x2b,0x68,//84
- 0x2c,0x68,//84
- 0x2d,0x68,//84
- 0x2e,0x68,//83
- 0x2f,0x68,//82
- 0x30,0x4f,//82
- 0x31,0x68,//82
- 0x32,0x67,//82
- 0x33,0x66,//82
- 0x34,0x66,//82
- 0x35,0x66,//82
- 0x36,0x66,//64
- 0x37,0x66,//68
- 0x38,0x62,
- 0x39,0x62,
- 0x3a,0x62,
- 0x3b,0x62,
- 0x3c,0x62,
- 0x3d,0x62,
- 0x3e,0x62,
- 0x3f,0x62,
- /****DVP & MIPI****/
- 0xfe,0x01,
- 0x9a,0x06, //[5]OUT_gate_mode [4]hsync_delay_half_pclk [3]data_delay_half_pclk [2]vsync_polarity [1]hsync_polarity [0]pclk_out_polarity
- 0xfe,0x00,
- 0x7b,0x28, //[7:6]updn [5:4]drv_high_data [3:2]drv_low_data [1:0]drv_pclk
- 0x23,0x2d, //[3]rst_rc [2:1]drv_sync [0]pwd_rc
- 0xfe,0x03,
- 0x01,0x20, //27[6:5]clkctr [2]phy-lane1_en [1]phy-lane0_en [0]phy_clk_en
- 0x02,0x56, //[7:6]data1ctr [5:4]data0ctr [3:0]mipi_diff
- 0x03,0xb2, //b6[7]clklane_p2s_sel [6:5]data0hs_ph [4]data0_delay1s [3]clkdelay1s [2]mipi_en [1:0]clkhs_ph
- 0x12,0x80,
- 0x13,0x07, //LWC
- 0xfe,0x00,
- 0x3e,0x40, //91[7]lane_ena [6]DVPBUF_ena [5]ULPEna [4]MIPI_ena [3]mipi_set_auto_disable [2]RAW8_mode [1]ine_sync_mode [0]double_lane_en
- };
- static struct stSensor_cfg stSensor_cfg_1080P30FPS_10bit[] =
- {
- //window_size=1920*1080
- //mclk=24mhz,pclk=74.25mhz
- //pixel_line_total=2200,line_frame_total=1125
- //row_time=29.629us,frame_rate=30fps
- /*system*/
- 0xfe,0x80,
- 0xfe,0x80,
- 0xfe,0x80,
- 0xfe,0x00,
- 0xf2,0x00,//[1]I2C_open_ena [0]pwd_dn
- 0xf3,0x0f,//00[3]Sdata_pad_io [2:0]Ssync_pad_io
- 0xf4,0x36,//[6:4]pll_ldo_set
- 0xf5,0xc0,//[7]soc_mclk_enable [6]pll_ldo_en [5:4]cp_clk_sel [3:0]cp_clk_div
- 0xf6,0x44,//[7:3]wpllclk_div [2:0]refmp_div
- 0xf7,0x01,//[7]refdiv2d5_en [6]refdiv1d5_en [5:4]scaler_mode [3]refmp_enb [1]div2en [0]pllmp_en
- 0xf8,0x63,//38////38//[7:0]pllmp_div
- 0xf9,0x40,//82//[7:3]rpllclk_div [2:1]pllmp_prediv [0]analog_pwc
- 0xfc,0x8e,
- /*cisctl&analog*/
- 0xfe,0x00,
- 0x87,0x18, //[6]aec_delay_mode
- 0xee,0x30, //[5:4]dwen_sramen
- 0xd0,0xb7, //ramp_en
- 0x03,0x04,
- 0x04,0x60,
- 0x05,0x04,// 0x44c = 1100
- 0x06,0x4c,//
- 0x07,0x00,
- 0x08,0x11, //19
- 0x09,0x00,
- 0x0a,0x02, //cisctl row start
- 0x0b,0x00,
- 0x0c,0x02, //cisctl col start
- 0x0d,0x04,
- 0x0e,0x40, //38
- 0x12,0xe2, //vsync_ahead_mode
- 0x13,0x16,
- 0x19,0x0a, //ad_pipe_num
- 0x21,0x1c, //eqc1fc_eqc2fc_sw
- 0x28,0x0a, //16//eqc2_c2clpen_sw
- 0x29,0x24, //eq_post_width
- 0x2b,0x04, //c2clpen --eqc2
- 0x32,0xf8, //[5]txh_en ->avdd28
- 0x37,0x03, //[3:2]eqc2sel=0
- 0x39,0x15,//17 //[3:0]rsgl
- 0x43,0x07,//vclamp
- 0x44,0x40, //0e//post_tx_width
- 0x46,0x0b,
- 0x4b,0x20, //rst_tx_width
- 0x4e,0x08, //12//ramp_t1_width
- 0x55,0x20, //read_tx_width_pp
- 0x66,0x05, //18//stspd_width_r1
- 0x67,0x05, //40//5//stspd_width_r
- 0x77,0x01, //dacin offset x31
- 0x78,0x00, //dacin offset
- 0x7c,0x93, //[1:0] co1comp
- 0x8c,0x12, //12 ramp_t1_ref
- 0x8d,0x92,//90
- 0x90,0x01,
- 0x9d,0x10,
- 0xce,0x7c,//70//78//[4:2]c1isel
- 0xd2,0x41,//[5:3]c2clamp
- 0xd3,0xdc,//ec//0x39[7]=0,0xd3[3]=1 rsgh=vref
- 0xe6,0x50,//ramps offset
- /*gain*/
- 0xb6,0xc0,
- 0xb0,0x70,
- 0xb1,0x01,
- 0xb2,0x00,
- 0xb3,0x00,
- 0xb4,0x00,
- 0xb8,0x01,
- 0xb9,0x00,
- /*blk*/
- 0x26,0x30,//23 //[4]氓鈥犫劉0茂录艗氓鈥β╪ mode
- 0xfe,0x01,
- 0x40,0x23,
- 0x55,0x07,
- 0x60,0x40, //[7:0]WB_offset
- 0xfe,0x04,
- 0x14,0x78, //g1 ratio
- 0x15,0x78, //r ratio
- 0x16,0x78, //b ratio
- 0x17,0x78, //g2 ratio
- /*window*/
- 0xfe,0x01,
- 0x92,0x00, //win y1
- 0x94,0x03, //win x1
- 0x95,0x04,
- 0x96,0x38, //[10:0]out_height
- 0x97,0x07,
- 0x98,0x80, //[11:0]out_width
- /*ISP*/
- 0xfe,0x01,
- 0x01,0x05,//03//[3]dpc blending mode [2]noise_mode [1:0]center_choose 2b'11:median 2b'10:avg 2'b00:near
- 0x02,0x89, //[7:0]BFF_sram_mode
- 0x04,0x01, //[0]DD_en
- 0x07,0xa6,
- 0x08,0xa9,
- 0x09,0xa8,
- 0x0a,0xa7,
- 0x0b,0xff,
- 0x0c,0xff,
- 0x0f,0x00,
- 0x50,0x1c,
- 0x89,0x03,
- 0xfe,0x04,
- 0x28,0x86,//84
- 0x29,0x86,//84
- 0x2a,0x86,//84
- 0x2b,0x68,//84
- 0x2c,0x68,//84
- 0x2d,0x68,//84
- 0x2e,0x68,//83
- 0x2f,0x68,//82
- 0x30,0x4f,//82
- 0x31,0x68,//82
- 0x32,0x67,//82
- 0x33,0x66,//82
- 0x34,0x66,//82
- 0x35,0x66,//82
- 0x36,0x66,//64
- 0x37,0x66,//68
- 0x38,0x62,
- 0x39,0x62,
- 0x3a,0x62,
- 0x3b,0x62,
- 0x3c,0x62,
- 0x3d,0x62,
- 0x3e,0x62,
- 0x3f,0x62,
- /****DVP & MIPI****/
- 0xfe,0x01,
- 0x9a,0x06, //[5]OUT_gate_mode [4]hsync_delay_half_pclk [3]data_delay_half_pclk [2]vsync_polarity [1]hsync_polarity [0]pclk_out_polarity
- 0xfe,0x00,
- 0x7b,0x28, //[7:6]updn [5:4]drv_high_data [3:2]drv_low_data [1:0]drv_pclk
- 0x23,0x2d, //[3]rst_rc [2:1]drv_sync [0]pwd_rc
- 0xfe,0x03,
- 0x01,0x20, //27[6:5]clkctr [2]phy-lane1_en [1]phy-lane0_en [0]phy_clk_en
- 0x02,0x56, //[7:6]data1ctr [5:4]data0ctr [3:0]mipi_diff
- 0x03,0xb2, //b6[7]clklane_p2s_sel [6:5]data0hs_ph [4]data0_delay1s [3]clkdelay1s [2]mipi_en [1:0]clkhs_ph
- 0x12,0x80,
- 0x13,0x07, //LWC
- 0xfe,0x00,
- 0x3e,0x40, //91[7]lane_ena [6]DVPBUF_ena [5]ULPEna [4]MIPI_ena [3]mipi_set_auto_disable [2]RAW8_mode [1]ine_sync_mode [0]double_lane_en
- };
- // 1080P/30fps忙篓隆氓录聫 10bit
- int gc2053_init_30fps_10bit (void)
- {
- int i;
- XM_printf ("cmos sensor gc2053 init 1080P 30fps 10bit mode\n");
- for(i = 0; i < sizeof(stSensor_cfg_1080P30FPS_10bit)/sizeof(stSensor_cfg_1080P30FPS_10bit[0]); i ++)
- {
- if(I2C_WRITE (stSensor_cfg_1080P30FPS_10bit[i].addr, stSensor_cfg_1080P30FPS_10bit[i].data) < 0)
- return -1;
- }
- return 0;
- }
- // 1080P/25fps忙篓隆氓录聫 10bit
- int gc2053_init_25fps_10bit (void)
- {
- int i;
- XM_printf ("cmos sensor gc2053 init 1080P 25fps 10bit mode\n");
- for(i = 0; i < sizeof(stSensor_cfg_1080P25FPS_10bit)/sizeof(stSensor_cfg_1080P25FPS_10bit[0]); i ++)
- {
- if(I2C_WRITE (stSensor_cfg_1080P25FPS_10bit[i].addr, stSensor_cfg_1080P25FPS_10bit[i].data) < 0)
- return -1;
- }
- return 0;
- }
- // 氓藛聺氓搂鈥姑ヅ掆€揅MOS sensor
- // 猫驴鈥澝モ€号久モ偓录
- // 0 success
- // -1 failure
- int arkn141_isp_cmos_sensor_init (void)
- {
- // 氓藛聺氓搂鈥姑ヅ掆€� GC2053
- return 0;
- }
- // 氓陇聧盲陆聧CMOS sensor
- // 猫驴鈥澝モ€号久モ偓录
- // 0 success
- // -1 failure
- int arkn141_isp_cmos_sensor_reset (void)
- {
- // 氓陇聧盲陆聧 GC2053
- return 0;
- }
- // 猫炉禄氓聫鈥搒ensor莽拧鈥灻ヂ�€灻ヂ�溍モ劉篓氓鈥犫€γヂ��
- // 猫炉禄氓鈥÷好�♀€灻︹€⒙懊モ偓录盲驴聺氓颅藴氓艙篓data忙艗鈥∶┾€櫵喢ε掆€∶ヂ愨€樏�♀€灻ヅ撀懊ヂ濃偓.
- // 猫鈥孤ッ︹€⒙懊モ偓录盲赂聧氓陇鸥32盲陆聧, 氓掳鈥犆┞�溍ぢ铰嵜р€澛�0氓隆芦氓鈥︹€�
- // 猫驴鈥澝モ€号久モ偓录
- // 0 success
- // -1 failure
- int arkn141_isp_cmos_sensor_read_register (u32_t addr, u32_t *data)
- {
- u8 val = i2c_smbus_read_byte_data(i2c_client, addr);
- *data = val;
- return 0;
- }
- // 氓鈥犫劉氓鈥βッ︹€⒙懊β嵚�モ€犫€γヂ�姑ニ喡皊ensor莽拧鈥灻ヂ�€灻ヂ�溍モ劉篓
- // 猫驴鈥澝モ€号久モ偓录
- // 0 success
- // -1 failure
- int arkn141_isp_cmos_sensor_write_register (u32_t addr, u32_t data)
- {
- return i2c_smbus_write_byte_data(i2c_client, addr, data);
- }
- #define EXPOSURE_LINES_ADDR (0x3012) // Integration time adjustment (I2C) Designated in line units
- #define AGAIN_ADDR (0x3060) // analog_gain
- #define DGAIN_ADDR (0x305E) // global_gain
- #define STD_30_LINES (1125)
- #define CMOS_STD_INTTIME (STD_30_LINES-2)
- static cmos_inttime_t cmos_inttime;
- static cmos_gain_t cmos_gain;
- static u16_t FRM_LENGTH = STD_30_LINES;
- static u32_t regValTable[29][4] = { {0x00, 0x00,0x01,0x00},//0xb4 0xb3 0xb8 0xb9
- {0x00, 0x10,0x01,0x0c},
- {0x00, 0x20,0x01,0x1b},
- {0x00, 0x30,0x01,0x2c},
- {0x00, 0x40,0x01,0x3f},
- {0x00, 0x50,0x02,0x16},
- {0x00, 0x60,0x02,0x35},
- {0x00, 0x70,0x03,0x16},
- {0x00, 0x80,0x04,0x02},
- {0x00, 0x90,0x04,0x31},
- {0x00, 0xa0,0x05,0x32},
- {0x00, 0xb0,0x06,0x35},
- {0x00, 0xc0,0x08,0x04},
- {0x00, 0x5a,0x09,0x19},
- {0x00, 0x83,0x0b,0x0f},
- {0x00, 0x93,0x0d,0x12},
- {0x00, 0x84,0x10,0x00},
- {0x00, 0x94,0x12,0x3a},
- {0x01, 0x2c,0x1a,0x02},
- {0x01, 0x3c,0x1b,0x20},
- {0x00, 0x8c,0x20,0x0f},
- {0x00, 0x9c,0x26,0x07},
- {0x02, 0x64,0x36,0x21},
- {0x02, 0x74,0x37,0x3a},
- {0x00, 0xc6,0x3d,0x02},
- {0x00, 0xdc,0x3f,0x3f},
- {0x02, 0x85,0x3f,0x3f},
- {0x02, 0x95,0x3f,0x3f},
- {0x00, 0xce,0x3f,0x3f},
- };
- static u32_t analog_gain_table[29] =
- {
- /* zephyr@2017-04-18 */
- 1024,
- 1184,
- 1424,
- 1632,
- 2032,
- 2352,
- 2832,
- 3248,
- 4160,
- 4800,
- 5776,
- 6640,
- 8064,
- 9296,
- 11552,
- 13312,
- 16432,
- 18912,
- 22528,
- 25936,
- 31840,
- 36656,
- 45600,
- 52512,
- 64768,
- 82880,
- 88000,
- 107904,
- 113168,
- };
- static u32_t digital_gain_table[] =
- {
- 64, 65, 66, 67, 68, 69, 70, 71,
- 72, 73, 74, 75, 76, 77, 78, 79,
- 80, 81, 82, 83, 84, 85, 86, 87,
- 88, 89, 90, 91, 92, 93, 94, 95,
- 96, 97, 98, 99, 100, 101, 102, 103,
- 104, 105, 106, 107, 108, 109, 110, 111,
- 112, 113, 114, 115, 116, 117, 118, 119,
- 120, 121, 122, 123, 124, 125, 126, 127
- };
- // PCLK = 74.25MHz
- // Frame Size = 2040 * 1214
- // fps = 74.25 * 1000000 / (2040 * 1214) = 29.98 帧/秒
- static cmos_inttime_ptr_t cmos_inttime_initialize(void)
- {
- cmos_inttime.full_lines = FRM_LENGTH;
- cmos_inttime.full_lines_limit = 65535;
- cmos_inttime.max_lines_target = (u16_t)(FRM_LENGTH - 2);
- cmos_inttime.min_lines_target = 2;
- cmos_inttime.exposure_ashort = 0;
- return &cmos_inttime;
- }
- // The sensor's integration time is obtained by the following formula.
- static void cmos_inttime_update (cmos_inttime_ptr_t p_inttime)
- {
- u16_t exp_time;
- exp_time = (u16_t)p_inttime->exposure_ashort;
- if(exp_time < 2)
- exp_time = 2;
- //arkn141_isp_cmos_sensor_write_register (0xfe, 0x00 ) ; // Page 0
- arkn141_isp_cmos_sensor_write_register (0x03, (u8_t)((exp_time >> 8) & 0x3F) ); // P0:0x03 Exposure [13:8]
- arkn141_isp_cmos_sensor_write_register (0x04, (u8_t)(exp_time ) ); //P0:0x04 Exposure [7:0]
- }
- // 设置CMOS sensor允许使用的最大增益
- static int gc2053_cmos_max_gain_set (cmos_gain_ptr_t gain, unsigned int max_analog_gain, unsigned int max_digital_gain);
- // The Programmable Gain Control (PGC) of this device consists of the analog block and digital block.
- static cmos_gain_ptr_t cmos_gain_initialize(void)
- {
- cmos_gain.again_shift = 10;
- #if IQ_20190522
- cmos_gain.max_again_target = 113168; // 111倍
- #else
- // 20190626 减小最大增益倍数到72倍,减轻低照度下的噪声
- cmos_gain.max_again_target = 72 * 1024; // 72倍
- #endif
- cmos_gain.again_count = sizeof(analog_gain_table)/sizeof(analog_gain_table[0]);
- cmos_gain.dgain_shift = 6;
- //cmos_gain.max_dgain_target = 127;// 2倍
- cmos_gain.max_dgain_target = 64;
- cmos_gain.dgain_count = sizeof(digital_gain_table)/sizeof(digital_gain_table[0]);
- return &cmos_gain;
- }
- // 设置CMOS sensor允许使用的最大增益
- int gc2053_cmos_max_gain_set (cmos_gain_ptr_t gain, unsigned int max_analog_gain, unsigned int max_digital_gain)
- {
- int count, index;
- if(gain == NULL)
- return -1;
- if(max_analog_gain == 0)
- {
- max_analog_gain = 1; // 禁止模拟增益
- }
- if(gain->max_again_target != 1)
- {
- // 在增益表中查找该最大增益值
- count = sizeof(analog_gain_table) / sizeof(analog_gain_table[0]);
- for (index = 0; index < count; index ++)
- {
- if(analog_gain_table[index] >= max_analog_gain)
- {
- break;
- }
- }
- if(index >= count)
- index = count - 1; // 使用最后一个增益值
- // 修改最大可用的增益值
- gain->max_again_target = analog_gain_table[index];
- gain->again_count = index + 1; // 修改可用的增益项数量
- }
- if(max_digital_gain == 0)
- {
- max_digital_gain = 1; // 禁止数字增益
- }
- if(gain->max_dgain_target != 1)
- {
- // 在增益表中查找该最大增益值
- count = sizeof(digital_gain_table) / sizeof(digital_gain_table[0]);
- for (index = 0; index < count; index ++)
- {
- if(digital_gain_table[index] >= max_digital_gain)
- {
- break;
- }
- }
- if(index >= count)
- index = count - 1; // 使用最后一个增益值
- // 修改最大可用的增益值
- gain->max_dgain_target = digital_gain_table[index];
- gain->dgain_count = index + 1; // 修改可用的增益项数量
- }
- return 0;
- }
- // 设置CMOS sensor允许使用的最大增益
- int gc2053_cmos_max_gain_get (cmos_gain_ptr_t gain, unsigned int* max_analog_gain, unsigned int* max_digital_gain)
- {
- if(gain == NULL)
- return -1;
- *max_analog_gain = gain->max_again_target;
- *max_digital_gain = gain->max_dgain_target;
- return 0;
- }
- static void cmos_gain_update (cmos_gain_ptr_t gain)
- {
- u8_t u8DgainHigh, u8DgainLow;
- u32_t dgain = digital_gain_table[gain->dindex];
- u8DgainHigh = (dgain >> 6) & 0x0f;
- u8DgainLow = (dgain & 0x3f) << 2;
- arkn141_isp_cmos_sensor_write_register (0xb1, u8DgainHigh);
- arkn141_isp_cmos_sensor_write_register (0xb2, u8DgainLow);
- // analog gain
- arkn141_isp_cmos_sensor_write_register (0xb4, regValTable[gain->aindex][0]);
- arkn141_isp_cmos_sensor_write_register (0xb3, regValTable[gain->aindex][1]);
- arkn141_isp_cmos_sensor_write_register (0xb8, regValTable[gain->aindex][2]);
- arkn141_isp_cmos_sensor_write_register (0xb9, regValTable[gain->aindex][3]);
- }
- // 根据曝光量计算模拟增益
- static u32_t analog_gain_from_exposure_calculate (cmos_gain_ptr_t gain, u32_t exposure, u32_t exposure_max)
- {
- // 二分法查找最接近的模拟增益
- // 计算精度非常重要,会导致曝光的抖动
- int l, h, m, match;
- i64_t exp;
- i64_t mid;
- u32_t again = 1 << gain->again_shift;
- match = 0;
- if(exposure <= exposure_max)
- {
- gain->again = analog_gain_table[0];
- gain->aindex = 0;
- return exposure;
- }
- if(gain->again_count == 0)
- {
- gain->again = analog_gain_table[0];
- gain->aindex = 0;
- return exposure;
- }
- l = 0;
- h = gain->again_count - 1;
- if(h < 0)
- h = 0;
- //h = sizeof(analog_gain_table)/sizeof(analog_gain_table[0]) - 1;
- //exp = (i64_t)(1 << gain->again_shift);
- //exp = exp * (i64_t)exposure;
- exp = exposure;
- while(l <= h)
- {
- m = (l + h) >> 1;
- mid = analog_gain_table[m];
- mid = mid * (i64_t)exposure_max;
- mid = div_s64(mid, again);
- // 寻找满足 mid <= exp的最大m
- if(mid < exp)
- {
- if(m > match)
- match = m;
- // 需增大模拟增益
- l = m + 1;
- }
- else if(mid > exp)
- {
- // 需减小模拟增益
- h = m - 1;
- }
- else
- {
- // mid == exp
- match = m;
- break;
- }
- }
- m = match;
- gain->again = analog_gain_table[m];
- gain->aindex = (u16_t)m;
- //return (u32_t)(exp / analog_gain_table[m]);
- exp = exp * (i64_t)again;
- exp = div_s64(exp, analog_gain_table[m]);
- return (u32_t)exp;
- }
- // 根据曝光量计算数字增益
- // 数字增益
- static u32_t digital_gain_from_exposure_calculate (cmos_gain_ptr_t gain, u32_t exposure, u32_t exposure_max)
- {
- int l, h, m, match;
- i64_t exp;
- i64_t mid;
- u32_t dgain = 1 << gain->dgain_shift;
- match = 0;
- if(exposure <= exposure_max)
- {
- gain->dgain = digital_gain_table[0];
- gain->dindex = 0;
- return exposure;
- }
- if(gain->dgain_count == 0)
- {
- gain->dgain = digital_gain_table[0];
- gain->dindex = 0;
- return exposure;
- }
- l = 0;
- h = gain->dgain_count - 1;
- if(h < 0)
- h = 0;
- exp = exposure;
- while(l <= h)
- {
- m = (l + h) >> 1;
- mid = digital_gain_table[m];
- mid = mid * (i64_t)exposure_max;
- mid = div_s64(mid, dgain);
- // 寻找满足 mid <= exp的最大m
- if(mid < exp)
- {
- if(m > match)
- match = m;
- // 需增大模拟增益
- l = m + 1;
- }
- else if(mid > exp)
- {
- // 需减小模拟增益
- h = m - 1;
- }
- else
- {
- // mid == exp
- match = m;
- break;
- }
- }
- m = match;
- gain->dgain = digital_gain_table[m];
- gain->dindex = (u16_t)m;
- //return (u32_t)(exp / analog_gain_table[m]);
- exp = exp * (i64_t)dgain;
- exp = div_s64(exp, digital_gain_table[m]);
- return (u32_t)exp;
- }
- static u32_t last_exp_time, last_again, last_dgain;
- static void cmos_inttime_gain_reset (void)
- {
- last_exp_time = 0xFFFFFFFF;
- last_again = 0xFFFFFFFF;
- last_dgain = 0xFFFFFFFF;
- }
- // 返回值表示延迟指定的时间以便等待sensor曝光参数产生作用
- // 1 表示下一帧sensor曝光参数产生影响
- // 2 表示延迟1帧sensor曝光参数产生影响
- // 3 表示延迟2帧sensor曝光参数产生影响
- static int cmos_inttime_gain_update (cmos_inttime_ptr_t p_inttime, cmos_gain_ptr_t gain)
- {
- u16_t exp_time;
- if(p_inttime)
- {
- exp_time = (u16_t)p_inttime->exposure_ashort;
- if(exp_time < 2)
- exp_time = 2;
- //arkn141_isp_cmos_sensor_write_register (0xfe, 0x00 ) ; // Page 0
- arkn141_isp_cmos_sensor_write_register (0x03, (u8_t)((exp_time >> 8) & 0x3F) ); // P0:0x03 Exposure [13:8]
- arkn141_isp_cmos_sensor_write_register (0x04, (u8_t)(exp_time ) ); //P0:0x04 Exposure [7:0]
- }
- if(gain)
- {
- cmos_gain_update (gain);
- }
- // 返回值表示延迟指定的时间以便等待sensor曝光参数产生作用
- // 1 表示下一帧sensor曝光参数产生影响
- // 2 表示延迟1帧sensor曝光参数产生影响
- // 3 表示延迟2帧sensor曝光参数产生影响
- return 2;
- }
- static void cmos_inttime_gain_update_manual (cmos_inttime_ptr_t p_inttime, cmos_gain_ptr_t gain)
- {
- u16_t exp_time;
- u16_t shutter_sweep_line_count;
- int i, aindex, dindex;
- // 猫庐隆莽庐鈥攁index, dindex
- for (i = 0; i < gain->again_count; i++)
- {
- if(analog_gain_table[i] >= gain->again)
- break;
- }
- if(i == gain->again_count)
- i = gain->again_count - 1;
- aindex = i;
- gain->aindex = aindex;
- gain->again_lookup = i;
- for (i = 0; i < gain->dgain_count; i++)
- {
- if(digital_gain_table[i] >= gain->dgain)
- break;
- }
- if(i == gain->dgain_count)
- i = gain->dgain_count - 1;
- dindex = i;
- gain->dindex = dindex;
- if(p_inttime->exposure_ashort >= (FRM_LENGTH - 2))
- p_inttime->exposure_ashort = (FRM_LENGTH - 2);
- cmos_inttime_gain_update (p_inttime, gain);
- }
- static u32_t cmos_get_iso (cmos_gain_ptr_t gain)
- {
- i64_t iso = gain->again * gain->dgain;
- iso = (iso * 100) >> (gain->again_shift + gain->dgain_shift);
- gain->iso = (u32_t)iso;
- return gain->iso;
- }
- static void cmos_fps_set (cmos_inttime_ptr_t p_inttime, u8_t fps)
- {
- switch (fps)
- {
- case 30:
- default:
- p_inttime->full_lines = FRM_LENGTH; //STD_30_LINES;
- p_inttime->lines_per_500ms = FRM_LENGTH * 30 / 2; //STD_30_LINES * 30 / 2;
- break;
- }
- }
- // 设置sensor readout drection
- // horz_reverse_direction --> 1 horz reverse direction 垂直反向
- // --> 0 horz normal direction
- // vert_reverse_direction --> 1 vert reverse direction 水平反向
- // --> 0 vert normal direction
- static int cmos_sensor_set_readout_direction (u8_t horz_reverse_direction, u8_t vert_reverse_direction)
- {
- return 0;
- }
- static const char *gc2053_cmos_sensor_get_sensor_name (void)
- {
- return "GC2053";
- }
- extern void isp_sensor_set_reset_pin_low (void);
- extern void isp_sensor_set_reset_pin_high (void);
- extern int gc2053_init_25fps_10bit (void);
- extern int gc2053_init_30fps_10bit (void);
- static int gc2053_isp_sensor_init(isp_sen_ptr_t p_sen)
- {
- int ret = 0;
- int loop = 10;
- int video_format = ARKN141_VIDEO_FORMAT_1080P_30;
- if( video_format == ARKN141_VIDEO_FORMAT_1080P_30
- )
- {
- }
- else
- {
- // un-support video format
- XM_printf ("un-support video format (%d)\n", video_format );
- return -1;
- }
- while(loop > 0)
- {
- // tLOW >= 500ns
- isp_sensor_set_reset_pin_low ();
- mdelay (5);
- isp_sensor_set_reset_pin_high ();
- mdelay (2);
- cmos_inttime_gain_reset ();
- if (isp_sensor_fps == 30)
- ret = gc2053_init_30fps_10bit ();
- else
- ret = gc2053_init_25fps_10bit ();
- if(ret == 0)
- {
- //cmos_sensor_set_readout_direction (1, 1);
- }
- if(ret == 0)
- break;
- loop --;
- }
- if(loop == 0)
- {
- ret = -1;
- XM_printf ("gc2053 init video format(%d) NG\n", video_format);
- }
- else
- {
- ret = 0;
- XM_printf ("gc2053 init video format(%d) OK\n", video_format);
- }
- return ret;
- }
- static void gc2053_cmos_isp_awb_init (isp_awb_ptr_t p_awb) // 白平衡初始参数
- {
- //p_awb->enable = 0;
- p_awb->enable = 1;
- p_awb->mode = 1; //0:无效; 1:算法1,统一估计; 2:算法2,基于参考光源
- p_awb->manual = 0;//0=自动白平衡 1=手动白平衡
- p_awb->weight[0][0] = 1;
- p_awb->weight[0][1] = 2;
- p_awb->weight[0][2] = 1;
- p_awb->weight[1][0] = 2;
- p_awb->weight[1][1] = 4;
- p_awb->weight[1][2] = 2;
- p_awb->weight[2][0] = 1;
- p_awb->weight[2][1] = 2;
- p_awb->weight[2][2] = 1;
- //p_awb->black = 4;
- p_awb->black = 16;
- p_awb->white = 210;
- p_awb->jitter = 13;
- p_awb->r2g_min = 256/4;
- p_awb->r2g_max = 256*4;
- p_awb->b2g_min = 256/4;
- p_awb->b2g_max = 256*4;
- // G/R, G/B,
- #if 0
- p_awb->r2g_light[0] = 182; // DAY
- p_awb->b2g_light[0] = 203;
- p_awb->r2g_light[1] = 194; // CWF
- p_awb->b2g_light[1] = 158;
- p_awb->r2g_light[2] = 222; // A
- p_awb->b2g_light[2] = 131;
- p_awb->r2g_light[3] = 246; // TL84
- p_awb->b2g_light[3] = 154;
- #else
- p_awb->r2g_light[0] = 120; // 自然光 //old:117
- p_awb->b2g_light[0] = 153; //old:158
- p_awb->r2g_light[1] = 127; // DAY //old:124
- p_awb->b2g_light[1] = 161; //old:162
- p_awb->r2g_light[2] = 155; // CWF //old:151
- p_awb->b2g_light[2] = 96; //old:98
- p_awb->r2g_light[3] = 208; // A //old:206
- p_awb->b2g_light[3] = 83; //old:82
- p_awb->r2g_light[4] = 241; // TL84 //old:232
- p_awb->b2g_light[4] = 83; //old:83
- #endif
- p_awb->r2g_light[5] = 0;
- p_awb->b2g_light[5] = 0;
- p_awb->r2g_light[6] = 0;
- p_awb->b2g_light[6] = 0;
- p_awb->r2g_light[7] = 0;
- p_awb->b2g_light[7] = 0;
- p_awb->use_light[0] = 1;
- p_awb->use_light[1] = 1;
- p_awb->use_light[2] = 1;
- p_awb->use_light[3] = 1;
- p_awb->use_light[4] = 1;
- p_awb->use_light[5] = 0;
- p_awb->use_light[6] = 0;
- p_awb->use_light[7] = 0;
- p_awb->gain_g2r = 426;//434;
- p_awb->gain_g2b = 280;//348;
- isp_awb_init_io (p_awb);
- }
- static isp_gamma_polyline_tbl gamma_polyline_tbl[] = {
- // 提升场景的对比度
- { 128,
- {
- 0, 140, 336, 588, 896, 1260, 1680, 2156,
- 2688, 3276, 3920, 4620, 5376, 6188, 7056, 7980,
- 8960, 9996, 11088, 12236, 13440, 14700, 16016, 17388,
- 18816, 20300, 21840, 23436, 25088, 26796, 28560, 30380,
- 32256, 34644, 36464, 38228, 39936, 41588, 43184, 44724,
- 46208, 47636, 49008, 50324, 51584, 52788, 53936, 55028,
- 56064, 57044, 57968, 58836, 59648, 60404, 61104, 61748,
- 62336, 62868, 63344, 63764, 64128, 64436, 64688, 64884,
- 65024
- }
- },
- };
- static const isp_gamma_polyline_tbl *gc2053_cmos_isp_get_gamma_table (int *tbl_count)
- {
- *tbl_count = sizeof(gamma_polyline_tbl)/sizeof(gamma_polyline_tbl[0]);
- return gamma_polyline_tbl;
- }
- static void gc2053_cmos_isp_colors_init (isp_colors_ptr_t p_colors) // 色彩初始参数
- {
- int i, j;
- p_colors->colorm.enable = 0;// 色矩阵
- p_colors->colorm.matrixcoeff[0][0] = 256;
- p_colors->colorm.matrixcoeff[0][1] = 0;
- p_colors->colorm.matrixcoeff[0][2] = 0;
- p_colors->colorm.matrixcoeff[1][0] = 0;
- p_colors->colorm.matrixcoeff[1][1] = 256;
- p_colors->colorm.matrixcoeff[1][2] = 0;
- p_colors->colorm.matrixcoeff[2][0] = 0;
- p_colors->colorm.matrixcoeff[2][1] = 0;
- p_colors->colorm.matrixcoeff[2][2] = 256;
- p_colors->gamma.enable = 1;
- for (i = 0; i < 65; i++)
- {
- p_colors->gamma.gamma_lut[i] = gamma_polyline_tbl[0].gamma_lut[i];
- }
- // 使用0~255范围, 尽量保留所有的细节
- p_colors->rgb2ypbpr_type = HDTV_type_0255;
- isp_create_rgb2ycbcr_matrix (p_colors->rgb2ypbpr_type, &p_colors->rgb2yuv);
- // demosaic 参数
- p_colors->demosaic.mode = 0;
- p_colors->demosaic.coff_00_07 = 32;
- p_colors->demosaic.coff_20_27 = 255; // 滤波
- p_colors->demosaic.horz_thread = 0;
- //p_colors->demosaic.demk = 128;
- p_colors->demosaic.demk = 512; // 20161230 改善解析度(树叶,纹理)
- p_colors->demosaic.demDhv_ofst = 0;
- isp_colors_init_io(p_colors);
- }
- static const unsigned char noise0_0[17] = {
- 255, 255, 255, 255,
- 255, 248, 240, 212,
- 212, 212, 212, 212,
- 212, 212, 212, 212,
- 212
- };
- static const unsigned char noise1_0[17] = {
- 255, 255, 255, 255,
- 255, 248, 240, 212,
- 192, 160, 144, 128,
- 128, 128, 128, 128,
- 128
- };
- static void gc2053_cmos_isp_denoise_init (isp_denoise_ptr_t p_denoise)// 降噪初始设置
- {
- int i, x0, y0, x1, y1, x2, y2, x3, y3;
- int a, b, c, d, e, f, delta;
- p_denoise->enable2d = 7;
- if(isp_get_work_mode() == ISP_WORK_MODE_NORMAL)
- {
- #if ISP_3D_DENOISE_SUPPORT
- p_denoise->enable3d = 7;
- #else
- p_denoise->enable3d = 0;
- #endif
- }
- else
- {
- p_denoise->enable3d = 0;
- }
- //p_denoise->sensitiv0 = 4;
- //p_denoise->sensitiv1 = 4;
- p_denoise->sensitiv0 = 3; // 降低降噪强度, 提升清晰度
- p_denoise->sensitiv1 = 3;
- p_denoise->sel_3d_table = 3; // 3的降噪效果较好
- p_denoise->sel_3d_matrix = 1;
- p_denoise->y_thres0 = 6;
- p_denoise->u_thres0 = 10;
- p_denoise->v_thres0 = 10;
- p_denoise->y_thres1 = 6;
- p_denoise->u_thres1 = 10;
- p_denoise->v_thres1 = 10;
- p_denoise->y_thres2 = 6;
- p_denoise->u_thres2 = 11;
- p_denoise->v_thres2 = 11;
- for (i = 0; i <= 16; i ++)
- {
- p_denoise->noise0[i] = noise0_0[i];
- }
- for (i = 0; i <= 16; i ++)
- {
- p_denoise->noise1[i] = noise1_0[i];
- }
- isp_denoise_init_io (p_denoise);
- }
- // 20170227 增加场景的解析度拉伸, 增加通透度, 增加低照度场景的解析度
- static const unsigned char gc2053_default_resolt[33] = {
- 200, 210, 215, 220, 225, 227,
- 230, 230, 233, 235, 235, 235,
- 235, 235, 235, 235, 235, 235,
- 235, 235, 235, 235, 235, 235,
- 235, 235, 235, 235, 235, 230,
- 225, 220, 220,
- };
- #define ERIS_COLORT_1 1
- #if ERIS_COLORT_1
- static const unsigned int gc2053_default_colort_old[33] = {
- 64, 128, 192, 256, 320, 384, 511, 511,
- 511, 511, 511, 511, 511, 511, 511, 511,
- 511, 511, 511, 511, 511, 511, 511, 511,
- 511, 511, 511, 511, 448, 384, 256, 192,
- 128
- };
- static const unsigned int gc2053_default_colort[33] = {
- 64, 128, 192, 256, 272, 320, 384, 384,
- 384, 384, 384, 384, 384, 384, 384, 384,
- 384, 384, 384, 384, 384, 384, 384, 384,
- 384, 384, 384, 384, 320, 272, 256, 192,
- 128
- };
- #else
- /*
- static unsigned int gc2053_default_colort[33] = {
- 1, 1, 1, 1, 1, 1, 1, 1,
- 16, 24, 32, 40, 64, 80, 96, 112,
- 128, 160, 212, 256, 256, 256, 256, 256,
- 256, 256, 256, 256, 256, 256, 256, 256,
- 128
- };*/
- static const unsigned int gc2053_default_colort_1[33] = {
- 32, 38, 44, 50, 56, 62,
- 68, 74, 80, 86, 92, 98,
- 104, 110, 116, 122, 128, 152,
- 176, 200, 224, 248, 272, 296,
- 320, 343, 367, 391, 415, 439,
- 463, 487, 511,
- };
- static const unsigned int gc2053_default_colort[33] = {
- 8, 8, 8, 8, 8, 8,
- 16, 16, 16, 16, 16, 16,
- 32, 32, 32, 32, 32, 48,
- 48, 48, 48, 64, 64, 96,
- 96, 64, 64, 48, 48, 48,
- 32, 32, 32,
- };
- #endif
- static void gc2053_cmos_isp_eris_init(isp_eris_ptr_t p_eris) // 宽动态初始设置
- {
- int i, j, x0, y0, x1, y1, x2, y2;
- int a, b, c, d;
- p_eris->enable = 1;
- #if ERIS_MANUAL
- p_eris->manual = 1;
- #else
- p_eris->manual = 0;
- #endif
- p_eris->target = 128;
- p_eris->black = 12;
- // 10bit使用D2~D11, D0~D1固定为0
- //if(isp_get_sensor_bit() == ARKN141_ISP_SENSOR_BIT_12)
- // p_eris->white = 4095; // 尽可能保留动态范围
- //else
- p_eris->white = 1023; // 尽可能保留动态范围
- p_eris->gain_max = 256; //256;
- //p_eris->gain_max = 128; //256;
- //p_eris->gain_min = 64; //256;
- p_eris->gain_min = 16;
- //p_eris->gain_man = 256;
- p_eris->gain_man = 360;
- p_eris->cont_max = 256; // 2*64;
- p_eris->cont_min = 64; // 6*64;
- p_eris->cont_man = 16;
- p_eris->dfsEris = 1;
- p_eris->varEris = 0;
- p_eris->resols = 0;
- p_eris->resoli = 0;
- p_eris->spacev = 0;
- for (i = 0; i < 33; i++)
- {
- p_eris->resolt[i] = gc2053_default_resolt[i];
- }
- for (i = 0; i < 33; i++)
- {
- // p_eris->colort[i] = 512;
- p_eris->colort[i] = gc2053_default_colort[i];
- }
- // ERIS直方图初始设置
- // u8_t hist_thresh[4] = {0x10, 0x40, 0x80, 0xc0};
- p_eris->eris_hist_thresh[0] = 0x10;
- p_eris->eris_hist_thresh[1] = 0x40;
- p_eris->eris_hist_thresh[2] = 0x80;
- p_eris->eris_hist_thresh[3] = 0xC0;
- isp_eris_init_io(p_eris);
- }
- #if 1
- const unsigned short lenscoeff[]=
- {
- // r
- 4096,4315,4322,4317,4331, 4339,4355,4361,4406,4443,
- 4467,4466,4485,4519,4552, 4591,4648,4702,4771,4847,
- 4923,5001,5125,5242,5373, 5518,5694,5885,6047,6230,
- 6416,6597,6821,7055,7305, 7481,7799,7799,7799,7799,
- 7799,7799,7799,7799,7799, 7799,7799,7799,7799,7799,
- 7799,7799,7799,7799,7799, 7799,7799,7799,7799,7799,
- 7799,7799,7799,7799,7799,
- // g
- 4096,4315,4322,4317,4331, 4339,4355,4361,4406,4443,
- 4467,4466,4485,4519,4552, 4591,4648,4702,4771,4847,
- 4923,5001,5125,5242,5373, 5518,5694,5885,6047,6230,
- 6416,6597,6821,7055,7305, 7481,7799,7799,7799,7799,
- 7799,7799,7799,7799,7799, 7799,7799,7799,7799,7799,
- 7799,7799,7799,7799,7799, 7799,7799,7799,7799,7799,
- 7799,7799,7799,7799,7799,
- // b
- 4096,4315,4322,4317,4331, 4339,4355,4361,4406,4443,
- 4467,4466,4485,4519,4552, 4591,4648,4702,4771,4847,
- 4923,5001,5125,5242,5373, 5518,5694,5885,6047,6230,
- 6416,6597,6821,7055,7305, 7481,7799,7799,7799,7799,
- 7799,7799,7799,7799,7799, 7799,7799,7799,7799,7799,
- 7799,7799,7799,7799,7799, 7799,7799,7799,7799,7799,
- 7799,7799,7799,7799,7799,
- };
- #else
- const unsigned short lenscoeff[]=
- {
- // r
- 4096,4320,4335,4340,4351, 4368,4406,4442,4459,4467,
- 4480,4510,4555,4594,4642, 4692,4750,4812,4883,4954,
- 5109,5281,5463,5681,5900, 6172,6449,6789,7057,7387,
- 7728,8106,8602,9000,9362, 9471,9826,10479,10479,10479,
- 10479,10479,10479,10479,10479,10479,10479,10479,10479,10479,
- 10479,10479,10479,10479,10479,10479,10479,10479,10479,10479,
- 10479,10479,10479,10479,10479,
- // g
- 4096,4320,4335,4340,4351, 4368,4406,4442,4459,4467,
- 4480,4510,4555,4594,4642, 4692,4750,4812,4883,4954,
- 5109,5281,5463,5681,5900, 6172,6449,6789,7057,7387,
- 7728,8106,8602,9000,9362, 9471,9826,10479,10479,10479,
- 10479,10479,10479,10479,10479,10479,10479,10479,10479,10479,
- 10479,10479,10479,10479,10479,10479,10479,10479,10479,10479,
- 10479,10479,10479,10479,10479,
- // b
- 4096,4320,4335,4340,4351, 4368,4406,4442,4459,4467,
- 4480,4510,4555,4594,4642, 4692,4750,4812,4883,4954,
- 5109,5281,5463,5681,5900, 6172,6449,6789,7057,7387,
- 7728,8106,8602,9000,9362, 9471,9826,10479,10479,10479,
- 10479,10479,10479,10479,10479,10479,10479,10479,10479,10479,
- 10479,10479,10479,10479,10479,10479,10479,10479,10479,10479,
- 10479,10479,10479,10479,10479,
- };
- #endif
- #define Ycenter_x 960
- #define Ycenter_y 540
- #define CenterRx Ycenter_x
- #define CenterRy Ycenter_y
- #define CenterGx Ycenter_x
- #define CenterGy Ycenter_y
- #define CenterBx Ycenter_x
- #define CenterBy Ycenter_y
- static void gc2053_cmos_isp_fesp_init(isp_fesp_ptr_t p_fesp) // 镜头校正, fix-pattern-correction, 坏点去除初始设置
- {
- int i, j, k;
- int x0, y0, x1, y1, x2, y2, x3, y3;
- int a, b, c, d, e, f, delta;
- // unsigned short R_lenslut[65];
- // unsigned short G_lenslut[65];
- // unsigned short B_lenslut[65];
- // unsigned short Y_lenslut[65];
- p_fesp->Lensshade.enable = 0;
- p_fesp->Lensshade.scale = 1;
- p_fesp->Lensshade.lscofst = 50;
- p_fesp->Lensshade.rcenterRx = CenterRx;
- p_fesp->Lensshade.rcenterRy = CenterRy;
- p_fesp->Lensshade.rcenterGx = CenterRx;
- p_fesp->Lensshade.rcenterGy = CenterRy;
- p_fesp->Lensshade.rcenterBx = CenterRx;
- p_fesp->Lensshade.rcenterBy = CenterRy;
- for( i=0 ; i < 195 ;i++ )
- {
- p_fesp->Lensshade.coef[i] = lenscoeff[i];
- }
- // fix pattern correction
- p_fesp->Fixpatt.enable = 1;
- p_fesp->Fixpatt.mode = 0;
- p_fesp->Fixpatt.rBlacklevel = 0x40;
- p_fesp->Fixpatt.grBlacklevel = 0x40;
- p_fesp->Fixpatt.gbBlacklevel = 0x40;
- p_fesp->Fixpatt.bBlacklevel = 0x40;
- p_fesp->Fixpatt.profile[0] = 255;
- p_fesp->Fixpatt.profile[1] = 255;
- p_fesp->Fixpatt.profile[2] = 255;
- p_fesp->Fixpatt.profile[3] = 255;
- p_fesp->Fixpatt.profile[4] = 255;
- p_fesp->Fixpatt.profile[5] = 255;
- p_fesp->Fixpatt.profile[6] = 255;
- p_fesp->Fixpatt.profile[7] = 255;
- p_fesp->Fixpatt.profile[8] = 255;
- p_fesp->Fixpatt.profile[9] = 255;
- p_fesp->Fixpatt.profile[10] = 255;
- p_fesp->Fixpatt.profile[11] = 255;
- p_fesp->Fixpatt.profile[12] = 255;
- p_fesp->Fixpatt.profile[13] = 255;
- p_fesp->Fixpatt.profile[14] = 255;
- p_fesp->Fixpatt.profile[15] = 255;
- p_fesp->Fixpatt.profile[16] = 255;
- // bad pixel correction
- p_fesp->Badpix.enable = 1;
- p_fesp->Badpix.mode = 0;
- p_fesp->Badpix.thresh = 19; // IMX322 实测最低坏点判断阈值
- p_fesp->Badpix.profile[0] = 255;
- p_fesp->Badpix.profile[1] = 255;
- p_fesp->Badpix.profile[2] = 255;
- p_fesp->Badpix.profile[3] = 255;
- p_fesp->Badpix.profile[4] = 255;
- p_fesp->Badpix.profile[5] = 255;
- p_fesp->Badpix.profile[6] = 255;
- p_fesp->Badpix.profile[7] = 255;
- p_fesp->Badpix.profile[8] = 255;
- p_fesp->Badpix.profile[9] = 255;
- p_fesp->Badpix.profile[10] = 255;
- p_fesp->Badpix.profile[11] = 255;
- p_fesp->Badpix.profile[12] = 255;
- p_fesp->Badpix.profile[13] = 255;
- p_fesp->Badpix.profile[14] = 255;
- p_fesp->Badpix.profile[15] = 255;
- // cross talk correction
- // cross talk的阈值越大, 图像越模糊. 8是一个较合适的值.
- // 使用3D降噪来去除噪声
- p_fesp->Crosstalk.enable = 1;
- p_fesp->Crosstalk.mode = 1;
- p_fesp->Crosstalk.thresh = 10;
- p_fesp->Crosstalk.snsCgf = 3; // 值越大, 滤除奇异点的能力越大.
- p_fesp->Crosstalk.thres0cgf = 10;
- p_fesp->Crosstalk.thres1cgf = 10;
- p_fesp->Crosstalk.profile[0] = 255;
- p_fesp->Crosstalk.profile[1] = 255;
- p_fesp->Crosstalk.profile[2] = 255;
- p_fesp->Crosstalk.profile[3] = 243;
- p_fesp->Crosstalk.profile[4] = 243;
- p_fesp->Crosstalk.profile[5] = 243;
- p_fesp->Crosstalk.profile[6] = 243;
- p_fesp->Crosstalk.profile[7] = 243;
- p_fesp->Crosstalk.profile[8] = 232;
- p_fesp->Crosstalk.profile[9] = 232;
- p_fesp->Crosstalk.profile[10] = 232;
- p_fesp->Crosstalk.profile[11] = 232;
- p_fesp->Crosstalk.profile[12] = 232;
- p_fesp->Crosstalk.profile[13] = 212;
- p_fesp->Crosstalk.profile[14] = 212;
- p_fesp->Crosstalk.profile[15] = 212;
- p_fesp->Crosstalk.profile[16] = 212;
- isp_fesp_init_io (p_fesp);
- }
- #define SATUATION_OFFSET 64 // 饱和度补偿
- static void gc2053_cmos_isp_enhance_init (isp_enhance_ptr_t p_enhance) // 图像增强初始设置
- {
- p_enhance->sharp.enable = 1;
- p_enhance->sharp.mode = 0;
- p_enhance->sharp.coring = 0;// 0-7
- //p_enhance->sharp.strength = 64;//64;//32;//128;
- //p_enhance->sharp.strength = 32;
- p_enhance->sharp.strength = 255;
- //p_enhance->sharp.strength = 196;
- //p_enhance->sharp.gainmax = 256;
- //p_enhance->sharp.gainmax = 128; // 20170223 盲驴庐忙鈥澛姑ぢ嘎好�铰幻ヂ韭��♀€灻┾€澛惷ヅ掆€�
- //p_enhance->sharp.gainmax = 144; // 20170305 氓戮庐猫掳茠, 氓垄啪氓艩聽盲赂鈧�р€毬�,
- //p_enhance->sharp.gainmax = 160; // 20170803莽鈩⒙矫ヂぢ┟�仿�β碘€姑�♀€灻�р€犆┞⑩€樏�铰γр€芭捗�♀€灻��€犆ニ喡�β�€澝���ぢ糕偓莽沤掳氓艙潞0330莽篓聧氓路庐, 氓垄啪氓艩聽茅鈥澛惷ヅ掆€撁�ㄢ€姑ヂ郝γ︹€澛姑モ€撯€灻��€犆ニ喡�ヂ郝�
- p_enhance->sharp.gainmax = 255; // 20170805忙聽鹿忙聧庐20170804猫路炉忙碌鈥姑�烩€溍ε九�,猫陆娄莽鈥芭捗�韭���€犆ヂ郝γ�酒�0330莽篓聧氓路庐,
- // 茅鈧�∶�库€∶ニ嗏€犆ε韭惷�р€犆┞⑩€�, 莽卢卢盲赂鈧��铰懊ヅ撀�(0330)莽拧鈥灻┾€澛惷ヅ掆€撁ヂ郝γ�酒捗┞��, 忙聫聬氓聧鈥∶┾€澛惷ヅ掆€撁ヂ⑴久р€号犆ㄢ€÷�256
- p_enhance->bcst.enable = 1;
- //p_enhance->bcst.bright = -24; // -256~255
- p_enhance->bcst.bright = 0; // -256~255
- p_enhance->bcst.contrast = 1024;//1024; // 0~1.xxx
- p_enhance->bcst.satuation = 1024 + SATUATION_OFFSET; //0~1.xxx
- // p_enhance->bcst.hue = 0; // -128~127
- p_enhance->bcst.hue = 0;
- p_enhance->bcst.offset0 = 0; // 0~255
- p_enhance->bcst.offset1 = 128; // 0~255
- //p_enhance->bcst.offset1 = 116; // 0~255
- isp_enhance_init_io (p_enhance);
- }
- static void gc2053_cmos_isp_ae_init (isp_ae_ptr_t p_ae) // 自动曝光初始设置
- {
- p_ae->histoBand[0] = 0x10;
- p_ae->histoBand[1] = 0x40;
- p_ae->histoBand[2] = 0x80;
- p_ae->histoBand[3] = 0xc0;
- p_ae->winWeight[0][0] = 1;
- p_ae->winWeight[0][1] = 2;
- p_ae->winWeight[0][2] = 1;
- p_ae->winWeight[1][0] = 6;
- p_ae->winWeight[1][1] = 14;
- p_ae->winWeight[1][2] = 6;
- p_ae->winWeight[2][0] = 12;
- p_ae->winWeight[2][1] = 15;
- p_ae->winWeight[2][2] = 12;
- //p_ae->bright_target = 10;
- p_ae->bright_target = AE_BRIGHT_TARGET_DEFAULT;
- //p_ae->bright_target = 26;
- p_ae->black_target = 128;
- p_ae->compensation = AE_COMPENSATION_DEFAULT;
- }
- static void gc2053_cmos_isp_sys_init (isp_sys_ptr_t p_sys, isp_param_ptr_t p_isp) // 系统初始设置 (sensor pixel位数, bayer mode)
- {
- p_sys->ispenbale = 0;
- p_sys->ckpolar = 0;
- p_sys->vcpolar = 0;
- p_sys->hcpolar = 0;
- p_sys->vmskenable = 0; // 自动丢帧. 保留,必须设置为0
- p_sys->frameratei = 0;
- p_sys->framerateo = 0; // 保留,必须设置为0
- #if 0
- p_sys->frameratei = 30;
- p_sys->framerateo = 0; // 保留,必须设置为0
- p_sys->vifrasel0 = 0xAAAAAAAA;
- p_sys->vifrasel1 = 0;
- #else
- p_sys->frameratei = 0;
- p_sys->framerateo = 0;
- p_sys->vifrasel0 = 0;
- p_sys->vifrasel1 = 0;
- #endif
- // IN/OUT (60帧/55帧, ),
- #if 0
- p_sys->frameratei = 64;
- p_sys->framerateo = 64;
- p_sys->vifrasel0 = 0xFFFFFFFF; // 29
- // p_sys->vifrasel1 = 0x07FFEFFE; // 25
- p_sys->vifrasel1 = 0xFFFFFFFF; // 22
- #endif
- // IN/OUT (1帧/1帧)
- // p_sys->frameratei = 0;
- // p_sys->vifrasel0 = 0x00000000;
- // p_sys->vifrasel1 = 0x00000000;
- //(0.表示8位 1:表示10位 2:表示12位 3:表示14位)
- //XM_printf("sensor bit: 0:8bit 1:10bit 2:12bit 3:14bit \n");
- p_sys->sensorbit = ARKN141_ISP_SENSOR_BIT_10;
- // 0:RGGB 1:GRBG 2:BGGR 3:GBRG
- //XM_printf("bayer mode: 0:RGGB 1:GRBG 2:BGGR 3:GBRG \n");
- //p_sys->bayermode = ARKN141_ISP_RAW_IMAGE_BAYER_MODE_BGGR;
- p_sys->bayermode = ARKN141_ISP_RAW_IMAGE_BAYER_MODE_RGGB;
- p_sys->imagewidth = p_isp->image_width;
- p_sys->imageheight = p_isp->image_height;
- // imagehblank, zonestridex, zonestridey 是以ISP Core的时钟为计数基准,
- // 计算时首先按照Sensor Pixel Clock时序进行计算, 然后换算到ISP Core Clock,
- p_sys->imagehblank = 0;
- p_sys->zonestridex = 0;
- p_sys->zonestridey = 0;
- p_sys->resizebit = 2;
- //使能
- p_sys->vmanSftenable = 0;
- p_sys->vchkIntenable = 1;// 帧开始
- p_sys->pabtIntenable = 1; //点异常
- p_sys->fendIntenable = 1; // 帧完成
- p_sys->fabtIntenable = 1; // 地址异常
- p_sys->babtIntenable = 1; //总线异常
- p_sys->ffiqIntenable = 0; //快中断
- p_sys->pendIntenable = 1; //中止 ,如果一帧未完成,会完成该帧
- p_sys->infoIntenable = 1; // 使能ISP的曝光统计完成中断
- // 设置 场
- p_sys->vmanSftset = 0;
- p_sys->vchkIntclr = 1;
- p_sys->pabtIntclr = 1;
- p_sys->fendIntset = 1;
- p_sys->fendIntclr = 1;
- p_sys->fabtIntclr = 1;
- p_sys->babtIntclr = 1;
- p_sys->ffiqIntclr = 1;
- p_sys->pendIntclr = 1;
- p_sys->infoStaclr = 1;
- p_sys->vchkIntraw = 0;
- p_sys->pabtIntraw = 0;
- p_sys->fendIntraw = 0;
- p_sys->fabtIntraw = 0;
- p_sys->babtIntraw = 0;
- p_sys->ffiqIntraw = 0;
- p_sys->pendIntraw = 0;
- p_sys->vchkIntmsk = 0;
- p_sys->pabtIntmsk = 0;
- p_sys->fendIntmsk = 0;
- p_sys->fabtIntmsk = 0;
- p_sys->babtIntmsk = 0;
- p_sys->ffiqIntmsk = 0;
- p_sys->pendIntmsk = 0;
- p_sys->fendIntid[0] = 0;
- p_sys->fendIntid[1] = 1;
- p_sys->fendIntid[2] = 2;
- p_sys->fendIntid[3] = 3;
- p_sys->ffiqIntdelay = 4;// 快中断
- p_sys->fendStaid = 0;
- p_sys->infoStadone = 0;
- if(isp_get_work_mode() == ISP_WORK_MODE_NORMAL)
- {
- p_sys->debugmode = 0;
- p_sys->testenable = 0; // 开启dram测试模式
- p_sys->rawmenable = 0; // 1 允许RAW写出
- p_sys->yuvenable = 1; // 0:关掉数据输出 1:打开
- #if ISP_3D_DENOISE_SUPPORT
- p_sys->refenable = 1; // 1;3D 参考帧开启 0:关闭
- #else
- p_sys->refenable = 0; // 1;3D 参考帧开启 0:关闭
- #endif
- }
- else if(isp_get_work_mode() == ISP_WORK_MODE_RAW)
- {
- // RAW写出会占用3D参考帧通道
- p_sys->debugmode = 1;
- p_sys->testenable = 0; // 开启dram测试模式
- p_sys->rawmenable = 1; // 1 允许RAW写出
- p_sys->yuvenable = 1; // 0:关掉数据输出 1:打开
- p_sys->refenable = 0; // 1;3D 参考帧开启 0:关闭
- }
- else if(isp_get_work_mode() == ISP_WORK_MODE_AUTOTEST)
- {
- p_sys->debugmode = 1;
- p_sys->testenable = 1; // 开启dram测试模式
- p_sys->rawmenable = 0; // 1 允许RAW写出
- p_sys->yuvenable = 1; // 0:关掉数据输出 1:打开
- p_sys->refenable = 1; // 1;3D 参考帧开启 0:关闭
- // 使能参考帧 (DRAM测试模式使用REFBUF指向的数据为RAW数据)
- }
- else
- {
- p_sys->debugmode = 0;
- p_sys->testenable = 0; // 开启dram测试模式
- p_sys->rawmenable = 0; // 1 允许RAW写出
- p_sys->yuvenable = 1; // 0:关掉数据输出 1:打开
- #if ISP_3D_DENOISE_SUPPORT
- p_sys->refenable = 1; // 1;3D 参考帧开启 0:关闭
- #else
- p_sys->refenable = 0; // 1;3D 参考帧开启 0:关闭
- #endif
- }
- #if ISP_3D_DENOISE_SUPPORT
- XM_printf ("ISP 3D Enable\n");
- #else
- XM_printf ("ISP 3D Disable\n");
- #endif
- /*
- #if 1
- p_sys->debugmode = 0;
- p_sys->testenable = 0; //开启dram测试模式
- p_sys->rawmenable = 0;
- p_sys->yuvenable = 1;//0:关掉数据输出 1:打开
- p_sys->refenable = 1;//1;
- #else // catch raw
- p_sys->debugmode = 0;
- p_sys->testenable = 0; //开启dram测试模式
- p_sys->rawmenable = 0;
- p_sys->yuvenable = 1;//0:关掉数据输出
- p_sys->refenable = 1;
- #endif
- */
- p_sys->yuvformat = isp_get_video_format (); //0茂录拧y_uv420 1:y_uv422 2:yuv420 3:yuv422
- //XM_printf("0茂录拧y_uv420 1:y_uv422 2:yuv420 3:yuv422 \n");
- //p_sys->dmalock = 2; //总线锁使能 2:使能 其他数值为关闭
- p_sys->dmalock = 0; // 总线锁使能 2:使能 其他数值为关闭
- // 总线锁禁止会减少H264的编码时间
- p_sys->hstride = p_isp->image_stride; //图像跨度 16字节倍数
- p_sys->refaddr = p_isp->ref_addr; //参考帧地址
- p_sys->rawaddr0 = p_isp->raw_addr[0];
- p_sys->rawaddr1 = p_isp->raw_addr[1];
- p_sys->rawaddr2 = p_isp->raw_addr[2];
- p_sys->rawaddr3 = p_isp->raw_addr[3];
- p_sys->yaddr0 = p_isp->y_addr[0];
- p_sys->uaddr0 = p_isp->u_addr[0];
- p_sys->vaddr0 = p_isp->v_addr[0];
- p_sys->yaddr1 = p_isp->y_addr[1];
- p_sys->uaddr1 = p_isp->u_addr[1];
- p_sys->vaddr1 = p_isp->v_addr[1];
- p_sys->yaddr2 = p_isp->y_addr[2];
- p_sys->uaddr2 = p_isp->u_addr[2];
- p_sys->vaddr2 = p_isp->v_addr[2];
- p_sys->yaddr3 = p_isp->y_addr[3];
- p_sys->uaddr3 = p_isp->u_addr[3];
- p_sys->vaddr3 = p_isp->v_addr[3];
- }
- // ISP运行设置
- extern cmos_exposure_t isp_exposure;
- typedef struct _isp_awb_polyline_tbl {
- int inttime;
- int black;
- int jitter;
- } isp_awb_polyline_tbl;
- static isp_awb_polyline_tbl awb_polyline_tbl[] = {
- { 1, 16, 10 },
- { 5, 8, 13 },
- { 800, 8, 13 },
- { CMOS_STD_INTTIME, 16, 13 }
- };
- static void awb_match_inttime (int inttime, isp_awb_polyline_tbl *awb_tbl)
- {
- int i;
- int val;
- isp_awb_polyline_tbl *lo, *hi;
- int count = sizeof(awb_polyline_tbl)/sizeof(awb_polyline_tbl[0]);
- for (i = 0; i < count; i ++)
- {
- if(inttime <= awb_polyline_tbl[i].inttime)
- break;
- }
- //匹配
- if(inttime == awb_polyline_tbl[i].inttime)
- {
- memcpy (awb_tbl, &awb_polyline_tbl[i], sizeof(isp_awb_polyline_tbl));
- return;
- }
- // 边界
- else if(inttime < awb_polyline_tbl[0].inttime)
- {
- memcpy (awb_tbl, &awb_polyline_tbl[0], sizeof(isp_awb_polyline_tbl));
- return;
- }
- else if(i == count)
- {
- memcpy (awb_tbl, &awb_polyline_tbl[count - 1], sizeof(isp_awb_polyline_tbl));
- return;
- }
- lo = &awb_polyline_tbl[i - 1];
- hi = &awb_polyline_tbl[i];
- val = (lo->black + (hi->black - lo->black) * (inttime - lo->inttime) / (hi->inttime - lo->inttime));
- if(val < 4)
- val = 4;
- else if(val > 48)
- val = 48;
- awb_tbl->black = val;
- val = (lo->jitter + (hi->jitter - lo->jitter) * (inttime - lo->inttime) / (hi->inttime - lo->inttime));
- if(val < 4)
- val = 4;
- else if(val > 48)
- val = 48;
- awb_tbl->jitter = val;
- }
- static void gc2053_cmos_isp_awb_run (isp_awb_ptr_t p_awb)
- {
- }
- #if IQ_20190522
- static const isp_demosaic_polyline_tbl demosaic_polyline_tbl[] = {
- // gain demk
- { 1, 90 },
- { 8, 104 },
- { 32, 132 },
- { 64, 240 },
- { 100, 240 },
- { 600, 212},
- { 1*CMOS_STD_INTTIME, 148 }, // 艙枚驴陋脝么脛拢脛芒脭枚脪忙脢卤, 沤脣脢卤脢鹿脛脺艙脧沤贸碌脛demk脰碌, 卤拢鲁脰艙脧潞脙碌脛艙芒脦枚露脠, 脥卢脢卤脭毛脡霉艙脧碌脥
- { 8*CMOS_STD_INTTIME, 48 }, // 艙枚驴陋脝么脛拢脛芒脭枚脪忙脢卤, 沤脣脢卤脢鹿脛脺艙脧沤贸碌脛demk脰碌, 卤拢鲁脰艙脧潞脙碌脛艙芒脦枚露脠, 脥卢脢卤脭毛脡霉艙脧碌脥
- { 20*CMOS_STD_INTTIME, 16 }, // 虏脦驴艗 f:\脗路虏芒脢脫脝碌\20170114脥铆脡脧\RAW\20170114\212128\212128_21212841_ISP_DEMK_064.PNG
- // 艗忙鹿脣艙芒脦枚露脠脫毛脭毛脡霉
- { 35*CMOS_STD_INTTIME, 6 }, // 艙脧沤贸脢媒脳脰脭枚脪忙
- { 64*CMOS_STD_INTTIME, 3 }, // 艙脧沤贸脢媒脳脰脭枚脪忙
- };
- #else
- // 20190626 降低拉伸强度,降低噪声
- static const isp_demosaic_polyline_tbl demosaic_polyline_tbl[] = {
- // gain demk
- { 1, 90-16 },
- { 8, 104-16 },
- { 32, 132-16 },
- { 64, 240-32 },
- { 100, 240-32 },
- { 600, 212-24},
- { 1*CMOS_STD_INTTIME, 148-16 }, // 仅开启模拟增益时, 此时使能较大的demk值, 保持较好的解析度, 同时噪声较低
- { 8*CMOS_STD_INTTIME, 48-12 }, // 仅开启模拟增益时, 此时使能较大的demk值, 保持较好的解析度, 同时噪声较低
- { 20*CMOS_STD_INTTIME, 16-4 }, // 参考 f:\路测视频\20170114晚上\RAW\20170114\212128\212128_21212841_ISP_DEMK_064.PNG
- // 兼顾解析度与噪声
- { 35*CMOS_STD_INTTIME, 6-3 }, // 较大数字增益
- { 64*CMOS_STD_INTTIME, 3-1 }, // 较大数字增益
- };
- #endif
- static const isp_demosaic_polyline_tbl *gc2053_cmos_isp_get_demosaic_table (int *tbl_count)
- {
- *tbl_count = sizeof(demosaic_polyline_tbl)/sizeof(demosaic_polyline_tbl[0]);
- return demosaic_polyline_tbl;
- }
- #if IQ_20190522
- static const isp_sharp_polyline_tbl gc2053_sharp_polyline_tbl[] = {
- // inttime strength gainmax
- { 3, 64, 200 },
- { CMOS_STD_INTTIME, 64, 200 },
- { CMOS_STD_INTTIME*8, 40, 96 },
- { CMOS_STD_INTTIME*32, 24, 64 }
- };
- #elif SENSOR_GC2053
- // 20191022 增加白天的锐度
- static const isp_sharp_polyline_tbl gc2053_sharp_polyline_tbl[] = {
- // inttime strength gainmax
- { 3, 64, 210 },
- { CMOS_STD_INTTIME, 56, 180 },
- { CMOS_STD_INTTIME*8, 24, 64 },
- { CMOS_STD_INTTIME*32, 10, 24 },
- { CMOS_STD_INTTIME*48, 6, 16 }
- };
- #else
- // 20190626 艙碌碌脥碌脥脮脮露脠脧脗碌脛脠帽露脠拢卢艙碌碌脥脭毛脡霉
- static const isp_sharp_polyline_tbl gc2053_sharp_polyline_tbl[] = {
- // inttime strength gainmax
- { 3, 64, 144 },
- { CMOS_STD_INTTIME, 56, 144 },
- { CMOS_STD_INTTIME*8, 24, 64 },
- { CMOS_STD_INTTIME*32, 10, 24 },
- { CMOS_STD_INTTIME*48, 6, 16 }
- };
- #endif
- static const isp_sharp_polyline_tbl *gc2053_cmos_isp_get_sharp_table (int *tbl_count)
- {
- *tbl_count = sizeof(gc2053_sharp_polyline_tbl)/sizeof(gc2053_sharp_polyline_tbl[0]);
- return gc2053_sharp_polyline_tbl;
- }
- #if IQ_20190522
- static const isp_denoise_inttime_polyline_tbl denoise_inttime_polyline_tbl[] = {
- // inttime_gain y_0 u_0 v_0 y_1 u_1 v_1 y_2 u_2 v_2
- {
- 1, 7, 10, 10, 7, 10, 10, 3, 3, 3,
- //1, 5, 3, 3, 5, 3, 3, 4, 3, 3,
- } ,
-
- // 20170305 艙芦2D碌脛艙碌脭毛脟驴露脠艗玫1(-1), 卤拢脕么啪眉露脿碌脛脧啪艙脷
- {
- 12, 7, 10, 10, 7, 10, 10, 3, 3, 3,
- //32, 5, 4, 4, 5, 4, 4, 4, 3, 3,
- } ,
- {
- 128, 7, 12, 12, 7, 12, 12, 3, 3, 3,
- //128, 4, 4, 4, 4, 4, 4, 4, 3, 3,
- } ,
-
- // e:\proj\ARKN141\test\ISP碌梅脢脭\20170202
- {
- 1073, 9, 13, 13, 9, 13, 13, 4, 3, 3,
- },
- {
- CMOS_STD_INTTIME*2, 12, 14, 14, 12, 14, 14, 5, 6, 6,
- },
- {
- //CMOS_STD_INTTIME*4, 10, 10, 10, 10, 10, 10, 8, 8, 8,
- CMOS_STD_INTTIME*4, 14, 18, 18, 14, 18, 18, 8, 8, 8,
- } ,
- {
- CMOS_STD_INTTIME*12, 22, 28, 28, 22, 28, 28, 12, 12, 12,
- //CMOS_STD_INTTIME*12, 12, 14, 14, 12, 14, 14, 12, 12, 12,
- } ,
- {
- CMOS_STD_INTTIME*14, 26, 32, 32, 26, 32, 32, 13, 13, 13,
- //CMOS_STD_INTTIME*14, 14, 16, 16, 14, 16, 16, 13, 13, 13,
- } ,
- {
- CMOS_STD_INTTIME*20, 33, 40, 40, 33, 40, 40, 13, 13, 13,
- //CMOS_STD_INTTIME*20, 22, 25, 25, 22, 25, 25, 13, 13, 13,
- },
- {
- CMOS_STD_INTTIME*40, 52, 60, 60, 52, 60, 60, 13, 13, 13,
- },
- {
- CMOS_STD_INTTIME*64, 84, 94, 94, 84, 94, 94, 13, 13, 13,
- },
- {
- CMOS_STD_INTTIME*128, 160, 190, 190, 160, 190, 190, 8, 9, 9,
- },
- {
- CMOS_STD_INTTIME*177, 220, 240, 240, 223, 240, 240, 13, 13, 13,
- },
- };
- #else
- // 20190626 脭枚艗脫艙碌脭毛脟驴露脠拢卢艙碌碌脥脭毛脡霉
- static const isp_denoise_inttime_polyline_tbl denoise_inttime_polyline_tbl[] = {
- // inttime_gain y_0 u_0 v_0 y_1 u_1 v_1 y_2 u_2 v_2
- {
- 1, 8, 11, 11, 8, 11, 11, 3, 3, 3,
- //1, 5, 3, 3, 5, 3, 3, 4, 3, 3,
- } ,
-
- // 20170305 艙芦2D碌脛艙碌脭毛脟驴露脠艗玫1(-1), 卤拢脕么啪眉露脿碌脛脧啪艙脷
- {
- 12, 8, 11, 11, 8, 11, 11, 3, 3, 3,
- //32, 5, 4, 4, 5, 4, 4, 4, 3, 3,
- } ,
- {
- 128, 8, 13, 13, 8, 13, 13, 3, 3, 3,
- //128, 4, 4, 4, 4, 4, 4, 4, 3, 3,
- } ,
-
- // e:\proj\ARKN141\test\ISP碌梅脢脭\20170202
- {
- 1073, 10, 15, 15, 10, 15, 15, 4, 3, 3,
- },
- {
- CMOS_STD_INTTIME*2, 13, 15, 15, 13, 15, 15, 5, 6, 6,
- },
- {
- //CMOS_STD_INTTIME*4, 10, 10, 10, 10, 10, 10, 8, 8, 8,
- CMOS_STD_INTTIME*4, 15, 20, 20, 15, 20, 20, 8, 8, 8,
- } ,
- {
- CMOS_STD_INTTIME*12, 24, 32, 32, 24, 32, 32, 12, 12, 12,
- //CMOS_STD_INTTIME*12, 12, 14, 14, 12, 14, 14, 12, 12, 12,
- } ,
- {
- CMOS_STD_INTTIME*14, 28, 36, 36, 28, 36, 36, 13, 13, 13,
- //CMOS_STD_INTTIME*14, 14, 16, 16, 14, 16, 16, 13, 13, 13,
- } ,
- {
- CMOS_STD_INTTIME*20, 33, 48, 48, 33, 48, 48, 13, 13, 13,
- //CMOS_STD_INTTIME*20, 22, 25, 25, 22, 25, 25, 13, 13, 13,
- },
- {
- CMOS_STD_INTTIME*40, 48, 60, 60, 48, 60, 60, 13, 13, 13,
- },
- {
- CMOS_STD_INTTIME*64, 56, 64, 64, 56, 64, 64, 13, 13, 13,
- },
- {
- CMOS_STD_INTTIME*80, 80, 128, 128, 80, 128, 128, 8, 9, 9,
- },
- {
- CMOS_STD_INTTIME*128, 128, 160, 160, 128, 160, 160, 8, 9, 9,
- },
- {
- CMOS_STD_INTTIME*177, 220, 240, 240, 223, 240, 240, 13, 13, 13,
- },
- };
- #endif
- static const isp_denoise_inttime_polyline_tbl *gc2053_cmos_isp_get_denoise_table (int *tbl_count)
- {
- *tbl_count = sizeof(denoise_inttime_polyline_tbl)/sizeof(denoise_inttime_polyline_tbl[0]);
- return (isp_denoise_inttime_polyline_tbl *)denoise_inttime_polyline_tbl;
- }
- #if IQ_20190522
- static const isp_eris_polyline_tbl eris_polyline_tbl[] = {
-
- // 20170305 脭枚艗脫露脤脝脴鹿芒鲁隆鸥掳碌脛脌颅脡矛脟驴露脠, 啪脛脡脝艙芒脦枚露脠艗掳脩脮脡芦
- { 1, 96, (int)(0.86 * 512), (int)(0.45 * 512) },
- // 20190325掳脳脤矛脗路虏芒拢卢脡芦虏脢脝芦禄脝拢卢艙碌碌脥掳脳脤矛碌脛脡芦虏脢脌颅脡矛脟驴露脠
- // 20190426掳脳脤矛脗路虏芒拢卢脕脕鲁隆鸥掳脧脗艙拧脰镁脦茂露楼虏驴脡脭脦垄鹿媒脝脴拢卢艙碌碌脥脕脕露脠脭枚脪忙
- { 5, 96, (int)(0.91 * 512), (int)(0.45 * 512) },
- { 32, 112, (int)(0.92 * 512), (int)(0.45 * 512) },
- { 80, 212, (int)(0.93 * 512), (int)(0.45 * 512) },
- { 400, 212, (int)(0.94 * 512), (int)(0.45 * 512) },
- { 700, 240, (int)(0.92 * 512), (int)(0.45 * 512) },
- { 820, 240, (int)(0.91 * 512), (int)(0.45 * 512) },
- { 900, 256, (int)(0.90 * 512), (int)(0.45 * 512) },
- { 1023, 256, (int)(0.86 * 512), (int)(0.40 * 512) },
- // 脗路虏芒脭毛脡霉脝芦沤贸拢卢艙碌碌脥脕脕露脠脭枚脪忙拢卢脪脰脰脝脭毛脡霉
- { CMOS_STD_INTTIME, 240, (int)(0.80 * 512), (int)(0.40 * 512) },
- { CMOS_STD_INTTIME*2, 214, (int)(0.75 * 512), (int)(0.40 * 512) },
- { CMOS_STD_INTTIME*10, 210, (int)(0.50 * 512), (int)(0.30 * 512) },
- { CMOS_STD_INTTIME*12, 210, (int)(0.40 * 512), (int)(0.2 * 512) },
-
- { CMOS_STD_INTTIME*30, 240, (int)(0.24 * 512), (int)(0.2 * 512) },
- { CMOS_STD_INTTIME*60, 320, (int)(0.15 * 512), (int)(0.2 * 512) },
- { CMOS_STD_INTTIME*128, 320, (int)(0.10 * 512), (int)(0.2 * 512) },
- };
- #elif SENSOR_GC2053
- /****
- // 20191021 增强白天颜色的饱和度
- static const isp_eris_polyline_tbl eris_polyline_tbl[] = {
-
- // 20170305 增加短曝光场景的拉伸强度, 改善解析度及颜色
- { 1, 96, (int)(0.80 * 512), (int)(0.60 * 512) },
- // 20190325白天路测,色彩偏黄,降低白天的色彩拉伸强度
- // 20190426白天路测,亮场景下建筑物顶部稍微过曝,降低亮度增益
- { 5, 96, (int)(0.85 * 512), (int)(0.60 * 512) },
- { 32, 112, (int)(0.86 * 512), (int)(0.60 * 512) },
- { 80, 212, (int)(0.87 * 512), (int)(0.60 * 512) },
- { 400, 212, (int)(0.88 * 512), (int)(0.60 * 512) },
- { 700, 240, (int)(0.86 * 512), (int)(0.60 * 512) },
- { 820, 240, (int)(0.85 * 512), (int)(0.60 * 512) },
- { 900, 256, (int)(0.80 * 512), (int)(0.60 * 512) },
- { 1023, 256, (int)(0.70 * 512), (int)(0.55 * 512) },
- // 路测噪声偏大,降低亮度增益,抑制噪声
- { CMOS_STD_INTTIME, 240, (int)(0.60 * 512), (int)(0.55 * 512) },
- { CMOS_STD_INTTIME*2, 214, (int)(0.50 * 512), (int)(0.55 * 512) },
- { CMOS_STD_INTTIME*10, 210, (int)(0.30 * 512), (int)(0.45 * 512) },
- { CMOS_STD_INTTIME*12, 210, (int)(0.15 * 512), (int)(0.35 * 512) },
-
- // 降低低照度增益,减轻噪声
- { CMOS_STD_INTTIME*30, 160, (int)(0.10 * 512), (int)(0.25 * 512) },
- { CMOS_STD_INTTIME*60, 144, (int)(0.10 * 512), (int)(0.2 * 512) },
- { CMOS_STD_INTTIME*128, 144, (int)(0.10 * 512), (int)(0.2 * 512) },
- };
- *****/
- // 20191022 增强白天颜色的饱和度
- static const isp_eris_polyline_tbl eris_polyline_tbl[] = {
-
- // 20170305 增加短曝光场景的拉伸强度, 改善解析度及颜色
- { 1, 96, (int)(0.80 * 512), (int)(0.80 * 512) },
- // 20190325白天路测,色彩偏黄,降低白天的色彩拉伸强度
- // 20190426白天路测,亮场景下建筑物顶部稍微过曝,降低亮度增益
- { 5, 96, (int)(0.85 * 512), (int)(0.80 * 512) },
- { 32, 112, (int)(0.86 * 512), (int)(0.80 * 512) },
- { 80, 212, (int)(0.87 * 512), (int)(0.80 * 512) },
- { 400, 212, (int)(0.88 * 512), (int)(0.80 * 512) },
- { 700, 240, (int)(0.86 * 512), (int)(0.80 * 512) },
- { 820, 240, (int)(0.85 * 512), (int)(0.80 * 512) },
- { 900, 256, (int)(0.80 * 512), (int)(0.80 * 512) },
- { 1023, 256, (int)(0.70 * 512), (int)(0.75 * 512) },
- // 路测噪声偏大,降低亮度增益,抑制噪声
- { CMOS_STD_INTTIME, 240, (int)(0.60 * 512), (int)(0.75 * 512) },
- { CMOS_STD_INTTIME*2, 214, (int)(0.50 * 512), (int)(0.70 * 512) },
- { CMOS_STD_INTTIME*10, 210, (int)(0.30 * 512), (int)(0.60 * 512) },
- { CMOS_STD_INTTIME*12, 210, (int)(0.15 * 512), (int)(0.45 * 512) },
-
- // 降低低照度增益,减轻噪声
- { CMOS_STD_INTTIME*30, 160, (int)(0.10 * 512), (int)(0.25 * 512) },
- { CMOS_STD_INTTIME*60, 144, (int)(0.10 * 512), (int)(0.2 * 512) },
- { CMOS_STD_INTTIME*128, 144, (int)(0.10 * 512), (int)(0.2 * 512) },
- };
- #else
- // 20191022 增强白天颜色的饱和度
- static const isp_eris_polyline_tbl eris_polyline_tbl[] = {
-
- // 20170305 增加短曝光场景的拉伸强度, 改善解析度及颜色
- { 1, 96, (int)(0.80 * 512), (int)(0.45 * 512) },
- // 20190325白天路测,色彩偏黄,降低白天的色彩拉伸强度
- // 20190426白天路测,亮场景下建筑物顶部稍微过曝,降低亮度增益
- { 5, 96, (int)(0.85 * 512), (int)(0.45 * 512) },
- { 32, 112, (int)(0.86 * 512), (int)(0.45 * 512) },
- { 80, 212, (int)(0.87 * 512), (int)(0.45 * 512) },
- { 400, 212, (int)(0.88 * 512), (int)(0.45 * 512) },
- { 700, 240, (int)(0.86 * 512), (int)(0.45 * 512) },
- { 820, 240, (int)(0.85 * 512), (int)(0.45 * 512) },
- { 900, 256, (int)(0.80 * 512), (int)(0.45 * 512) },
- { 1023, 256, (int)(0.70 * 512), (int)(0.40 * 512) },
- // 路测噪声偏大,降低亮度增益,抑制噪声
- { CMOS_STD_INTTIME, 240, (int)(0.60 * 512), (int)(0.40 * 512) },
- { CMOS_STD_INTTIME*2, 214, (int)(0.50 * 512), (int)(0.40 * 512) },
- { CMOS_STD_INTTIME*10, 210, (int)(0.30 * 512), (int)(0.30 * 512) },
- { CMOS_STD_INTTIME*12, 210, (int)(0.15 * 512), (int)(0.2 * 512) },
-
- // 降低低照度增益,减轻噪声
- { CMOS_STD_INTTIME*30, 160, (int)(0.10 * 512), (int)(0.2 * 512) },
- { CMOS_STD_INTTIME*60, 144, (int)(0.10 * 512), (int)(0.2 * 512) },
- { CMOS_STD_INTTIME*128, 144, (int)(0.10 * 512), (int)(0.2 * 512) },
- };
- #endif
- static const isp_eris_polyline_tbl* gc2053_cmos_isp_get_eris_auto_table(int *tbl_count)
- {
- *tbl_count = sizeof(eris_polyline_tbl)/sizeof(eris_polyline_tbl[0]);
- return eris_polyline_tbl;
- }
- static const isp_eris_man_polyline_tbl eris_man_polyline_tbl[] = {
- { 1, 112, 160, (int)(0.95 * 512), (int)(0.75 * 512) },
- { 5, 144, 160, (int)(0.96 * 512), (int)(0.75 * 512) },
- { 32, 196, 160, (int)(0.97 * 512), (int)(0.75 * 512) },
- { 80, 240, 144, (int)(0.99 * 512), (int)(0.8 * 512) },
- { 700, 240, 80, (int)(0.99 * 512), (int)(0.9 * 512) },
- { 1023, 320, 64, (int)(0.98 * 512), (int)(0.9 * 512) },
- // 20170217 地下车库测试发现, N141墙壁上指引标志的色彩偏暗, 稍微提高暗场景下色彩的比率因子(+0.1)
- { CMOS_STD_INTTIME, 320, 48, (int)(0.98 * 512), (int)(0.8 * 512) },
- { CMOS_STD_INTTIME*4, 320, 32, (int)(0.98 * 512), (int)(0.6 * 512) },
- { CMOS_STD_INTTIME*10, 440, 32, (int)(0.95 * 512), (int)(0.6 * 512) },
- { CMOS_STD_INTTIME*12, 440, 32, (int)(0.85 * 512), (int)(0.5 * 512) },
- { CMOS_STD_INTTIME*15, 440, 32, (int)(0.80 * 512), (int)(0.5 * 512) },
- { CMOS_STD_INTTIME*35, 440, 32, (int)(0.60 * 512), (int)(0.4 * 512) },
- { CMOS_STD_INTTIME*60, 440, 32, (int)(0.50 * 512), (int)(0.4 * 512) },
- { CMOS_STD_INTTIME*128, 440, 32, (int)(0.40 * 512), (int)(0.2 * 512) },
- { CMOS_STD_INTTIME*177, 440, 32, (int)(0.20 * 512), (int)(0.2 * 512) },
- };
- static const isp_eris_man_polyline_tbl *gc2053_cmos_isp_get_eris_man_table(int *tbl_count)
- {
- *tbl_count = sizeof(eris_man_polyline_tbl)/sizeof(eris_man_polyline_tbl[0]);
- return eris_man_polyline_tbl;
- }
- // 3D关闭时的参数,
- static const isp_crosstalk_polyline_tbl crosstalk_polyline_tbl[] = {
- // inttime_gain crosstalk
- // 20170217上午及之前使用的版本
- { 50, 2 + 2 },
- { 100, 3 + 2 },
- { 161, 3 + 2 },
- { 242, 3 + 2 },
- { 1024, 3 + 3 },
- // 20190321 晚上路测,噪声偏大,增加降噪强度
- { CMOS_STD_INTTIME, 5 + 4 },
- { CMOS_STD_INTTIME * 2, 8 + 4 },
- { CMOS_STD_INTTIME * 4, 10 + 7 },
- { CMOS_STD_INTTIME * 10, 12 + 12 },
- { CMOS_STD_INTTIME * 30, 24 + 18 },
- { CMOS_STD_INTTIME * 64, 48 + 23 },
- { CMOS_STD_INTTIME * 128, 64 + 33 },
- { CMOS_STD_INTTIME * 177, 128 },
- };
- static const isp_crosstalk_polyline_tbl *gc2053_cmos_isp_get_crosstalk_table (int *tbl_count)
- {
- *tbl_count = sizeof(crosstalk_polyline_tbl)/sizeof(crosstalk_polyline_tbl[0]);
- return crosstalk_polyline_tbl;
- }
- #pragma data_alignment=32
- #if IQ_20190522
- static const isp_enhance_polyline_tbl enhance_polyline_tbl[] = {
- // inttime bright contrast
- //{ 3, -6, 1024 },
- //{ 64, -8, 1024 },
- // 保留短曝光低光处的细节
- { 3, -2, 1024 },
- { 64, -2, 1024 },
-
- { 512, -4, 1024 },
- { 800, -4, 1024 },
- { 1125, -4, 1024 }, // 场景光照较弱时, 噪声增加, 相应增加黑电平
- { CMOS_STD_INTTIME * 2, -4, 1024},
- // 20190321 夜晚路测,噪声偏大,增大黑电平
- { CMOS_STD_INTTIME * 16, -5, 1024},
-
- };
- #else
- // 20190626 增大低照度场景下的黑电平
- static const isp_enhance_polyline_tbl enhance_polyline_tbl[] = {
- // inttime bright contrast
- //{ 3, -6, 1024 },
- //{ 64, -8, 1024 },
- // 保留短曝光低光处的细节
- { 3, -2, 1024 },
- { 64, -2, 1024 },
-
- { 512, -4, 1024 },
- { 800, -4, 1024 },
- { 1125, -4, 1024 }, // 场景光照较弱时, 噪声增加, 相应增加黑电平
- { CMOS_STD_INTTIME * 2, -4, 1024},
- // 20190321 夜晚路测,噪声偏大,增大黑电平
- { CMOS_STD_INTTIME * 16, -5, 1024},
- { CMOS_STD_INTTIME * 32, -7, 1024},
- { CMOS_STD_INTTIME * 64, -9, 1024},
-
- };
- #endif
- static const isp_enhance_polyline_tbl * gc2053_cmos_isp_get_enhance_table (int *tbl_count)
- {
- *tbl_count = sizeof(enhance_polyline_tbl)/sizeof(enhance_polyline_tbl[0]);
- return enhance_polyline_tbl;
- }
- #if 1
- static const isp_satuation_polyline_tbl satuation_polyline_tbl[] = {
- // inttime satuation
- { 1 * CMOS_STD_INTTIME, 900 },
- { 10 * CMOS_STD_INTTIME, 800 },
- { 12 * CMOS_STD_INTTIME, 720 },
- { 24 * CMOS_STD_INTTIME, 512 },
- { 32 * CMOS_STD_INTTIME, 384 },
- { 64 * CMOS_STD_INTTIME, 384 },
- };
- #else
- // 20190626 脭枚艗脫脡芦虏脢卤楼潞脥露脠
- static const isp_satuation_polyline_tbl satuation_polyline_tbl[] = {
- // inttime satuation
- { 1 * CMOS_STD_INTTIME, 1000 },
- { 10 * CMOS_STD_INTTIME, 900 },
- { 12 * CMOS_STD_INTTIME, 800 },
- { 24 * CMOS_STD_INTTIME, 640 },
- { 32 * CMOS_STD_INTTIME, 512 },
- { 64 * CMOS_STD_INTTIME, 512 },
- };
- #endif
- static const isp_satuation_polyline_tbl * gc2053_cmos_isp_get_satuation_table (int *tbl_count)
- {
- *tbl_count = sizeof(satuation_polyline_tbl)/sizeof(satuation_polyline_tbl[0]);
- return satuation_polyline_tbl;
- }
- #define AE_GAIN(x) ((unsigned int)(x*1.0))
- // 20190422白天测试,与原厂比较,曝光过曝
- static const isp_ae_polyline_tbl ae_polyline_tbl_20190422[] = {
- // 1) 增加短曝光场景下(包括逆光)的亮度
- { 1, AE_GAIN(64), 128, {1, 1, 1, 2, 5, 2, 12, 15, 12} },
- { 16, AE_GAIN(60), 128, {1, 1, 1, 4, 10, 4, 12, 15, 12} },
- { 32, AE_GAIN(56), 128, {2, 3, 2, 6, 15, 6, 12, 15, 12} },
- { 64, AE_GAIN(56), 128, {4, 5, 4, 5, 10, 5, 6, 10, 6} },
- { 512, AE_GAIN(53), 128, {4, 5, 4, 5, 10, 5, 6, 10, 6} },
- { 878, AE_GAIN(47), 128, {7, 7, 7, 7, 7, 7, 7, 7, 7 } },
- // 2 增加海岸城晚上路边两侧的亮度
- //{ CMOS_STD_INTTIME, AE_GAIN(27), 128, {7, 7, 7, 7, 7, 7, 7, 7, 7 } },
- //{ CMOS_STD_INTTIME*5/2, AE_GAIN(22), 128, {7, 7, 7, 7, 7, 7, 7, 7, 7 } },
- //{ CMOS_STD_INTTIME*8, AE_GAIN(18), 128, {7, 7, 7, 7, 7, 7, 7, 7, 7 } },
- { CMOS_STD_INTTIME, AE_GAIN(39), 128, {3, 4, 3, 5, 7, 5, 7, 7, 7 } },
- { CMOS_STD_INTTIME*5/2, AE_GAIN(33), 128, {4, 4, 4, 5, 7, 5, 7, 7, 7 } },
- { CMOS_STD_INTTIME*4, AE_GAIN(24), 128, {7, 7, 7, 7, 7, 7, 7, 7, 7 } },
- { CMOS_STD_INTTIME*8, AE_GAIN(19), 128, {7, 7, 7, 7, 7, 7, 7, 7, 7 } },
- };
- static const isp_ae_polyline_tbl ae_polyline_tbl_new[] = {
- // 1) 增加短曝光场景下(包括逆光)的亮度
- { 1, AE_GAIN(58), 128, {1, 1, 1, 2, 5, 2, 12, 15, 12} },
- { 16, AE_GAIN(54), 128, {1, 1, 1, 4, 10, 4, 12, 15, 12} },
- { 32, AE_GAIN(50), 128, {2, 3, 2, 6, 15, 6, 12, 15, 12} },
- { 64, AE_GAIN(50), 128, {4, 5, 4, 5, 10, 5, 6, 10, 6} },
- { 512, AE_GAIN(48), 128, {4, 5, 4, 5, 10, 5, 6, 10, 6} },
- { 878, AE_GAIN(48), 128, {7, 7, 7, 7, 7, 7, 7, 7, 7 } },
- // 2 增加海岸城晚上路边两侧的亮度
- //{ CMOS_STD_INTTIME, AE_GAIN(27), 128, {7, 7, 7, 7, 7, 7, 7, 7, 7 } },
- //{ CMOS_STD_INTTIME*5/2, AE_GAIN(22), 128, {7, 7, 7, 7, 7, 7, 7, 7, 7 } },
- //{ CMOS_STD_INTTIME*8, AE_GAIN(18), 128, {7, 7, 7, 7, 7, 7, 7, 7, 7 } },
- { CMOS_STD_INTTIME, AE_GAIN(48), 128, {3, 4, 3, 5, 7, 5, 7, 7, 7 } },
- { CMOS_STD_INTTIME*5/2, AE_GAIN(42), 128, {4, 4, 4, 5, 7, 5, 7, 7, 7 } },
- { CMOS_STD_INTTIME*4, AE_GAIN(32), 128, {7, 7, 7, 7, 7, 7, 7, 7, 7 } },
- { CMOS_STD_INTTIME*8, AE_GAIN(18), 128, {7, 7, 7, 7, 7, 7, 7, 7, 7 } },
- };
- static const isp_ae_polyline_tbl ae_polyline_tbl_20170322_pm[] = {
- // 1) 增加短曝光场景下(包括逆光)的亮度
- { 1, AE_GAIN(36), 128, {1, 1, 1, 2, 5, 2, 12, 15, 12} },
- { 16, AE_GAIN(36), 128, {1, 1, 1, 4, 10, 4, 12, 15, 12} },
- { 32, AE_GAIN(36), 128, {2, 3, 2, 6, 15, 6, 12, 15, 12} },
- { 64, AE_GAIN(40), 128, {4, 5, 4, 5, 10, 5, 6, 10, 6} },
- { 512, AE_GAIN(40), 128, {4, 5, 4, 5, 10, 5, 6, 10, 6} },
- { 878, AE_GAIN(40), 128, {7, 7, 7, 7, 7, 7, 7, 7, 7 } },
- // 2 增加海岸城晚上路边两侧的亮度
- //{ CMOS_STD_INTTIME, AE_GAIN(27), 128, {7, 7, 7, 7, 7, 7, 7, 7, 7 } },
- //{ CMOS_STD_INTTIME*5/2, AE_GAIN(22), 128, {7, 7, 7, 7, 7, 7, 7, 7, 7 } },
- //{ CMOS_STD_INTTIME*8, AE_GAIN(18), 128, {7, 7, 7, 7, 7, 7, 7, 7, 7 } },
- { CMOS_STD_INTTIME, AE_GAIN(39), 128, {3, 4, 3, 5, 7, 5, 7, 7, 7 } },
- { CMOS_STD_INTTIME*5/2, AE_GAIN(33), 128, {4, 4, 4, 5, 7, 5, 7, 7, 7 } },
- { CMOS_STD_INTTIME*4, AE_GAIN(24), 128, {7, 7, 7, 7, 7, 7, 7, 7, 7 } },
- { CMOS_STD_INTTIME*8, AE_GAIN(19), 128, {7, 7, 7, 7, 7, 7, 7, 7, 7 } },
- };
- /****
- static const isp_ae_polyline_tbl ae_polyline_tbl[] = {
- // 1) 氓垄啪氓艩聽莽鸥颅忙鈥郝澝モ€︹€懊ヅ撀好︹劉炉盲赂鈥�(氓艗鈥γ︹€孤�┾偓鈥犆モ€︹€�)莽拧鈥灻ぢ郝�ヂ郝�
- { 1, AE_GAIN(32), 128, {1, 2, 1, 2, 5, 2, 12, 15, 12} },
- { 16, AE_GAIN(32), 128, {1, 2, 1, 4, 10, 4, 12, 15, 12} },
- { 32, AE_GAIN(32), 128, {2, 4, 2, 6, 15, 6, 12, 15, 12} },
- { 64, AE_GAIN(32), 128, {4, 5, 4, 5, 10, 5, 6, 10, 6} },
- { 512, AE_GAIN(33), 128, {4, 5, 4, 5, 10, 5, 6, 10, 6} },
- { 878, AE_GAIN(35), 128, {7, 7, 7, 7, 7, 7, 7, 7, 7 } },
- // 2 氓垄啪氓艩聽忙碌路氓虏赂氓鸥沤忙鈩⑴∶ぢ概犆�仿��韭姑ぢ嘎っぢ韭��♀€灻ぢ郝�ヂ郝�
- //{ CMOS_STD_INTTIME, AE_GAIN(27), 128, {7, 7, 7, 7, 7, 7, 7, 7, 7 } },
- //{ CMOS_STD_INTTIME*5/2, AE_GAIN(22), 128, {7, 7, 7, 7, 7, 7, 7, 7, 7 } },
- //{ CMOS_STD_INTTIME*8, AE_GAIN(18), 128, {7, 7, 7, 7, 7, 7, 7, 7, 7 } },
- { CMOS_STD_INTTIME, AE_GAIN(35), 128, {3, 4, 3, 5, 7, 5, 7, 7, 7 } },
- { CMOS_STD_INTTIME*5/2, AE_GAIN(33), 128, {4, 4, 4, 5, 7, 5, 7, 7, 7 } },
- { CMOS_STD_INTTIME*4, AE_GAIN(24), 128, {7, 7, 7, 7, 7, 7, 7, 7, 7 } },
- { CMOS_STD_INTTIME*8, AE_GAIN(19), 128, {7, 7, 7, 7, 7, 7, 7, 7, 7 } },
- };
- ****/
- /****
- // 20191021 改善白天/晚上过曝的问题
- static const isp_ae_polyline_tbl ae_polyline_tbl[] = {
- // 1) 增加短曝光场景下(包括逆光)的亮度
- { 1, AE_GAIN(24), 128, {2, 3, 2, 2, 5, 2, 12, 15, 12} },
- { 16, AE_GAIN(24), 128, {2, 3, 2, 4, 10, 4, 12, 15, 12} },
- { 32, AE_GAIN(24), 128, {3, 5, 3, 6, 15, 6, 12, 15, 12} },
- { 64, AE_GAIN(24), 128, {4, 5, 4, 5, 10, 5, 6, 10, 6} },
- { 512, AE_GAIN(24), 128, {4, 5, 4, 5, 10, 5, 6, 10, 6} },
- { 878, AE_GAIN(24), 128, {7, 7, 7, 7, 7, 7, 7, 7, 7 } },
-
- // 2 增加海岸城晚上路边两侧的亮度
- //{ CMOS_STD_INTTIME, AE_GAIN(27), 128, {7, 7, 7, 7, 7, 7, 7, 7, 7 } },
- //{ CMOS_STD_INTTIME*5/2, AE_GAIN(22), 128, {7, 7, 7, 7, 7, 7, 7, 7, 7 } },
- //{ CMOS_STD_INTTIME*8, AE_GAIN(18), 128, {7, 7, 7, 7, 7, 7, 7, 7, 7 } },
- { CMOS_STD_INTTIME, AE_GAIN(24), 128, {3, 4, 3, 5, 7, 5, 7, 7, 7 } },
- { CMOS_STD_INTTIME*5/2, AE_GAIN(22), 128, {4, 4, 4, 5, 7, 5, 7, 7, 7 } },
- { CMOS_STD_INTTIME*4, AE_GAIN(18), 128, {7, 7, 7, 7, 7, 7, 7, 7, 7 } },
- { CMOS_STD_INTTIME*8, AE_GAIN(16), 128, {7, 7, 7, 7, 7, 7, 7, 7, 7 } },
- };
- *****/
- // 20191030
- // 测试发现阴天白天亮度稍微偏暗, 增加场景亮度
- static const isp_ae_polyline_tbl ae_polyline_tbl[] = {
- // 1) 增加短曝光场景下(包括逆光)的亮度
- { 1, AE_GAIN(32), 128, {2, 3, 2, 2, 5, 2, 12, 15, 12} },
- { 16, AE_GAIN(32), 128, {2, 3, 2, 4, 10, 4, 12, 15, 12} },
- { 32, AE_GAIN(32), 128, {3, 5, 3, 6, 15, 6, 12, 15, 12} },
- { 64, AE_GAIN(32), 128, {4, 5, 4, 5, 10, 5, 6, 10, 6} },
- { 512, AE_GAIN(32), 128, {4, 5, 4, 5, 10, 5, 6, 10, 6} },
- { 878, AE_GAIN(29), 128, {7, 7, 7, 7, 7, 7, 7, 7, 7 } },
-
- // 2 增加海岸城晚上路边两侧的亮度
- //{ CMOS_STD_INTTIME, AE_GAIN(27), 128, {7, 7, 7, 7, 7, 7, 7, 7, 7 } },
- //{ CMOS_STD_INTTIME*5/2, AE_GAIN(22), 128, {7, 7, 7, 7, 7, 7, 7, 7, 7 } },
- //{ CMOS_STD_INTTIME*8, AE_GAIN(18), 128, {7, 7, 7, 7, 7, 7, 7, 7, 7 } },
- { CMOS_STD_INTTIME, AE_GAIN(25), 128, {3, 4, 3, 5, 7, 5, 7, 7, 7 } },
- { CMOS_STD_INTTIME*5/2, AE_GAIN(22), 128, {4, 4, 4, 5, 7, 5, 7, 7, 7 } },
- { CMOS_STD_INTTIME*4, AE_GAIN(18), 128, {7, 7, 7, 7, 7, 7, 7, 7, 7 } },
- { CMOS_STD_INTTIME*8, AE_GAIN(16), 128, {7, 7, 7, 7, 7, 7, 7, 7, 7 } },
- };
- static const isp_ae_polyline_tbl *gc2053_cmos_isp_get_ae_table (int *tbl_count)
- {
- *tbl_count = sizeof(ae_polyline_tbl)/sizeof(ae_polyline_tbl[0]);
- return ae_polyline_tbl;
- }
- static void gc2053_cmos_isp_set_day_night_mode (cmos_gain_ptr_t gain, int day_night) // day_night = 1, 夜晚增强模式, day_night = 0, 普通模式
- {
- }
- u32_t isp_init_cmos_sensor (cmos_sensor_t *cmos_sensor)
- {
- memset (cmos_sensor, 0, sizeof(cmos_sensor_t));
- cmos_sensor->cmos_gain_initialize = cmos_gain_initialize;
- cmos_sensor->cmos_max_gain_set = gc2053_cmos_max_gain_set;
- cmos_sensor->cmos_max_gain_get = gc2053_cmos_max_gain_get;
- //cmos_sensor->cmos_gain_update = cmos_gain_update;
- cmos_sensor->cmos_inttime_initialize = cmos_inttime_initialize;
- //cmos_sensor->cmos_inttime_update = cmos_inttime_update;
- cmos_sensor->cmos_inttime_gain_update = cmos_inttime_gain_update;
- cmos_sensor->cmos_inttime_gain_update_manual = cmos_inttime_gain_update_manual;
- cmos_sensor->analog_gain_from_exposure_calculate = analog_gain_from_exposure_calculate;
- cmos_sensor->digital_gain_from_exposure_calculate = digital_gain_from_exposure_calculate;
- cmos_sensor->cmos_get_iso = cmos_get_iso;
- cmos_sensor->cmos_fps_set = cmos_fps_set;
- cmos_sensor->cmos_sensor_set_readout_direction = cmos_sensor_set_readout_direction;
- cmos_sensor->cmos_sensor_get_sensor_name = gc2053_cmos_sensor_get_sensor_name;
- // sensor初始化
- cmos_sensor->cmos_isp_sensor_init = gc2053_isp_sensor_init;
- cmos_sensor->cmos_isp_awb_init = gc2053_cmos_isp_awb_init;
- cmos_sensor->cmos_isp_colors_init = gc2053_cmos_isp_colors_init;
- cmos_sensor->cmos_isp_denoise_init = gc2053_cmos_isp_denoise_init;
- cmos_sensor->cmos_isp_eris_init = gc2053_cmos_isp_eris_init;
- cmos_sensor->cmos_isp_fesp_init = gc2053_cmos_isp_fesp_init;
- cmos_sensor->cmos_isp_enhance_init = gc2053_cmos_isp_enhance_init;
- cmos_sensor->cmos_isp_ae_init = gc2053_cmos_isp_ae_init;
- cmos_sensor->cmos_isp_sys_init = gc2053_cmos_isp_sys_init;
- cmos_sensor->cmos_isp_awb_run = NULL;
- cmos_sensor->cmos_isp_colors_run = NULL;
- cmos_sensor->cmos_isp_denoise_run = NULL;
- cmos_sensor->cmos_isp_eris_run = NULL;
- cmos_sensor->cmos_isp_fesp_run = NULL;
- cmos_sensor->cmos_isp_enhance_run = NULL;
- cmos_sensor->cmos_isp_ae_run = NULL;
- cmos_sensor->cmos_isp_sharp_run = NULL;
- cmos_sensor->cmos_isp_get_gamma_table = gc2053_cmos_isp_get_gamma_table;
- cmos_sensor->cmos_isp_get_denoise_table = gc2053_cmos_isp_get_denoise_table;
- cmos_sensor->cmos_isp_get_eris_auto_table = gc2053_cmos_isp_get_eris_auto_table; // 自动模式
- cmos_sensor->cmos_isp_get_eris_man_table = gc2053_cmos_isp_get_eris_man_table; // 手动模式
- cmos_sensor->cmos_isp_get_crosstalk_table = gc2053_cmos_isp_get_crosstalk_table;
- cmos_sensor->cmos_isp_get_fpn_table = NULL;
- cmos_sensor->cmos_isp_get_lsc_table = NULL;
- cmos_sensor->cmos_isp_get_satuation_table = gc2053_cmos_isp_get_satuation_table;
- cmos_sensor->cmos_isp_get_enhance_table = gc2053_cmos_isp_get_enhance_table;
- cmos_sensor->cmos_isp_get_sharp_table = gc2053_cmos_isp_get_sharp_table;
- cmos_sensor->cmos_isp_get_ae_table = gc2053_cmos_isp_get_ae_table;
- cmos_sensor->cmos_isp_get_demosaic_table = gc2053_cmos_isp_get_demosaic_table;
- return 0;
- }
- EXPORT_SYMBOL(isp_init_cmos_sensor);
- static int
- gc2053_probe(struct i2c_client *client, const struct i2c_device_id *id)
- {
- i2c_client = client;
- of_property_read_u32(client->dev.of_node, "sensor-fps", &isp_sensor_fps);
-
- return 0;
- }
- static int
- gc2053_remove(struct i2c_client *client)
- {
- return 0;
- }
- static const struct of_device_id gc2053_of_match[] = {
- { .compatible = "arkmicro,gc2053" },
- { }
- };
- MODULE_DEVICE_TABLE(of, gc2053_of_match);
- static const struct i2c_device_id gc2053_id[] = {
- { "gc2053", 0 },
- { }
- };
- MODULE_DEVICE_TABLE(i2c, gc2053_id);
- static struct i2c_driver gc2053_driver = {
- .driver = {
- .name = "gc2053",
- .of_match_table = of_match_ptr(gc2053_of_match),
- },
- .probe = gc2053_probe,
- .remove = gc2053_remove,
- .id_table = gc2053_id,
- };
- module_i2c_driver(gc2053_driver);
- MODULE_DESCRIPTION("Sensor gc2053 driver");
- MODULE_AUTHOR("Sim");
- MODULE_LICENSE("GPL v2");
|