Skip to content

Commit

Permalink
Remove unused mce.ini configuration items
Browse files Browse the repository at this point in the history
During the evolution of mce it has repeatedly happened that code for
some features has disappeared, but the related config items, macros
and in some cases even variables remain littering the source tree.

Remove all ini-file based configuration items, defines and variables
that are not actually used in the code.

[mce] Remove unused mce.ini configuration items. Fixes JB#25531
  • Loading branch information
spiiroin committed Mar 13, 2015
1 parent 8f49f5c commit 9545acf
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 461 deletions.
6 changes: 6 additions & 0 deletions .depend
Expand Up @@ -172,15 +172,19 @@ mce-dsme.pic.o:\

mce-fbdev.o:\
mce-fbdev.c\
datapipe.h\
mce-fbdev.h\
mce-hybris.h\
mce-log.h\
mce.h\

mce-fbdev.pic.o:\
mce-fbdev.c\
datapipe.h\
mce-fbdev.h\
mce-hybris.h\
mce-log.h\
mce.h\

mce-gconf.o:\
mce-gconf.c\
Expand Down Expand Up @@ -478,6 +482,7 @@ modules/camera.o:\
mce-conf.h\
mce-io.h\
mce.h\
tklock.h\
modules/camera.h\

modules/camera.pic.o:\
Expand All @@ -486,6 +491,7 @@ modules/camera.pic.o:\
mce-conf.h\
mce-io.h\
mce.h\
tklock.h\
modules/camera.h\

modules/cpu-keepalive.o:\
Expand Down
8 changes: 0 additions & 8 deletions inifiles/legacy.ini
Expand Up @@ -7,14 +7,6 @@
# 1 to enable, 0 to disable
CameraPopoutUnlock=1

[ALS]

# Policy for brightness level step-downs
#
# direct - Switch to next brightness level immediately
# unblank - Only step down the brightness after a blank->unblank cycle
StepDownPolicy=direct

[LEDPatternMonoRX34]

# Patterns used for the RX-34 hardware;
Expand Down
67 changes: 0 additions & 67 deletions inifiles/mce.ini
Expand Up @@ -27,73 +27,6 @@ Modules=radiostates;filter-brightness-als;display;keypad;led;battery-statefs;ina
# ignore - remain in soft poweroff when a charger is connected
ChargerPolicyConnect=ignore

[TKLock]

# Blank immediately instead of dim before blank when tklock is enabled
#
# 1 to blank immediately, 0 to dim before blanking
BlankImmediately=1

# Dim immediately instead of having a timeout before dimming
# when tklock is enabled
#
# 1 to dim immediately, 0 to wait for timeout
DimImmediately=1

# Timeout before dimming
#
# Timeout in seconds, default 3
DimDelay=3

# Policy for touchscreen interrupts
#
# 2 - only listen for double-tap after blanking
# | this behaviour can further be customised using GConf,
# | including achieving the same behaviour as setting this to 1 instead,
# | this it's recommended to leave this value at 2
# 1 - disable immediately
# 0 - wait until display is blanked
DisableTSImmediately=2

# Policy for keypad interrupts
#
# 2 - leave keypad interrupts on even after blanking
# (used to support pass-through of +/-)
# 1 - disable interrupts immediately
# 0 to wait until display is blanked
DisableKPImmediately=2

# Inhibit autolock when keyboard slide is open
#
# 1 - allow autolock when the keyboard slide is open
# 0 - inhibit autolock when the keyboard slide is open
AutolockWhenSlideOpen=0

# Inhibit proximity sensor based locking during calls
# when keyboard slide is open
#
# 1 - allow proximity lock when the keyboard slide is open
# 0 - inhibit proximity lock when the keyboard slide is open
ProximityLockWhenSlideOpen=0

# Always enable tklock when closing keyboard slide
#
# 1 - lock when keyboard slide is closed
# 0 - only enable lock when keyboard slide is closed if it was enabled
# before opening the slide and there has been no input
AlwaysLockOnSlideClose=0

# Unlock the tklock if the lens cover is opened
#
# 1 to enable, 0 to disable
LensCoverUnlock=1

# Trigger unlock screen with volume keys
# Note: you need to set DisableKPImmediately=2 for this to work
#
# 1 to enable, 0 to disable
TriggerUnlockScreenWithVolumeKeys=0

[KeyPad]

