svn commit: r250734 - stable/9/sys/x86/cpufreq

Hiren Panchasara hiren at FreeBSD.org
Fri May 17 04:09:05 UTC 2013


Author: hiren
Date: Fri May 17 04:09:04 2013
New Revision: 250734
URL: http://svnweb.freebsd.org/changeset/base/250734

Log:
  MFC: r250487
  
  Adding a detach method to p4tcc driver.
  
  PR:		118739
  Submitted by:	Dan Lukes <dan at obluda.cz> (earlier version)
  Reviewed by:	jhb
  Approved by:	sbruno (mentor)

Modified:
  stable/9/sys/x86/cpufreq/p4tcc.c
Directory Properties:
  stable/9/   (props changed)
  stable/9/sys/   (props changed)

Modified: stable/9/sys/x86/cpufreq/p4tcc.c
==============================================================================
--- stable/9/sys/x86/cpufreq/p4tcc.c	Fri May 17 03:55:03 2013	(r250733)
+++ stable/9/sys/x86/cpufreq/p4tcc.c	Fri May 17 04:09:04 2013	(r250734)
@@ -73,6 +73,7 @@ static int	p4tcc_features(driver_t *driv
 static void	p4tcc_identify(driver_t *driver, device_t parent);
 static int	p4tcc_probe(device_t dev);
 static int	p4tcc_attach(device_t dev);
+static int	p4tcc_detach(device_t dev);
 static int	p4tcc_settings(device_t dev, struct cf_setting *sets,
 		    int *count);
 static int	p4tcc_set(device_t dev, const struct cf_setting *set);
@@ -84,6 +85,7 @@ static device_method_t p4tcc_methods[] =
 	DEVMETHOD(device_identify,	p4tcc_identify),
 	DEVMETHOD(device_probe,		p4tcc_probe),
 	DEVMETHOD(device_attach,	p4tcc_attach),
+	DEVMETHOD(device_detach,	p4tcc_detach),
 
 	/* cpufreq interface */
 	DEVMETHOD(cpufreq_drv_set,	p4tcc_set),
@@ -213,6 +215,24 @@ p4tcc_attach(device_t dev)
 }
 
 static int
+p4tcc_detach(device_t dev)
+{
+	struct cf_setting set;
+	int error;
+
+	error = cpufreq_unregister(dev);
+	if (error)
+		return (error);
+
+	/*
+	 * Before we finish detach, switch to Automatic mode.
+	 */
+	set.freq = 10000;
+	p4tcc_set(dev, &set);
+	return(0);
+}
+
+static int
 p4tcc_settings(device_t dev, struct cf_setting *sets, int *count)
 {
 	struct p4tcc_softc *sc;


More information about the svn-src-stable-9 mailing list