Commit bf58cdff authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

Merge branch 'pm-devfreq'

* pm-devfreq: (23 commits)
  PM / devfreq: remove compiler error with module governors (2)
  PM / devfreq: Fix return value in devfreq_remove_governor()
  PM / devfreq: Fix incorrect argument in error message
  PM / devfreq: missing rcu_read_lock() added for find_device_opp()
  PM / devfreq: remove compiler error when a governor is module
  PM / devfreq: exynos4_bus.c: Fixed an alignment of the func call args.
  PM / devfreq: Add sysfs node to expose available governors
  PM / devfreq: allow sysfs governor node to switch governor
  PM / devfreq: governors: add GPL module license and allow module build
  PM / devfreq: map devfreq drivers to governor using name
  PM / devfreq: register governors with devfreq framework
  PM / devfreq: provide hooks for governors to be registered
  PM / devfreq: export update_devfreq
  PM / devfreq: Add sysfs node for representing frequency transition information.
  PM / devfreq: Add sysfs node to expose available frequencies
  PM / devfreq: documentation cleanups for devfreq header
  PM / devfreq: Use devm_* functions in exynos4_bus.c
  PM / devfreq: make devfreq_class static
  PM / devfreq: fix sscanf handling for writable sysfs entries
  PM / devfreq: kernel-doc typo corrections
  ...
parents 6b728f1a 6dcdd8e3
Loading
Loading
Loading
Loading
+36 −8
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ What: /sys/class/devfreq/.../governor
Date:		September 2011
Contact:	MyungJoo Ham <myungjoo.ham@samsung.com>
Description:
		The /sys/class/devfreq/.../governor shows the name of the
		The /sys/class/devfreq/.../governor show or set the name of the
		governor used by the corresponding devfreq object.

What:		/sys/class/devfreq/.../cur_freq
@@ -19,15 +19,16 @@ Date: September 2011
Contact:	MyungJoo Ham <myungjoo.ham@samsung.com>
Description:
		The /sys/class/devfreq/.../cur_freq shows the current
		frequency of the corresponding devfreq object.
		frequency of the corresponding devfreq object. Same as
		target_freq when get_cur_freq() is not implemented by
		devfreq driver.

What:		/sys/class/devfreq/.../central_polling
Date:		September 2011
Contact:	MyungJoo Ham <myungjoo.ham@samsung.com>
What:		/sys/class/devfreq/.../target_freq
Date:		September 2012
Contact:	Rajagopal Venkat <rajagopal.venkat@linaro.org>
Description:
		The /sys/class/devfreq/.../central_polling shows whether
		the devfreq ojbect is using devfreq-provided central
		polling mechanism or not.
		The /sys/class/devfreq/.../target_freq shows the next governor
		predicted target frequency of the corresponding devfreq object.

What:		/sys/class/devfreq/.../polling_interval
Date:		September 2011
@@ -43,6 +44,17 @@ Description:
		(/sys/class/devfreq/.../central_polling is 0), this value
		may be useless.

What:		/sys/class/devfreq/.../trans_stat
Date:		October 2012
Contact:	MyungJoo Ham <myungjoo.ham@samsung.com>
Descrtiption:
		This ABI shows the statistics of devfreq behavior on a
		specific device. It shows the time spent in each state and
		the number of transitions between states.
		In order to activate this ABI, the devfreq target device
		driver should provide the list of available frequencies
		with its profile.

What:		/sys/class/devfreq/.../userspace/set_freq
Date:		September 2011
Contact:	MyungJoo Ham <myungjoo.ham@samsung.com>
@@ -50,3 +62,19 @@ Description:
		The /sys/class/devfreq/.../userspace/set_freq shows and
		sets the requested frequency for the devfreq object if
		userspace governor is in effect.

What:		/sys/class/devfreq/.../available_frequencies
Date:		October 2012
Contact:	Nishanth Menon <nm@ti.com>
Description:
		The /sys/class/devfreq/.../available_frequencies shows
		the available frequencies of the corresponding devfreq object.
		This is a snapshot of available frequencies and not limited
		by the min/max frequency restrictions.

What:		/sys/class/devfreq/.../available_governors
Date:		October 2012
Contact:	Nishanth Menon <nm@ti.com>
Description:
		The /sys/class/devfreq/.../available_governors shows
		currently available governors in the system.
+4 −4
Original line number Diff line number Diff line
@@ -30,7 +30,7 @@ if PM_DEVFREQ
comment "DEVFREQ Governors"

config DEVFREQ_GOV_SIMPLE_ONDEMAND
	bool "Simple Ondemand"
	tristate "Simple Ondemand"
	help
	  Chooses frequency based on the recent load on the device. Works
	  similar as ONDEMAND governor of CPUFREQ does. A device with
@@ -39,7 +39,7 @@ config DEVFREQ_GOV_SIMPLE_ONDEMAND
	  values to the governor with data field at devfreq_add_device().

config DEVFREQ_GOV_PERFORMANCE
	bool "Performance"
	tristate "Performance"
	help
	  Sets the frequency at the maximum available frequency.
	  This governor always returns UINT_MAX as frequency so that
@@ -47,7 +47,7 @@ config DEVFREQ_GOV_PERFORMANCE
	  at any time.

config DEVFREQ_GOV_POWERSAVE
	bool "Powersave"
	tristate "Powersave"
	help
	  Sets the frequency at the minimum available frequency.
	  This governor always returns 0 as frequency so that
