Commit a75e1c73 authored by Chanwoo Choi's avatar Chanwoo Choi
Browse files

extcon: Fix indentation coding style to improve readability

parent a33411b2
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -27,16 +27,16 @@

/**
 * struct adc_jack_data - internal data for adc_jack device driver
 * @edev        - extcon device.
 * @cable_names - list of supported cables.
 * @num_cables  - size of cable_names.
 * @adc_conditions       - list of adc value conditions.
 * @num_conditions       - size of adc_conditions.
 * @irq         - irq number of attach/detach event (0 if not exist).
 * @handling_delay      - interrupt handler will schedule extcon event
 * @edev:		extcon device.
 * @cable_names:	list of supported cables.
 * @num_cables:		size of cable_names.
 * @adc_conditions:	list of adc value conditions.
 * @num_conditions:	size of adc_conditions.
 * @irq:		irq number of attach/detach event (0 if not exist).
 * @handling_delay:	interrupt handler will schedule extcon event
 *			handling at handling_delay jiffies.
 * @handler     - extcon event handler called by interrupt handler.
 * @chan       - iio channel being queried.
 * @handler:		extcon event handler called by interrupt handler.
 * @chan:		iio channel being queried.
 */
struct adc_jack_data {
	struct extcon_dev edev;
+13 −13
Original line number Diff line number Diff line
@@ -227,7 +227,6 @@ int extcon_update_state(struct extcon_dev *edev, u32 mask, u32 state)
		edev->state |= state & mask;

		raw_notifier_call_chain(&edev->nh, old_state, edev);