# Timeout before disabling keyboard backlight when unused
Expand Down
1 change: 1 addition & 0 deletions modules/camera.c
Expand Up @@ -24,6 +24,7 @@
#include "../mce.h"
#include "../mce-io.h"
#include "../mce-conf.h"
#include "../tklock.h"

#include <string.h>

Expand Down
8 changes: 0 additions & 8 deletions modules/camera.h
Expand Up @@ -39,14 +39,6 @@
/** Value for the camera in popped in state */
#define MCE_CAMERA_POPPED_IN "inactive"

#ifndef MCE_CONF_TKLOCK_GROUP
/** Name of Touchscreen/Keypad lock configuration group */
# define MCE_CONF_TKLOCK_GROUP "TKLock"
#endif

/** Name of configuration key for camera popout unlock */
#define MCE_CONF_CAMERA_POPOUT_UNLOCK "CameraPopoutUnlock"

/** Default fallback setting for the touchscreen/keypad autolock */
#define DEFAULT_CAMERA_POPOUT_UNLOCK TRUE /* FALSE / TRUE */

Expand Down
182 changes: 0 additions & 182 deletions modules/filter-brightness-als.h
Expand Up @@ -25,9 +25,6 @@

#include <glib.h>

/** Path to get the display manufacturer */
#define DISPLAY_HARDWARE_REVISION_PATH "/sys/devices/omapdss/display0/hw_revision"

/** Name of common group in color profiles conf file */
#define MCE_CONF_COMMON_GROUP "Common"

Expand All @@ -37,107 +34,6 @@
/** Name of the hardcoded color profile */
#define COLOR_PROFILE_ID_HARDCODED "hardcoded"

/** Color profile group prefix */
#define MCE_COLOR_PROFILE_GROUP_PREFIX "Display-"

/** Name of ALS configuration group */
#define MCE_CONF_ALS_GROUP "ALS"

/** Name of the configuration key for the brightness level step-down policy */
#define MCE_CONF_STEP_DOWN_POLICY "StepDownPolicy"

/* Paths for Avago APDS990x (QPDS-T900) ALS */

/** Device path for Avago ALS */
#define ALS_DEVICE_PATH_AVAGO "/dev/apds990x0"

#ifndef APDS990X_ALS_SATURATED
/** Read is saturated */
# define APDS990X_ALS_SATURATED 0x1
#endif

#ifndef APDS990X_ALS_UPDATED
/** Sensor has up to date data */
# define APDS990X_ALS_UPDATED 0x4
#endif

/** Struct for the Avago data */
struct avago_als {
/** The filtered ambient light in lux */
guint32 lux; /* 10x scale */
/** The raw ambient light in lux */
guint32 lux_raw; /* 10x scale */
/** The filtered proximity */
guint16 ps;
/** The raw proximity */
guint16 ps_raw;
/** The sensor status */
guint16 status;
} __attribute__((packed));

/** Base path to the Avago ALS */
#define ALS_PATH_AVAGO "/sys/class/misc/apds990x0/device"

/** Path to the first calibration point for the Avago ALS */
#define ALS_CALIB_PATH_AVAGO ALS_PATH_AVAGO "/als_calib"

/** ALS threshold range for the Avago ALS */
#define ALS_THRESHOLD_RANGE_PATH_AVAGO ALS_PATH_AVAGO "/als_threshold_range"

/** Maximun threshold value for the Avago ALS */
#define ALS_THRESHOLD_MAX_AVAGO 655350

/* Paths for the Dipro (BH1770GLC/SFH7770) ALS */

/** Device path for the Dipro ALS */
#define ALS_DEVICE_PATH_DIPRO "/dev/bh1770glc_als"

/** Struct for the Dipro data */
struct dipro_als {
/** The ambient light in lux */
guint16 lux;
} __attribute__((packed));

/** Base path to the Dipro ALS */
#define ALS_PATH_DIPRO "/sys/class/misc/bh1770glc_als/device"

/** Path to the first calibration point for the Dipro ALS */
#define ALS_CALIB_PATH_DIPRO ALS_PATH_DIPRO "/als_calib"

/** ALS threshold range for the Dipro ALS */
#define ALS_THRESHOLD_RANGE_PATH_DIPRO ALS_PATH_DIPRO "/als_thres_range"

/** Maximun threshold value for the Dipro ALS */
#define ALS_THRESHOLD_MAX_DIPRO 65535

