iopsys-ramips: Add led indication and buttons

/etc/init.d/peripheral_manager stop //peripheral manager must be stopped

echo 0-255 > /sys/class/leds/ex400\:green\:status/brightness
echo 0-255 > /sys/class/leds/ex400\:red\:status/brightness
echo 0-255 > /sys/class/leds/ex400:green:wps/brightness

i2cget -y 0 0x2b 0x01
9512_wps (0x08)
9512_5g (0x04)
9512_2g (0x02)

i2cget -y 0 0x2b 0x02
proximity detected (0x80)

i2cset -y 0 0x2b 0x0d 0xF0 (all)
Internet_red 	(0x10)
Internet_green	(0x20)
Wireless_5 	(0x40)
Wireless_24 	(0x80)
Signed-off-by: Bartlomiej Grzeskowiak's avatarBartlomiej Grzeskowiak <bartlomiej.grzeskowiak@iopsys.eu>
parent 0157dcb8
config board 'board'
# Specs
option hasAdsl '0'
option hasVdsl '0'
option hasVoice '0'
option hasDect '0'
option hasUsb '1'
option hasCatv '0'
option hasSfp '0'
option hasWifi '1'
# Ethernet
option ethernetPorts '2'
option ethernetPortNames 'LAN WAN'
option ethernetPortOrder 'eth0.1 eth0.2'
option ethernetSwitchPortOrder '1 0'
option ethernetLanPorts 'eth0.1'
option ethernetWanPort 'eth0.2'
# I2C
option sx9512_i2c_device '/dev/i2c-0'
option sx9512_i2c_address 2b
option sx9512_irq_pin 10
option sx9512_active_capsense_channels 0f
option sx9512_active_led_channels ff
# Switch config
config switch switch
option ports '1:lan 0:wan 6t@eth0 6t@eth0'
############### mapping function button to driver button
config button RESET
list button gpio_reset
option minpress 5000
option hotplug resetbutton
option enable 1
###############################################################################
#
# Button config, start
#
############### gpio buttons, driver config
config gpio_button gpio_buttons
list buttons gpio_reset
config gpio_button gpio_reset
option addr 18
option mode linux
option active low
############### sx9512, i2c buttons, driver config
config 9512_button 9512_buttons
list buttons 9512_wps
list buttons 9512_wifi_2g
list buttons 9512_wifi_5g
list buttons 9512_touch_near
list buttons 9512_touch_far
config 9512_button 9512_wifi_2g
option addr 1
config 9512_button 9512_wifi_5g
option addr 2
config 9512_button 9512_wps
option addr 3
config 9512_button 9512_touch_near
option addr 8
config 9512_button 9512_touch_far
option addr 9
#
# Button config , end
#
###############################################################################
###############################################################################
#
# Led config, start
#
############### 9512 led, driver config
config 9512_led 9512_leds
list leds Internet_green
list leds Internet_red
list leds Wireless_24
list leds Wireless_5
config 9512_led Internet_green
option addr 5
config 9512_led Internet_red
option addr 4
config 9512_led Wireless_24
option addr 7
config 9512_led Wireless_5
option addr 6
############### gpio led, driver config
config gpio_led gpio_leds
list leds Status_green
list leds Status_red
list leds WPS_green
config gpio_led Status_green
option addr 8
option active low
option mode linux
config gpio_led Status_red
option addr 11
option active hi
option mode linux
config 9512_led WPS_green
option addr 12
option active low
option mode linux
############### mapping led function to driver led
config led_map led_map
list press_indicator led_wifi_2g
list press_indicator led_wifi_5g
list press_indicator led_wps
list press_indicator led_internet
list functions 'wifi_2g'
list functions 'wifi_5g'
list functions wps
list functions status
list functions internet
# dimming turn leds off unless above cutof level
option dimming_level off
option dimming_on 5
list dimming wifi
list dimming wps
list dimming status
list dimming internet
config led_map 'led_wifi_2g'
list led_action_ok 'Wireless_24 = ON'
list led_action_off 'Wireless_24 = OFF'
list led_action_notice 'Wireless_24 = FLASH_SLOW'
list led_action_alert 'Wireless_24 = FLASH_SLOW'
list led_action_error 'Wireless_24 = FLASH_FAST'
config led_map 'led_wifi_5g'
list led_action_ok 'Wireless_5 = ON'
list led_action_off 'Wireless_5 = OFF'
list led_action_notice 'Wireless_5 = FLASH_SLOW'
list led_action_alert 'Wireless_5 = FLASH_SLOW'
list led_action_error 'Wireless_5 = FLASH_FAST'
config led_map led_wps
list led_action_ok 'WPS_green=ON'
list led_action_off 'WPS_green=OFF'
list led_action_notice 'WPS_green=FLASH_SLOW'
list led_action_alert 'WPS_green=FLASH_FAST'
list led_action_error 'WPS_green=OFF'
config led_map led_status
list led_action_ok 'Status_green = ON'
list led_action_ok 'Status_red = OFF'
list led_action_off 'Status_green = OFF'
list led_action_off 'Status_red = OFF'
list led_action_notice 'Status_green = FLASH_SLOW'
list led_action_notice 'Status_red = OFF'
list led_action_alert 'Status_green = OFF'
list led_action_alert 'Status_red = FLASH_SLOW'
list led_action_error 'Status_green = OFF'
list led_action_error 'Status_red = FLASH_FAST'
config led_map led_internet
list led_action_ok 'Internet_green = ON'
list led_action_ok 'Internet_red = OFF'
list led_action_off 'Internet_green = OFF'
list led_action_off 'Internet_red = OFF'
list led_action_notice 'Internet_green = FLASH_SLOW'
list led_action_notice 'Internet_red = OFF'
list led_action_alert 'Internet_green = OFF'
list led_action_alert 'Internet_red = FLASH_SLOW'
list led_action_error 'Internet_green = OFF'
list led_action_error 'Internet_red = ON'
list led_action_eok 'Internet_green = ON'
list led_action_eok 'Internet_red = ON'
...@@ -3,3 +3,4 @@ CONFIG_PACKAGE_hostapd=y ...@@ -3,3 +3,4 @@ CONFIG_PACKAGE_hostapd=y
CONFIG_PACKAGE_hostapd-utils=y CONFIG_PACKAGE_hostapd-utils=y
CONFIG_PACKAGE_wpa-cli=y CONFIG_PACKAGE_wpa-cli=y
CONFIG_PACKAGE_wpa-supplicant=y CONFIG_PACKAGE_wpa-supplicant=y
CONFIG_PACKAGE_kmod-i2c-core=y
...@@ -10,10 +10,6 @@ ...@@ -10,10 +10,6 @@
model = "EX400"; model = "EX400";
aliases { aliases {
led-boot = &led_sys;
led-failsafe = &led_sys;
led-running = &led_sys;
led-upgrade = &led_sys;
ethernet0 = &ethernet; ethernet0 = &ethernet;
}; };
...@@ -28,6 +24,7 @@ ...@@ -28,6 +24,7 @@
palmbus: palmbus@1E000000 { palmbus: palmbus@1E000000 {
i2c: i2c@900 { i2c: i2c@900 {
clock-frequency = <10000>;
status = "okay"; status = "okay";
pcf8563: rtc@51 { pcf8563: rtc@51 {
...@@ -40,31 +37,18 @@ ...@@ -40,31 +37,18 @@
leds { leds {
compatible = "gpio-leds"; compatible = "gpio-leds";
status_green {
power { label = "ex400:green:status";
label = "pbr-m1:blue:power"; gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
gpios = <&gpio0 31 GPIO_ACTIVE_LOW>;
default-state = "on";
}; };
status_red {
led_sys: sys { label = "ex400:red:status";
label = "pbr-m1:blue:sys"; gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>;
gpios = <&gpio1 0 GPIO_ACTIVE_LOW>; default-state = "on";
};
internet {
label = "pbr-m1:blue:internet";
gpios = <&gpio0 29 GPIO_ACTIVE_LOW>;
};
wlan2g {
label = "pbr-m1:blue:wlan2g";
gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
}; };
wps {
wlan5g { label = "ex400:green:wps";
label = "pbr-m1:blue:wlan5g"; gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
gpios = <&gpio0 28 GPIO_ACTIVE_LOW>;
}; };
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment