Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

capebus: Add nixie cape support #6

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions arch/arm/boot/dts/am335x-bone-common.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,18 @@
>;
};

bone_nixie_cape_led_pins: pinmux_bone_nixie_cape_led_pins {
pinctrl-single,pins = <
0x1a4 0x17 /* mcasp0_fsr.gpio3_19, OUTPUT_PULLUP | MODE7 */
>;
};

bone_nixie_cape_pins: pinmux_bone_nixie_cape_pins {
pinctrl-single,pins = <
0x4c 0x06 /* gpmc_a3.ehrpwm1b, OMAP_MUX_MODE6 | AM33XX_PIN_OUTPUT */
>;
};

bone_geiger_cape_pins: pinmux_bone_geiger_cape_pins {
pinctrl-single,pins = <
0x48 0x06 /* gpmc_a2.ehrpwm1a, OMAP_MUX_MODE6 | AM33XX_PIN_OUTPUT */
Expand Down Expand Up @@ -267,6 +279,10 @@
compatible = "bone-generic-cape";
};

bone_nixie_cape: cape@6 {
compatible = "bone-nixie-cape";
};

/* overrides; no EEPROM (prototyping) */
// override@3 {
// compatible = "bone-capebus-slot-override";
Expand All @@ -286,6 +302,17 @@
// /* TODO: Add the rest */
// };

/* overrides; no EEPROM (prototyping) */
// override@1 {
// compatible = "bone-capebus-slot-override";
// slot = <1>;
// board-name = "Nixie Cape";
// version = "00A0";
// manufacturer = "Ranostay Industries";
// /* TODO; Add the rest */
// };

/* overrides; no EEPROM (prototyping) */
// override@1 {
// compatible = "bone-capebus-slot-override";
// slot = <1>;
Expand Down Expand Up @@ -480,6 +507,55 @@
};
};

&bone_nixie_cape {
board-name = "Nixie Cape";

/* note that these can't be versioned.... */
pinctrl-names = "default";
pinctrl-0 = <&bone_nixie_cape_pins>;

pwms = <&ehrpwm1 1 500000 0>;
pwm-names = "bone-nixie-cape";

pwm-frequency = <9250>; /* 9.250KHz */
pwm-duty-cycle = <35>; /* 35% */

gpio-leds {
compatible = "gpio-leds";
pinctrl-names = "default";
pinctrl-0 = <&bone_nixie_cape_led_pins>;

geiger-led0 {
label = "nixie:green:usr0";
gpios = <&gpio4 19 0>;
linux,default-trigger = "nixie-run";
default-state = "off";
};
};

spi1-devices {
compatible = "spi-dt";

#address-cells = <1>;
#size-cells = <0>;

parent = <&spi1>;

vfd@0 {
compatible = "bone-spi-vfd,max6921";

spi-max-frequency = <4000000>;
reg = <0>;
refresh-rate = <5>; /* in milliseconds */

digits-idx = <0x07 0x00 0x06 0x01 0x05 0x02 0x03 0x04 0x08>;
digits-mask = <0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xc0>;

segments-idx = <0x09 0x12 0x0c 0x0b 0xd 0x13 0x11 0x0a>;
};
};
};

&bone_geiger_cape {
board-name = "Geiger Cape";

Expand Down
6 changes: 6 additions & 0 deletions drivers/capebus/boards/capebus-bone-generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ static const struct bone_capebus_generic_device_data gendevs[] = {
{ .compatible = "spi-dt", }, { },
},
.units = 0, /* no limit */
}, {
.name = "spi-vfd",
.of_match = (const struct of_device_id []) {
{ .compatible = "spi-vfd", }, { },
},
.units = 0, /* no limit */
}
};

Expand Down
13 changes: 13 additions & 0 deletions drivers/capebus/capes/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,16 @@ config CAPEBUS_BONE_GEIGER
default n
help
"Select this to enable a driver for the geiger cape"

config CAPEBUS_BONE_NIXIE
tristate "Beaglebone Nixie cape driver"
depends on CAPEBUS_BONE_CONTROLLER
select CAPEBUS_SPI_VFD
default n
help
"Select this to enable a driver for the nixie cape"

config CAPEBUS_SPI_VFD
bool
depends on CAPEBUS_BONE_NIXIE
default y
2 changes: 2 additions & 0 deletions drivers/capebus/capes/Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
obj-$(CONFIG_CAPEBUS_BONE_GENERIC) += bone-generic-cape.o
obj-$(CONFIG_CAPEBUS_BONE_GEIGER) += bone-geiger-cape.o
obj-$(CONFIG_CAPEBUS_BONE_NIXIE) += bone-nixie-cape.o
obj-$(CONFIG_CAPEBUS_SPI_VFD) += bone-spi-vfd.o
Loading