/* Paths for the TSL2563 ALS */

/** Base path to the TSL2563 ALS */
#define ALS_PATH_TSL2563 "/sys/class/i2c-adapter/i2c-2/2-0029"

/** Path to the TSL2563 ALS lux value */
#define ALS_LUX_PATH_TSL2563 ALS_PATH_TSL2563 "/lux"

/** Path to the first calibration point for the TSL2563 ALS */
#define ALS_CALIB0_PATH_TSL2563 ALS_PATH_TSL2563 "/calib0"

/** Path to the second calibration point for the TSL2563 ALS */
#define ALS_CALIB1_PATH_TSL2563 ALS_PATH_TSL2563 "/calib1"

/* Paths for the TSL2562 ALS */

/** Base path to the TSL2562 ALS */
#define ALS_PATH_TSL2562 "/sys/devices/platform/i2c_omap.2/i2c-0/0-0029"

/** Path to the TSL2562 ALS lux value */
#define ALS_LUX_PATH_TSL2562 ALS_PATH_TSL2562 "/lux"

/** Path to the first calibration point for the TSL2562 ALS */
#define ALS_CALIB0_PATH_TSL2562 ALS_PATH_TSL2562 "/calib0"

/** Path to the second calibration point for the TSL2562 ALS */
#define ALS_CALIB1_PATH_TSL2562 ALS_PATH_TSL2562 "/calib1"

/** Default value for als enabled settings */
#define ALS_ENABLED_DEFAULT TRUE

Expand All @@ -150,84 +46,6 @@ struct dipro_als {
#define ALS_SAMPLE_TIME_MIN 50
#define ALS_SAMPLE_TIME_MAX 1000

/** Default ALS polling frequency when the display is on */
#define ALS_DISPLAY_ON_POLL_FREQ 1500 /* Milliseconds */

/** Default ALS polling frequency when the display is dimmed */
#define ALS_DISPLAY_DIM_POLL_FREQ 5000 /* Milliseconds */

/**
* Default ALS polling frequency when the display is off
*
* 0 disables polling completely;
* with hardware that supports power saving
* in a better way, 60000 should be used
*/
#define ALS_DISPLAY_OFF_POLL_FREQ 0 /* Milliseconds */

/**
* Define this to re-initialise the median filter on display blank;
* this will trigger a re-read on wakeup
*/
#define ALS_DISPLAY_OFF_FLUSH_FILTER

/** Brightness stepdown delay, secs */
#define ALS_BRIGHTNESS_STEPDOWN_DELAY 5

/** Window size for the median filter */
#define MEDIAN_FILTER_WINDOW_SIZE 5

/** Sysinfo identifier for the ALS calibration values */
#define ALS_CALIB_IDENTIFIER "/device/als_calib"

/** Number of ranges in ALS profile */
#define ALS_RANGES 11

/** Path to display manager */
#define DISPLAY_MANAGER_PATH "/sys/devices/platform/omapdss/manager0"

/** Colour phase adjustment enable path */
#define COLOUR_PHASE_ENABLE_PATH DISPLAY_MANAGER_PATH "/cpr_enable"

/** Colour phase adjustment coefficients path */
#define COLOUR_PHASE_COEFFICIENTS_PATH DISPLAY_MANAGER_PATH "/cpr_coef"

/** ALS profile */
typedef struct {
/** Lower and upper bound for each brightness range */
const gint range[ALS_RANGES][2];
/** Brightness in % + possible HBM boost (boost level * 256) */
const gint value[ALS_RANGES + 1];
} als_profile_struct;

/** Colour phase adjustment matrix */
typedef struct {
/**
* Lower and upper bound for each brightness range,
* followed by high brightness mode level
*/
gint range[3];
/**
* Colour phase adjustment matrix for the specified range;
* 9 space separated integers
*/
const gchar *const coefficients;
} cpa_profile_struct;

/** Colour profile */
typedef struct {
/**
* Color phase adjustment matrix
*/
cpa_profile_struct *profiles;
/**
* Name of profile
*/
gchar *name;
} cpa_profile_entry;

/* Colour phase adjustment matrices in filter-brightness-als.c */

/** ALS profiles */
typedef enum {
ALS_PROFILE_COUNT = 21, /**< Number of profiles */
Expand Down

0 comments on commit 9545acf

Please sign in to comment.