# 
# Copyright (C) 2011 Arnold Schulz
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk


PKG_NAME:=hbxntpower
PKG_VERSION:=0.2
PKG_RELEASE:=1



include $(INCLUDE_DIR)/package.mk



define KernelPackage/hbxntpower
  SUBMENU:=Other modules
  TITLE:=HorstBox power handler for ISDN S0 bus
# *Example* DEPENDS:= @(!(TARGET_ps3||TARGET_pxcab)||BROKEN)
  DEPENDS:= @TARGET_ixp4xx
  FILES:=$(PKG_BUILD_DIR)/hbxntpower.ko
  AUTOLOAD:=$(call AutoLoad,20,hbxntpower)
# *Example* URL:="http://my.server.org/hbxntpower"
  MAINTAINER:=Arnold Schulz <theosch@gmx.net>
endef

define KernelPackage/hbxntpower/description
  Driver for the voice board (called 'Horst') of D-Link's HorstBox Professional.
  Used for enabling/disabling/overload watching of the board's power supply
  for connected ISDN phones.

  ISDN phones can be powered via the ISDN S0 bus, thereby saving an extra power
  supply on every phone. For this end the HorstBox can provide power on the ISDN
  connector labeled as 'S0 int'.

  Note that this module is not an ISDN driver. It is solely responsible for
  managing the power offered to connected phones.

endef



include $(INCLUDE_DIR)/kernel-defaults.mk



define Build/Prepare
	mkdir -p $(PKG_BUILD_DIR)
	cp src/hbxntpower-$(PKG_VERSION)/Makefile.openwrt $(PKG_BUILD_DIR)/Makefile
	cp src/hbxntpower-$(PKG_VERSION)/hbxntpower.c     $(PKG_BUILD_DIR)/
endef



define Build/Compile
	$(MAKE) $(KERNEL_MAKEOPTS) SUBDIRS="$(PKG_BUILD_DIR)" modules
endef



$(eval $(call KernelPackage,hbxntpower))