@@ -55,7 +55,7 @@ config DEVFREQ_GOV_POWERSAVE
	  at any time.

config DEVFREQ_GOV_USERSPACE
	bool "Userspace"
	tristate "Userspace"
	help
	  Sets the frequency at the user specified one.
	  This governor returns the user configured frequency if there
+640 −277

File changed.

Preview size limit exceeded, changes collapsed.

+13 −32
Original line number Diff line number Diff line
@@ -987,7 +987,7 @@ static __devinit int exynos4_busfreq_probe(struct platform_device *pdev)
	struct device *dev = &pdev->dev;
	int err = 0;

	data = kzalloc(sizeof(struct busfreq_data), GFP_KERNEL);
	data = devm_kzalloc(&pdev->dev, sizeof(struct busfreq_data), GFP_KERNEL);
	if (data == NULL) {
		dev_err(dev, "Cannot allocate memory.\n");
		return -ENOMEM;
@@ -1012,22 +1012,18 @@ static __devinit int exynos4_busfreq_probe(struct platform_device *pdev)
		err = -EINVAL;
	}
	if (err)
		goto err_regulator;
		return err;

	data->vdd_int = regulator_get(dev, "vdd_int");
	data->vdd_int = devm_regulator_get(dev, "vdd_int");
	if (IS_ERR(data->vdd_int)) {
		dev_err(dev, "Cannot get the regulator \"vdd_int\"\n");
		err = PTR_ERR(data->vdd_int);
		goto err_regulator;
		return PTR_ERR(data->vdd_int);
	}
	if (data->type == TYPE_BUSF_EXYNOS4x12) {
		data->vdd_mif = regulator_get(dev, "vdd_mif");
		data->vdd_mif = devm_regulator_get(dev, "vdd_mif");
		if (IS_ERR(data->vdd_mif)) {
			dev_err(dev, "Cannot get the regulator \"vdd_mif\"\n");
			err = PTR_ERR(data->vdd_mif);
			regulator_put(data->vdd_int);
			goto err_regulator;

			return PTR_ERR(data->vdd_mif);
		}
	}

@@ -1035,8 +1031,7 @@ static __devinit int exynos4_busfreq_probe(struct platform_device *pdev)
	if (IS_ERR(opp)) {
		dev_err(dev, "Invalid initial frequency %lu kHz.\n",
			exynos4_devfreq_profile.initial_freq);
		err = PTR_ERR(opp);
		goto err_opp_add;
		return PTR_ERR(opp);
	}
	data->curr_opp = opp;

@@ -1045,30 +1040,20 @@ static __devinit int exynos4_busfreq_probe(struct platform_device *pdev)
	busfreq_mon_reset(data);

	data->devfreq = devfreq_add_device(dev, &exynos4_devfreq_profile,
					   &devfreq_simple_ondemand, NULL);
	if (IS_ERR(data->devfreq)) {
		err = PTR_ERR(data->devfreq);
		goto err_opp_add;
	}
					   "simple_ondemand", NULL);
	if (IS_ERR(data->devfreq))
		return PTR_ERR(data->devfreq);

	devfreq_register_opp_notifier(dev, data->devfreq);

	err = register_pm_notifier(&data->pm_notifier);
	if (err) {
		dev_err(dev, "Failed to setup pm notifier\n");
		goto err_devfreq_add;
		devfreq_remove_device(data->devfreq);
		return err;
	}

	return 0;
err_devfreq_add:
	devfreq_remove_device(data->devfreq);
err_opp_add:
	if (data->vdd_mif)
		regulator_put(data->vdd_mif);
	regulator_put(data->vdd_int);
err_regulator:
	kfree(data);
	return err;
}

static __devexit int exynos4_busfreq_remove(struct platform_device *pdev)
@@ -1077,10 +1062,6 @@ static __devexit int exynos4_busfreq_remove(struct platform_device *pdev)

	unregister_pm_notifier(&data->pm_notifier);
	devfreq_remove_device(data->devfreq);
	regulator_put(data->vdd_int);
	if (data->vdd_mif)
		regulator_put(data->vdd_mif);
	kfree(data);

	return 0;
}
+17 −0
Original line number Diff line number Diff line
@@ -18,7 +18,24 @@

#define to_devfreq(DEV)	container_of((DEV), struct devfreq, dev)

/* Devfreq events */
#define DEVFREQ_GOV_START			0x1
#define DEVFREQ_GOV_STOP			0x2
#define DEVFREQ_GOV_INTERVAL			0x3
#define DEVFREQ_GOV_SUSPEND			0x4
#define DEVFREQ_GOV_RESUME			0x5

/* Caution: devfreq->lock must be locked before calling update_devfreq */
extern int update_devfreq(struct devfreq *devfreq);

extern void devfreq_monitor_start(struct devfreq *devfreq);
extern void devfreq_monitor_stop(struct devfreq *devfreq);
extern void devfreq_monitor_suspend(struct devfreq *devfreq);
extern void devfreq_monitor_resume(struct devfreq *devfreq);
extern void devfreq_interval_update(struct devfreq *devfreq,
					unsigned int *delay);

extern int devfreq_add_governor(struct devfreq_governor *governor);
extern int devfreq_remove_governor(struct devfreq_governor *governor);

#endif /* _GOVERNOR_H */
Loading