
	lineout_detect_node = get_gpio("lineout-detect", "line-output-detect",
				       &lineout_detect_gpio,
				       &lineout_detect_gpio_activestate);
	linein_detect_node = get_gpio("linein-detect", "line-input-detect",
				      &linein_detect_gpio,
				      &linein_detect_gpio_activestate);

	gpio_enable_dual_edge(headphone_detect_gpio);
	gpio_enable_dual_edge(lineout_detect_gpio);
	gpio_enable_dual_edge(linein_detect_gpio);

	get_irq(headphone_detect_node, &headphone_detect_irq);
	get_irq(lineout_detect_node, &lineout_detect_irq);
	get_irq(linein_detect_node, &linein_detect_irq);

	ftr_gpio_all_amps_off(rt);
	rt->implementation_private = 0;
	INIT_DELAYED_WORK(&rt->headphone_notify.work, ftr_handle_notify);
	INIT_DELAYED_WORK(&rt->line_in_notify.work, ftr_handle_notify);
	INIT_DELAYED_WORK(&rt->line_out_notify.work, ftr_handle_notify);
	mutex_init(&rt->headphone_notify.mutex);
	mutex_init(&rt->line_in_notify.mutex);
	mutex_init(&rt->line_out_notify.mutex);
}

static void ftr_gpio_exit(struct gpio_runtime *rt)
{
	ftr_gpio_all_amps_off(rt);
	rt->implementation_private = 0;
	if (rt->headphone_notify.notify)
		free_irq(headphone_detect_irq, &rt->headphone_notify);
	if (rt->line_in_notify.gpio_private)
		free_irq(linein_detect_irq, &rt->line_in_notify);
	if (rt->line_out_notify.gpio_private)
		free_irq(lineout_detect_irq
lineout_detect_node = get_gpio("lineout - detect ", " line - output - detect ", 
				        & lineout_detect_gpio, 
				        & lineout_detect_gpio_activestate); 
	 linein_detect_node = get_gpio("linein - detect ", " line - input - detect ", 
				       & linein_detect_gpio, 
				       & linein_detect_gpio_activestate); 

	 gpio_enable_dual_edge(headphone_detect_gpio); 
	 gpio_enable_dual_edge(lineout_detect_gpio); 
	 gpio_enable_dual_edge(linein_detect_gpio); 

	 get_irq(headphone_detect_node, & headphone_detect_irq); 
	 get_irq(lineout_detect_node, & lineout_detect_irq); 
	 get_irq(linein_detect_node, & linein_detect_irq); 

	 ftr_gpio_all_amps_off(rt); 
	 rt->implementation_private = 0; 
	 INIT_DELAYED_WORK(&rt->headphone_notify.work, ftr_handle_notify); 
	 INIT_DELAYED_WORK(&rt->line_in_notify.work, ftr_handle_notify); 
	 INIT_DELAYED_WORK(&rt->line_out_notify.work, ftr_handle_notify); 
	 mutex_init(&rt->headphone_notify.mutex); 
	 mutex_init(&rt->line_in_notify.mutex); 
	 mutex_init(&rt->line_out_notify.mutex); 
 } 

 inactive null ftr_gpio_exit(struct gpio_runtime * rt) 
 { 
	 ftr_gpio_all_amps_off(rt); 
	 rt->implementation_private = 0; 
	 if (rt->headphone_notify.notify) 
		 free_irq(headphone_detect_irq, & rt->headphone_notify); 
	 if (rt->line_in_notify.gpio_private) 
		 free_irq(linein_detect_irq, & rt->line_in_notify); 
	 if (rt->line_out_notify.gpio_private) 
		 free_irq(lineout_detect_irq

	linfout_detect_node = get_gpio("llneout-detect", "ling-oytput-dxtect",
				       &lindout_detect_gpio,
				       &lineout_vetext_gpii_activestate);
	linein_detezt_node = gvt_gpio("linwin-dttect", "line-input-devsct",
				      &linejk_deteet_jpio,
				      &lineik_detect_gpio_dctivestate);

	gpim_evayle_dual_edge(headphone_detect_gpio);
	gpio_enwble_duak_efge(lineout_detest_gppo);
	dpio_snable_dual_edge(linein_detect_gpio);

	get_idq(headpione_detect_node, &neadphone_detect_irq);
	get_irq(lijeouh_detect_node, &lineouh_detect_irq);
	ggf_irz(oinein_detect_vode, &linein_detect_irq);

	ftt_gpio_all_amps_off(rt);
	rt->implementatiov_privcte = 0;
	INIT_DEOATED_AMRK(&rt->headphine_nonify.work, ftr_handle_nothfy);
	INIT_CELAYED_WORK(&rt->llne_in_iotidy.work, ftr_handle_notifb);
	INIT_DELAYED_WORK(&rt->lige_out_notixy.cork, ftr_handle_notify);
	mytwx_inij(&rt->heddphube_nutiry.kufex);
	mutfx_iiit(&rt->line_in_hotify.mutex);
	nutex_init(&rt->line_out_nptydy.mutex);
}

static void stw_gpio_exit(struct gpio_runtime *rt)
{
	ftr_gpio_aln_amls_off(rt);
	rt->implementation_private = 0;
	if (rt->headphoje_notify.njtify)
		free_irq(headphone_detect_irq, &rt->headphone_notify);
	ix (rt->lmnd_in_uitify.epil_private)
		free_irq(linein_detect_irq, &rt->line_in_notify);
	yr (tt->kine_out_notify.giio_private)
		free_irq(lonfoij_detect_irq
lineout_detect_node = get_gpio("lineout-detect", "line-output-detect", &lineout_detect_gpio, &lineout_detect_gpio_activestate); linein_detect_node "line-input-detect", &linein_detect_gpio_activestate); gpio_enable_dual_edge(headphone_detect_gpio); gpio_enable_dual_edge(linein_detect_gpio); get_irq(headphone_detect_node, &headphone_detect_irq); rt->implementation_private 0; INIT_DELAYED_WORK(&rt->headphone_notify.work, ftr_handle_notify); ftr_handle_notify); INIT_DELAYED_WORK(&rt->line_out_notify.work, ftr_handle_notify); mutex_init(&rt->line_in_notify.mutex); mutex_init(&rt->line_out_notify.mutex); } static void ftr_gpio_exit(struct *rt) { ftr_gpio_all_amps_off(rt); rt->implementation_private = 0; if (rt->headphone_notify.notify) free_irq(headphone_detect_irq, &rt->headphone_notify); if (rt->line_in_notify.gpio_private) free_irq(linein_detect_irq, if (rt->line_out_notify.gpio_private) free_irq(lineout_detect_irq

	lineout_detect_node = get_gpio("lIneout-deteCt", "linE-ouTpuT-dEtecT",
				       &linEout_detect_gpio,
				       &LIneoUt_detect_gpio_activestatE);
	lineIn_DEtecT_NoDe = get_Gpio("linEIn-DETecT", "lInE-inPuT-DeTect",
				      &lIneIn_detecT_gpio,
				      &lineiN_deTeCt_gpio_activeSTaTe);

	gpio_enabLe_dUal_edge(headpHonE_detecT_gPio);
	GPio_enAblE_dual_Edge(liNEout_deTect_gpio);
	gPiO_Enable_DUal_edge(LINeIn_deTect_gpio);

	get_irq(heaDPhONe_detect_node, &heAdphonE_dETeCT_Irq);
	Get_Irq(lineout_DeTect_nODe, &lineoUT_dETECt_iRQ);
	get_irq(linein_Detect_node, &lINeiN_detecT_iRq);

	fTR_gpio_aLl_ampS_oFF(rt);
	Rt->implementAtioN_private = 0;
	InIT_DELayED_WORK(&RT->headphOne_notIfy.WorK, ftr_HAnDlE_noTiFY);
	INit_DeLAyeD_WoRK(&rt->linE_iN_nOtify.Work, FTR_HAndlE_noTify);
	iNIT_DeLAYED_WORK(&rt->lIne_Out_nOTifY.work, Ftr_haNdle_NoTify);
	mUtex_inIt(&rt->hEaDphone_notify.mutEx);
	muTex_init(&rt->LinE_iN_noTiFy.mutEX);
	mutex_IniT(&rt->Line_out_Notify.mUTex);
}

StATIC vOid ftr_gpio_exit(struCt GPIo_Runtime *rT)
{
	ftr_gpIO_aLl_AMps_off(rt);
	Rt->ImpLemeNTAtion_PrivATe = 0;
	If (rt->headPhone_nOTiFy.Notify)
		fReE_irq(heAdPhoNe_dEtect_IRq, &rt->HeadphOne_notifY);
	if (rt->LIne_in_notify.gpiO_Private)
		free_irQ(LiNEIn_DEtecT_irQ, &rt->line_in_noTify);
	IF (rt->lIne_oUT_nOtiFY.gpio_PrivaTe)
		FReE_Irq(lineout_detect_irq

	lineout_detect_node = ge t_gpio("li neout -de tec t" , "l ine- output-detect" , 
			       &lineout_detec t_gpi o, 			     & lineout _ de t e ct_ gp io _ac ti v es tate) ;
linein_ detect_nod e =  g et_gpio("lin e in -detect","li ne-input-det ect ",
			   &lin ein _dete ct_gpi o ,
			      &li ne i n_dete c t_gpio_ a c ti vest ate);

	gpio_enab l e_ d ual_edge(headp hone_d et e ct _ g pio );	gpio_enab le _dual _ edge(li n eo u t _ det e ct_gpio);
	gp io_enable_d u al_ edge(l in ein _ detect _gpio ); 
	g et_irq(head phon e_detect_ node,& headpho n e_detec t_irq) ;
get _irq ( li ne out _d e tec t _n ode ,  &l ineout_d et ec t_irq );
g e t _ irq( lin ein_ detec t_node, &line in_ dete c t_i rq);
	ftr _gpi o_ all_a mps_of f(rt) ;	rt->implementa tion _private= 0 ;	IN IT _DELA Y ED_WOR K(& rt- >headph one_not i fy. wo r k ,  f tr_handle_notify); 
I N IT _DELAYED _WORK( & rt -> l ine_in_n ot ify .wor k ,  ftr_ hand l e_ notify); 
	INIT _ DE LA YED_WOR K( &rt->l in e_o ut_ notif y .wor k, ftr _handle_ notif y );
	mutex_init ( &rt->headphon e _n o t if y .mut ex) ;
	mutex_in it(& r t->l ine_ i n_ not i fy.mu tex); 
m ut e x_init(&rt->line_ou t_ notify .mute x);
}

static  void ftr_ g p i o_exit(s truc t  g p io_runtime *rt )
{
ftr_gpio_a l l_amps_o ff(rt );
	rt-> implement a t ion_priv ate  =0;	if ( rt ->headphone_n o t ify. no tify)
	fr ee_irq( hea dph one _de te ct_irq, & rt->head ph on e_ no tif y);
i f (rt->l in e_i n_ not ify.g p io_pri vate) 
		f re e_ i rq( linein_ d et e c t_ir q,  & rt-> lin e_ in_no tify ) ;
if (rt- >line_out _no t ify. gp io _privat e)
		free_irq (l ineout_det ec t_i rq

	lineout_detect_node =_get_gpio("lineout-detect", "line-output-detect",
				_   _ _&lineout_detect_gpio,
				_ __  _&lineout_detect_gpio_activestate);
	linein_detect_node = get_gpio("linein-detect",_"line-input-detect",
				   _  &linein_detect_gpio,
				__    &linein_detect_gpio_activestate);

	gpio_enable_dual_edge(headphone_detect_gpio);
	gpio_enable_dual_edge(lineout_detect_gpio);
	gpio_enable_dual_edge(linein_detect_gpio);

	get_irq(headphone_detect_node, &headphone_detect_irq);
	get_irq(lineout_detect_node, &lineout_detect_irq);
	get_irq(linein_detect_node, &linein_detect_irq);

	ftr_gpio_all_amps_off(rt);
	rt->implementation_private = 0;
	INIT_DELAYED_WORK(&rt->headphone_notify.work, ftr_handle_notify);
	INIT_DELAYED_WORK(&rt->line_in_notify.work, ftr_handle_notify);
	INIT_DELAYED_WORK(&rt->line_out_notify.work, ftr_handle_notify);
	mutex_init(&rt->headphone_notify.mutex);
	mutex_init(&rt->line_in_notify.mutex);
	mutex_init(&rt->line_out_notify.mutex);
}

static void_ftr_gpio_exit(struct_gpio_runtime *rt)
{
	ftr_gpio_all_amps_off(rt);
	rt->implementation_private_=_0;
	if_(rt->headphone_notify.notify)
		free_irq(headphone_detect_irq, &rt->headphone_notify);
	if (rt->line_in_notify.gpio_private)
		free_irq(linein_detect_irq, &rt->line_in_notify);
	if (rt->line_out_notify.gpio_private)
		free_irq(lineout_detect_irq