		/* This could be in interrupt handler */
		prop_buf = (char *)get_zeroed_page(GFP_ATOMIC);
		if (prop_buf) {
@@ -340,7 +339,8 @@ EXPORT_SYMBOL_GPL(extcon_get_cable_state);
/**
 * extcon_set_cable_state_() - Set the status of a specific cable.
 * @edev:		the extcon device that has the cable.
 * @index:	cable index that can be retrieved by extcon_find_cable_index().
 * @index:		cable index that can be retrieved by
 *			extcon_find_cable_index().
 * @cable_state:	the new cable status. The default semantics is
 *			true: attached / false: detached.
 */
+35 −32
Original line number Diff line number Diff line
@@ -76,8 +76,8 @@ struct extcon_cable;

/**
 * struct extcon_dev - An extcon device represents one external connector.
 * @name:	The name of this extcon device. Parent device name is used
 *		if NULL.
 * @name:		The name of this extcon device. Parent device name is
 *			used if NULL.
 * @supported_cable:	Array of supported cable names ending with NULL.
 *			If supported_cable is NULL, cable name related APIs
 *			are disabled.
@@ -95,7 +95,7 @@ struct extcon_cable;
 *			status of the extcon device.
 * @dev:		Device of this extcon. Do not provide at register-time.
 * @state:		Attach/detach state of this extcon. Do not provide at
 *		register-time
 *			register-time.
 * @nh:			Notifier for the state change events from this extcon
 * @entry:		To support list of extcon devices so that users can search
 *			for extcon devices based on the extcon name.
@@ -111,26 +111,27 @@ struct extcon_cable;
 * are overwritten by register function.
 */
struct extcon_dev {
	/* --- Optional user initializing data --- */
	/* Optional user initializing data */
	const char *name;
	const char **supported_cable;
	const u32 *mutually_exclusive;

	/* --- Optional callbacks to override class functions --- */
	/* Optional callbacks to override class functions */
	ssize_t	(*print_name)(struct extcon_dev *edev, char *buf);
	ssize_t	(*print_state)(struct extcon_dev *edev, char *buf);

	/* --- Internal data. Please do not set. --- */
	/* Internal data. Please do not set. */
	struct device *dev;
	u32		state;
	struct raw_notifier_head nh;
	struct list_head entry;
	spinlock_t lock; /* could be called by irq handler */
	int max_supported;
	spinlock_t lock;	/* could be called by irq handler */
	u32 state;

	/* /sys/class/extcon/.../cable.n/... */
	struct device_type extcon_dev_type;
	struct extcon_cable *cables;

	/* /sys/class/extcon/.../mutually_exclusive/... */
	struct attribute_group attr_g_muex;
	struct attribute **attrs_muex;
@@ -160,8 +161,10 @@ struct extcon_cable {
/**
 * struct extcon_specific_cable_nb - An internal data for
 *				     extcon_register_interest().
 * @internal_nb:	a notifier block bridging extcon notifier and cable notifier.
 * @user_nb:	user provided notifier block for events from a specific cable.
 * @internal_nb:	A notifier block bridging extcon notifier
 *			and cable notifier.
 * @user_nb:		user provided notifier block for events from
 *			a specific cable.
 * @cable_index:	the target cable.
 * @edev:		the target extcon device.
 * @previous_value:	the saved previous event value.
+21 −21
Original line number Diff line number Diff line
@@ -20,10 +20,10 @@

/**
 * struct adc_jack_cond - condition to use an extcon state
 * @state      - the corresponding extcon state (if 0, this struct denotes
 *             the last adc_jack_cond element among the array)
 * @min_adc    - min adc value for this condition
 * @max_adc    - max adc value for this condition
 * @state:		the corresponding extcon state (if 0, this struct
 *			denotes the last adc_jack_cond element among the array)
 * @min_adc:		min adc value for this condition
 * @max_adc:		max adc value for this condition
 *
 * For example, if { .state = 0x3, .min_adc = 100, .max_adc = 200}, it means
 * that if ADC value is between (inclusive) 100 and 200, than the cable 0 and
@@ -40,16 +40,16 @@ struct adc_jack_cond {

/**
 * struct adc_jack_pdata - platform data for adc jack device.
 * @name       - name of the extcon device. If null, "adc-jack" is used.
 * @consumer_channel - Unique name to identify the channel on the consumer
 * @name:		name of the extcon device. If null, "adc-jack" is used.
 * @consumer_channel:	Unique name to identify the channel on the consumer
 *			side. This typically describes the channels used within
 *			the consumer. E.g. 'battery_voltage'
 * @cable_names        - array of cable names ending with null.
 * @adc_contitions     - array of struct adc_jack_cond conditions ending
 * @cable_names:	array of cable names ending with null.
 * @adc_contitions:	array of struct adc_jack_cond conditions ending
 *			with .state = 0 entry. This describes how to decode
 *			adc values into extcon state.
 * @irq_flags  - irq flags used for the @irq
 * @handling_delay_ms  - in some devices, we need to read ADC value some
 * @irq_flags:		irq flags used for the @irq
 * @handling_delay_ms:	in some devices, we need to read ADC value some
 *			milli-seconds after the interrupt occurs. You may
 *			describe such delays with @handling_delay_ms, which
 *			is rounded-off by jiffies.
@@ -57,10 +57,10 @@ struct adc_jack_cond {
struct adc_jack_pdata {
	const char *name;
	const char *consumer_channel;
	/*
	 * The last entry should be NULL
	 */

	/* The last entry should be NULL */
	const char **cable_names;

	/* The last entry's state should be 0 */
	struct adc_jack_cond *adc_conditions;

+8 −8
Original line number Diff line number Diff line
@@ -25,14 +25,14 @@

/**
 * struct gpio_extcon_platform_data - A simple GPIO-controlled extcon device.
 * @name	The name of this GPIO extcon device.
 * @gpio	Corresponding GPIO.
 * @debounce	Debounce time for GPIO IRQ in ms.
 * @irq_flags	IRQ Flags (e.g., IRQF_TRIGGER_LOW).
 * @state_on	print_state is overriden with state_on if attached. If Null,
 *		default method of extcon class is used.
 * @state_off	print_state is overriden with state_on if detached. If Null,
 *		default method of extcon class is used.
 * @name:		The name of this GPIO extcon device.
 * @gpio:		Corresponding GPIO.
 * @debounce:		Debounce time for GPIO IRQ in ms.
 * @irq_flags:		IRQ Flags (e.g., IRQF_TRIGGER_LOW).
 * @state_on:		print_state is overriden with state_on if attached.
 *			If NULL, default method of extcon class is used.
 * @state_off:		print_state is overriden with state_on if detached.
 *			If NUll, default method of extcon class is used.
 *
 * Note that in order for state_on or state_off to be valid, both state_on
 * and state_off should be not NULL. If at least one of them is NULL,