Commit 6fd7f2bb authored by Enric Balletbo i Serra's avatar Enric Balletbo i Serra Committed by Lee Jones
Browse files

mfd / platform: cros_ec: Move device sysfs attributes to its own driver



The entire way how cros debugfs attibutes are created is broken.
cros_ec_sysfs should be its own driver and its attributes should be
associated with the sysfs driver not the mfd driver.

The patch also adds the sysfs documentation.

Signed-off-by: default avatarEnric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: default avatarGuenter Roeck <groeck@chromium.org>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 6fce0a2c
Loading
Loading
Loading
Loading
+32 −0
Original line number Diff line number Diff line
What:		/sys/class/chromeos/<ec-device-name>/flashinfo
Date:		August 2015
KernelVersion:	4.2
Description:
		Show the EC flash information.

What:		/sys/class/chromeos/<ec-device-name>/kb_wake_angle
Date:		March 2018
KernelVersion:	4.17
Description:
		Control the keyboard wake lid angle. Values are between
		0 and 360. This file will also show the keyboard wake lid
		angle by querying the hardware.

What:		/sys/class/chromeos/<ec-device-name>/reboot
Date:		August 2015
KernelVersion:	4.2
Description:
		Tell the EC to reboot in various ways. Options are:
		"cancel": Cancel a pending reboot.
		"ro": Jump to RO without rebooting.
		"rw": Jump to RW without rebooting.
		"cold": Cold reboot.
		"disable-jump": Disable jump until next reboot.
		"hibernate": Hibernate the EC.
		"at-shutdown": Reboot after an AP shutdown.

What:		/sys/class/chromeos/<ec-device-name>/version
Date:		August 2015
KernelVersion:	4.2
Description:
		Show the information about the EC software and hardware.
+0 −1
Original line number Diff line number Diff line
@@ -215,7 +215,6 @@ config MFD_CROS_EC
config MFD_CROS_EC_CHARDEV
        tristate "Chrome OS Embedded Controller userspace device interface"
        depends on MFD_CROS_EC
        select CROS_EC_CTL
        ---help---
          This driver adds support to talk with the ChromeOS EC from userspace.

+1 −6
Original line number Diff line number Diff line
@@ -34,15 +34,9 @@
#define CROS_MAX_DEV 128
static int ec_major;

static const struct attribute_group *cros_ec_groups[] = {
	&cros_ec_attr_group,
	NULL,
};

static struct class cros_class = {
	.owner          = THIS_MODULE,
	.name           = "chromeos",
	.dev_groups     = cros_ec_groups,
};

/* Basic communication */
@@ -396,6 +390,7 @@ static const struct mfd_cell cros_usbpd_charger_cells[] = {
static const struct mfd_cell cros_ec_platform_cells[] = {
	{ .name = "cros-ec-debugfs" },
	{ .name = "cros-ec-lightbar" },
	{ .name = "cros-ec-sysfs" },
	{ .name = "cros-ec-vbc" },
};

+11 −3
Original line number Diff line number Diff line
@@ -49,9 +49,6 @@ config CHROMEOS_TBMC
	  To compile this driver as a module, choose M here: the
	  module will be called chromeos_tbmc.

config CROS_EC_CTL
        tristate

config CROS_EC_I2C
	tristate "ChromeOS Embedded Controller (I2C)"
	depends on MFD_CROS_EC && I2C
@@ -144,4 +141,15 @@ config CROS_EC_DEBUGFS
	  To compile this driver as a module, choose M here: the
	  module will be called cros_ec_debugfs.

config CROS_EC_SYSFS
	tristate "ChromeOS EC control and information through sysfs"
	depends on MFD_CROS_EC_CHARDEV && SYSFS
	default MFD_CROS_EC_CHARDEV
	help
	  This option exposes some sysfs attributes to control and get
	  information from ChromeOS EC.

	  To compile this driver as a module, choose M here: the
	  module will be called cros_ec_sysfs.

endif # CHROMEOS_PLATFORMS
+1 −2
Original line number Diff line number Diff line
@@ -3,8 +3,6 @@
obj-$(CONFIG_CHROMEOS_LAPTOP)		+= chromeos_laptop.o
obj-$(CONFIG_CHROMEOS_PSTORE)		+= chromeos_pstore.o
obj-$(CONFIG_CHROMEOS_TBMC)		+= chromeos_tbmc.o
cros_ec_ctl-objs			:= cros_ec_sysfs.o
obj-$(CONFIG_CROS_EC_CTL)		+= cros_ec_ctl.o
obj-$(CONFIG_CROS_EC_I2C)		+= cros_ec_i2c.o
obj-$(CONFIG_CROS_EC_SPI)		+= cros_ec_spi.o
cros_ec_lpcs-objs			:= cros_ec_lpc.o cros_ec_lpc_reg.o
@@ -15,3 +13,4 @@ obj-$(CONFIG_CROS_KBD_LED_BACKLIGHT) += cros_kbd_led_backlight.o
obj-$(CONFIG_CROS_EC_LIGHTBAR)		+= cros_ec_lightbar.o
obj-$(CONFIG_CROS_EC_VBC)		+= cros_ec_vbc.o
obj-$(CONFIG_CROS_EC_DEBUGFS)		+= cros_ec_debugfs.o
obj-$(CONFIG_CROS_EC_SYSFS)		+= cros_ec_sysfs.o
Loading