From 786d06742a379df667b0fd14df0b2dbc045f312c Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Sat, 14 Aug 2021 14:05:32 +0100 Subject: Remove Samsung YP-Z5 port It has only a couple GB of onboard flash storage with no storage driver in Rockbox. It hasn't seen any meaningful development since its initial commit, it's not on the build farm, and the bootloader build is broken by other refactoring. Change-Id: Idd9e3c46fac9b96f416ce444182f97a50770e747 --- firmware/SOURCES | 11 - firmware/export/config.h | 4 - firmware/export/config/samsungypz5.h | 204 -------------- .../target/arm/imx233/samsung-ypz5/audio-target.h | 31 --- .../arm/imx233/samsung-ypz5/backlight-target.h | 28 -- .../arm/imx233/samsung-ypz5/backlight-ypz5.c | 149 ----------- .../target/arm/imx233/samsung-ypz5/button-target.h | 59 ----- .../target/arm/imx233/samsung-ypz5/button-ypz5.c | 273 ------------------- .../target/arm/imx233/samsung-ypz5/debug-ypz5.c | 29 -- .../arm/imx233/samsung-ypz5/fmradio-target.h | 31 --- .../target/arm/imx233/samsung-ypz5/ftl-target.h | 39 --- .../target/arm/imx233/samsung-ypz5/lcd-target.h | 25 -- firmware/target/arm/imx233/samsung-ypz5/lcd-ypz5.c | 295 --------------------- .../arm/imx233/samsung-ypz5/powermgmt-target.h | 37 --- .../arm/imx233/samsung-ypz5/powermgmt-ypz5.c | 48 ---- firmware/target/arm/imx233/touchscreen-imx233.c | 27 -- 16 files changed, 1290 deletions(-) delete mode 100644 firmware/export/config/samsungypz5.h delete mode 100644 firmware/target/arm/imx233/samsung-ypz5/audio-target.h delete mode 100644 firmware/target/arm/imx233/samsung-ypz5/backlight-target.h delete mode 100644 firmware/target/arm/imx233/samsung-ypz5/backlight-ypz5.c delete mode 100644 firmware/target/arm/imx233/samsung-ypz5/button-target.h delete mode 100644 firmware/target/arm/imx233/samsung-ypz5/button-ypz5.c delete mode 100644 firmware/target/arm/imx233/samsung-ypz5/debug-ypz5.c delete mode 100644 firmware/target/arm/imx233/samsung-ypz5/fmradio-target.h delete mode 100644 firmware/target/arm/imx233/samsung-ypz5/ftl-target.h delete mode 100644 firmware/target/arm/imx233/samsung-ypz5/lcd-target.h delete mode 100644 firmware/target/arm/imx233/samsung-ypz5/lcd-ypz5.c delete mode 100644 firmware/target/arm/imx233/samsung-ypz5/powermgmt-target.h delete mode 100644 firmware/target/arm/imx233/samsung-ypz5/powermgmt-ypz5.c (limited to 'firmware') diff --git a/firmware/SOURCES b/firmware/SOURCES index 8d7232f206..e2f7e26f84 100644 --- a/firmware/SOURCES +++ b/firmware/SOURCES @@ -1450,17 +1450,6 @@ target/arm/imx233/sansa-fuzeplus/debug-fuzeplus.c target/arm/imx233/sansa-fuzeplus/powermgmt-fuzeplus.c #endif -#ifdef SAMSUNG_YPZ5 -target/arm/imx233/samsung-ypz5/backlight-ypz5.c -target/arm/imx233/samsung-ypz5/lcd-ypz5.c -target/arm/imx233/samsung-ypz5/button-ypz5.c -target/arm/imx233/samsung-ypz5/debug-ypz5.c -target/arm/imx233/samsung-ypz5/powermgmt-ypz5.c -#ifndef BOOTLOADER -target/arm/imx233/fmradio-imx233.c -#endif -#endif - #ifdef SANSA_CLIPZIP target/arm/as3525/sansa-clipzip/lcd-clipzip.c target/arm/as3525/sansa-clipzip/button-clipzip.c diff --git a/firmware/export/config.h b/firmware/export/config.h index 702b821856..383677865f 100644 --- a/firmware/export/config.h +++ b/firmware/export/config.h @@ -145,7 +145,6 @@ #define MA_PAD 56 #define SONY_NWZ_PAD 57 #define CREATIVE_ZEN_PAD 58 -#define SAMSUNG_YPZ5_PAD 59 #define IHIFI_PAD 60 #define SAMSUNG_YPR1_PAD 61 #define SAMSUNG_YH92X_PAD 62 @@ -264,7 +263,6 @@ #define LCD_CREATIVEZENMOZAIC 56 /* as used by the Creative ZEN Mozaic (FGD0801) */ #define LCD_ILI9342C 57 /* another type of lcd used by HiFi E.T MA9/MA8 */ #define LCD_CREATIVEZENV 58 /* as used by the Creative Zen V (Plus) */ -#define LCD_SAMSUNGYPZ5 59 /* as used by Samsung YP-Z5 */ #define LCD_IHIFI 60 /* as used by IHIFI 760/960 */ #define LCD_CREATIVEZENXFISTYLE 61 /* as used by Creative Zen X-Fi Style */ #define LCD_SAMSUNGYPR1 62 /* as used by Samsung YP-R1 */ @@ -543,8 +541,6 @@ Lyre prototype 1 */ #include "config/sonynwze370.h" #elif defined(SONY_NWZE360) #include "config/sonynwze360.h" -#elif defined(SAMSUNG_YPZ5) -#include "config/samsungypz5.h" #elif defined(IHIFI760) #include "config/ihifi760.h" #elif defined(IHIFI770) diff --git a/firmware/export/config/samsungypz5.h b/firmware/export/config/samsungypz5.h deleted file mode 100644 index 2af62c1cbe..0000000000 --- a/firmware/export/config/samsungypz5.h +++ /dev/null @@ -1,204 +0,0 @@ -/* - * This config file is for the Samsung YP-Z5 - */ -#define IMX233_SUBTARGET 3600 -#define IMX233_PACKAGE IMX233_BGA169 -#define IMX233_PARTITIONS IMX233_FREESCALE - -/* For Rolo and boot loader */ -#define MODEL_NUMBER 84 -#define MODEL_NAME "Samsung YP-Z5" -/* Define if boot data from bootloader has been enabled for the target */ -#define HAVE_BOOTDATA - -#define HW_SAMPR_CAPS SAMPR_CAP_ALL_48 - -/* define this if you have recording possibility */ -#define HAVE_RECORDING - -#define REC_SAMPR_CAPS SAMPR_CAP_ALL_48 - -/* Default recording levels */ -#define DEFAULT_REC_MIC_GAIN 23 -#define DEFAULT_REC_LEFT_GAIN 23 -#define DEFAULT_REC_RIGHT_GAIN 23 - -/* Define bitmask of input sources - recordable bitmask can be defined - explicitly if different */ -#define HAVE_FMRADIO_IN -#define INPUT_SRC_CAPS (SRC_CAP_MIC | SRC_CAP_FMRADIO) - - - -/* define this if you have a colour LCD */ -#define HAVE_LCD_COLOR - -#ifndef BOOTLOADER -#define HAVE_ALBUMART - -/* define this to enable bitmap scaling */ -#define HAVE_BMP_SCALING - -/* define this to enable JPEG decoding */ -#define HAVE_JPEG - -/* Define this if a programmable hotkey is mapped */ -#define HAVE_HOTKEY - -/* define this if you have access to the quickscreen */ -#define HAVE_QUICKSCREEN - -/* define this if you would like tagcache to build on this target */ -#define HAVE_TAGCACHE - -/* define this if the target has volume keys which can be used in the lists */ -#define HAVE_VOLUME_IN_LIST - -/* define this if you have LCD enable function */ -//#define HAVE_LCD_ENABLE - -/* Define this if your LCD can be put to sleep. HAVE_LCD_ENABLE - should be defined as well. -#define HAVE_LCD_SLEEP -#define HAVE_LCD_SLEEP_SETTING -*/ - -/* define this if you can flip your LCD -#define HAVE_LCD_FLIP -*/ - -/* define this if you can invert the colours on your LCD -#define HAVE_LCD_INVERT -*/ - -/* define this if you have a real-time clock */ -#define CONFIG_RTC RTC_IMX233 - -/* define this if you have a real-time clock with alarm facilities */ -#define HAVE_RTC_ALARM - -#endif /* !BOOTLOADER */ - -/* define this if you have an i.MX23 codec */ -#define HAVE_IMX233_CODEC - -#define CONFIG_TUNER TEA5767 -#define CONFIG_TUNER_XTAL 32768 - -/* There is no hardware tone control */ -#define HAVE_SW_TONE_CONTROLS - -#define CONFIG_KEYPAD SAMSUNG_YPZ5_PAD -#define HAVE_TOUCHPAD_IMX233 - -/* Define this to enable morse code input */ -#define HAVE_MORSE_INPUT - - - - -/* LCD dimensions */ -#define LCD_WIDTH 128 -#define LCD_HEIGHT 160 -/* sqrt(128^2 + 160^2) / 1.8 = 113.8 */ -#define LCD_DPI 114 -#define LCD_DEPTH 16 /* 65536 colours */ -#define LCD_PIXELFORMAT RGB565 /* rgb565 */ - -/* Define this if you have a software controlled poweroff */ -#define HAVE_SW_POWEROFF - -/* Some devices seem to be FAT16 formatted */ -#define HAVE_FAT16SUPPORT - -/* The number of bytes reserved for loadable codecs */ -#define CODEC_SIZE 0x100000 - -/* The number of bytes reserved for loadable plugins */ -#define PLUGIN_BUFFER_SIZE 0x80000 - -#define AB_REPEAT_ENABLE - -/* Define this for LCD backlight available */ -#define HAVE_BACKLIGHT -#define HAVE_BACKLIGHT_BRIGHTNESS - -/* Main LCD backlight brightness range and defaults */ -#define MIN_BRIGHTNESS_SETTING 1 -#define MAX_BRIGHTNESS_SETTING 18 -#define DEFAULT_BRIGHTNESS_SETTING 5 - -/* Which backlight fading type? */ -#define CONFIG_BACKLIGHT_FADING BACKLIGHT_FADING_SW_SETTING - -/* define this if you have a flash memory storage */ -//#define HAVE_FLASH_STORAGE - -#define CONFIG_STORAGE (STORAGE_RAMDISK) -//#define CONFIG_NAND NAND_IMX233 -//#define NUM_DRIVES 0 - -/* Extra threads: touchpad and rds */ -//#define TARGET_EXTRA_THREADS 2 - -/* todo */ -#define BATTERY_CAPACITY_DEFAULT 550 /* default battery capacity */ -#define BATTERY_CAPACITY_MIN 550 /* min. capacity selectable */ -#define BATTERY_CAPACITY_MAX 550 /* max. capacity selectable */ -#define BATTERY_CAPACITY_INC 0 /* capacity increment */ -#define BATTERY_TYPES_COUNT 1 /* only one type */ - -#define CONFIG_BATTERY_MEASURE VOLTAGE_MEASURE - -/* Charging implemented in a target-specific algorithm */ -#define CONFIG_CHARGING CHARGING_TARGET - -/* define this if the unit can be powered or charged via USB */ -#define HAVE_USB_POWER - -/* Define this if you have an IMX233*/ -#define CONFIG_CPU IMX233 - -/* Define this if you want to use the IMX233 i2c interface */ -#define CONFIG_I2C I2C_IMX233 - -/* define current usage levels (based on battery bench) */ -#define CURRENT_NORMAL 35 -#define CURRENT_BACKLIGHT 30 -#define CURRENT_RECORD CURRENT_NORMAL - -/* maximum charging current */ -#define CURRENT_MAX_CHG 200 - -/* Define this to the CPU frequency */ -#define CPU_FREQ 454000000 - -/* Type of LCD */ -#define CONFIG_LCD LCD_SAMSUNGYPZ5 - -/* Offset ( in the firmware file's header ) to the file CRC and data. These are - only used when loading the old format rockbox.e200 file */ -#define FIRMWARE_OFFSET_FILE_CRC 0x0 -#define FIRMWARE_OFFSET_FILE_DATA 0x8 - -/* USB On-the-go */ -#define CONFIG_USBOTG USBOTG_ARC - -/* enable these for the experimental usb stack */ -#define HAVE_USBSTACK -#define USB_VENDOR_ID 0x04e8 -#define USB_PRODUCT_ID 0x5041 -#define HAVE_USB_HID_MOUSE -#define HAVE_BOOTLOADER_USB_MODE - -/* Define this if you have adjustable CPU frequency */ -//#define HAVE_ADJUSTABLE_CPU_FREQ - -/* Virtual LED (icon) */ -#define CONFIG_LED LED_VIRTUAL - -#define BOOTFILE_EXT "samsung" -#define BOOTFILE "rockbox." BOOTFILE_EXT -#define BOOTDIR "/.rockbox" - -#define INCLUDE_TIMEOUT_API diff --git a/firmware/target/arm/imx233/samsung-ypz5/audio-target.h b/firmware/target/arm/imx233/samsung-ypz5/audio-target.h deleted file mode 100644 index c0bee26e45..0000000000 --- a/firmware/target/arm/imx233/samsung-ypz5/audio-target.h +++ /dev/null @@ -1,31 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2013 by Lorenzo Miori - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ****************************************************************************/ -#ifndef __audio_target__ -#define __audio_target__ - -/* MUTE_ON toggles a transistor that in turns toggles a mosfet... */ -#define IMX233_AUDIO_HP_GATE_BANK 1 -#define IMX233_AUDIO_HP_GATE_PIN 22 -#define IMX233_AUDIO_HP_GATE_INVERTED - -#define IMX233_AUDIO_COUPLING_MODE ACM_CAP - -#endif /* __audio_target__ */ diff --git a/firmware/target/arm/imx233/samsung-ypz5/backlight-target.h b/firmware/target/arm/imx233/samsung-ypz5/backlight-target.h deleted file mode 100644 index e26f83811d..0000000000 --- a/firmware/target/arm/imx233/samsung-ypz5/backlight-target.h +++ /dev/null @@ -1,28 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * - * Copyright (C) 2013 by Lorenzo Miori - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ****************************************************************************/ -#ifndef BACKLIGHT_TARGET_H -#define BACKLIGHT_TARGET_H - -bool backlight_hw_init(void); -void backlight_hw_on(void); -void backlight_hw_off(void); -void backlight_hw_brightness(int brightness); - -#endif /* BACKLIGHT_TARGET_H */ diff --git a/firmware/target/arm/imx233/samsung-ypz5/backlight-ypz5.c b/firmware/target/arm/imx233/samsung-ypz5/backlight-ypz5.c deleted file mode 100644 index b02c3a1d16..0000000000 --- a/firmware/target/arm/imx233/samsung-ypz5/backlight-ypz5.c +++ /dev/null @@ -1,149 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * - * Copyright (C) 2013 by Lorenzo Miori - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ****************************************************************************/ - -#include "config.h" -#include "system.h" -#include "lcd.h" -#include "backlight.h" -#include "backlight-target.h" -#include "pinctrl-imx233.h" - -/** - * AAT3151 Backlight Controller - */ - -/* Timings */ -#define TIME_OFF 500 -#define TIME_LOW 50 -#define TIME_HI 50 -#define TIME_LAT 500 - -/* Number of raising edges to select the particular register */ -#define D1_D4_CURRENT_E 17 -#define D1_D3_CURRENT_E 18 -#define D4_CURRENT_E 19 -#define MAX_CURRENT_E 20 -#define LOW_CURRENT_E 21 - -/* The actual register address / number */ -#define D1_D4_CURRENT 1 -#define D1_D3_CURRENT 2 -#define D4_CURRENT 3 -#define MAX_CURRENT 4 -#define LOW_CURRENT 5 - -/* Valid values for LOW_CURRENT register */ -#define MAX_CURRENT_20 1 -#define MAX_CURRENT_30 2 -#define MAX_CURRENT_15 3 -#define MAX_CURRENT_LOW_CURRENT 4 - -static int current_level = -1; - -static void create_raising_edges(int num) -{ - while (num--) - { - /* Setting a register takes a sufficient small amount of time, - * in the order of 50 ns. Thus the necessary 2 delays TIME_LOW/TIME_HI - * are not strictly necessary */ - imx233_pinctrl_set_gpio(3, 13, false); - imx233_pinctrl_set_gpio(3, 13, true); - } -} - -static void aat3151_write(int addr, int data) -{ - create_raising_edges(16 + addr); - udelay(TIME_LAT); - create_raising_edges(data); - udelay(TIME_LAT); -} - -void backlight_hw_brightness(int level) -{ - /* Don't try to reset backlight if not necessary - * Moreover this helps to avoid flickering when - * being in some screens like USB mode and - * pressing some keys / touchpad... - */ - if (current_level == level) return; - - /* Check for limits and adjust in case */ - level = MIN(MAX_BRIGHTNESS_SETTING, MAX(0, level)); - - if (level == 0) - { - /* Set pin low for a sufficient time, puts the device into low-power consumption state - * In other words backlight goes off - */ - imx233_pinctrl_set_gpio(3, 13, false); - udelay(TIME_OFF); - } - else - { - if (level > 3) { - /* This enables 16 levels of backlight */ - aat3151_write(MAX_CURRENT, MAX_CURRENT_15); - /* Set the value according Table 1 in datasheet - * For MAX_CURRENT_15, the scale is from 0 mA to 15 mA in 16 steps - */ - aat3151_write(D1_D3_CURRENT, 19 - level); - } - else { - /* This enables other 4 levels of backlight */ - aat3151_write(MAX_CURRENT, MAX_CURRENT_LOW_CURRENT); - /* Set the value according Table 1 in datasheet - * For LOW_CURRENT, there is no "real" scale. We have scattered values. - * We are interested in the last 3 -> 0.5 mA; 1 mA; 2 mA - */ - aat3151_write(LOW_CURRENT, 13 + level); - } - } - current_level = level; -} - -bool backlight_hw_init(void) -{ - imx233_pinctrl_acquire(3, 13, "backlight"); - imx233_pinctrl_set_function(3, 13, PINCTRL_FUNCTION_GPIO); - imx233_pinctrl_set_drive(3, 13, PINCTRL_DRIVE_4mA); - imx233_pinctrl_enable_gpio(3, 13, true); - imx233_pinctrl_set_gpio(3, 13, false); - return true; -} - -void backlight_hw_on(void) -{ -#ifdef HAVE_LCD_ENABLE - lcd_enable(true); /* power on lcd + visible display */ -#endif - /* restore the previous backlight level */ - backlight_hw_brightness(backlight_brightness); -} - -void backlight_hw_off(void) -{ - /* there is no real on/off but we can set to 0 brightness */ - backlight_hw_brightness(0); -#ifdef HAVE_LCD_ENABLE - lcd_enable(false); /* power off visible display */ -#endif -} diff --git a/firmware/target/arm/imx233/samsung-ypz5/button-target.h b/firmware/target/arm/imx233/samsung-ypz5/button-target.h deleted file mode 100644 index 2f94f5fb31..0000000000 --- a/firmware/target/arm/imx233/samsung-ypz5/button-target.h +++ /dev/null @@ -1,59 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2013 by Lorenzo Miori - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ****************************************************************************/ -#ifndef _BUTTON_TARGET_H_ -#define _BUTTON_TARGET_H_ - -#include - -#define HAS_BUTTON_HOLD -#define IMX233_BUTTON_LRADC_CHANNEL 0 -#define IMX233_BUTTON_LRADC_HOLD_DET BLH_GPIO -#define BLH_GPIO_BANK 0 -#define BLH_GPIO_PIN 13 - -#define IMX233_BUTTON_LRADC_CHANNEL 0 - -/* Main unit's buttons */ -#define BUTTON_POWER 0x00000001 -#define BUTTON_VOL_UP 0x00000002 -#define BUTTON_VOL_DOWN 0x00000004 -/* Directional buttons by touchpad */ -#define BUTTON_LEFT 0x00000008 -#define BUTTON_UP 0x00000010 -#define BUTTON_RIGHT 0x00000020 -#define BUTTON_DOWN 0x00000040 -#define BUTTON_SELECT 0x00000080 -#define BUTTON_BACK 0x00000100 -#define BUTTON_REW 0x00000200 -#define BUTTON_FF 0x00000400 - - -#define BUTTON_MAIN (BUTTON_VOL_UP | BUTTON_VOL_DOWN | BUTTON_POWER | BUTTON_LEFT | \ - BUTTON_UP | BUTTON_RIGHT | BUTTON_DOWN | BUTTON_SELECT | \ - BUTTON_BACK | BUTTON_REW | BUTTON_FF) - -/* Software power-off */ -#define POWEROFF_BUTTON BUTTON_POWER -#define POWEROFF_COUNT 10 - -bool button_debug_screen(void); - -#endif /* _BUTTON_TARGET_H_ */ diff --git a/firmware/target/arm/imx233/samsung-ypz5/button-ypz5.c b/firmware/target/arm/imx233/samsung-ypz5/button-ypz5.c deleted file mode 100644 index 91fe059c31..0000000000 --- a/firmware/target/arm/imx233/samsung-ypz5/button-ypz5.c +++ /dev/null @@ -1,273 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * - * Copyright (C) 2013 by Lorenzo Miori - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ****************************************************************************/ - -#include "system.h" -#include "lcd.h" -#include "string.h" -#include "kernel.h" -#include "pinctrl-imx233.h" -#include "power-imx233.h" -#include "button-lradc-imx233.h" -#include "button-target.h" -#include "button-imx233.h" - -#ifndef BOOTLOADER -#include "touchscreen.h" -#include "touchscreen-imx233.h" -#include "button.h" -#include "font.h" -#include "action.h" -#endif - -#define CHAN 0 /* ADC channel for the buttons */ -#define I_VDDIO 0 /* Mock button to define the relative voltage to compute voltage from ADC steps */ - -struct imx233_button_map_t imx233_button_map[] = -{ - [I_VDDIO] = IMX233_BUTTON_(VDDIO, VDDIO(3760), "vddio"), /* we need VDDIO for relative */ - IMX233_BUTTON_(HOLD, GPIO(0, 13), "hold"), - IMX233_BUTTON(POWER, PSWITCH(1), "power"), - IMX233_BUTTON(SELECT, PSWITCH(3), "select"), - IMX233_BUTTON(VOL_UP, LRADC_REL(CHAN, 485, I_VDDIO), "vol up"), - IMX233_BUTTON(VOL_DOWN, LRADC_REL(CHAN, 975, I_VDDIO), "vol down"), - IMX233_BUTTON(BACK, LRADC_REL(CHAN, 1521, I_VDDIO), "back"), - IMX233_BUTTON(FF, LRADC_REL(CHAN, 2000, I_VDDIO), "ff"), - IMX233_BUTTON(REW, LRADC_REL(CHAN, 2480, I_VDDIO), "rew"), - IMX233_BUTTON_(END, END(), "") -}; - -#ifndef BOOTLOADER -static int last_x = 0; -static int last_y = 0; -static bool touching = false; -#endif /* BOOTLOADER */ - -#ifndef BOOTLOADER - -/* Touchpad extra pin initialization - * Strange facts: - * 1. In the fully working sample I have, it seems that pins - * must be all set to low - * 2. In the other sample without LCD, it seems (by measurement) that - * not all the pins are set to low! Actually, I still need to see if - * touchpad works in this other sample. -*/ -void touchpad_pin_setup(void) -{ - /* TX+ */ - imx233_pinctrl_acquire(0, 25, "touchpad X+ power low"); - imx233_pinctrl_set_function(0, 25, PINCTRL_FUNCTION_GPIO); - imx233_pinctrl_set_drive(0, 25, PINCTRL_DRIVE_4mA); - imx233_pinctrl_enable_gpio(0, 25, true); - - /* TY+ */ - imx233_pinctrl_acquire(0, 26, "touchpad Y+ power high"); - imx233_pinctrl_set_function(0, 26, PINCTRL_FUNCTION_GPIO); - imx233_pinctrl_set_drive(0, 26, PINCTRL_DRIVE_4mA); - imx233_pinctrl_enable_gpio(0, 26, true); - - /* TY- */ - imx233_pinctrl_acquire(1, 21, "touchpad Y- power low"); - imx233_pinctrl_set_function(1, 21, PINCTRL_FUNCTION_GPIO); - imx233_pinctrl_set_drive(1, 21, PINCTRL_DRIVE_4mA); - imx233_pinctrl_enable_gpio(1, 21, true); - - /* TX- */ - imx233_pinctrl_acquire(3, 15, "touchpad X- power high"); - imx233_pinctrl_set_function(3, 15, PINCTRL_FUNCTION_GPIO); - imx233_pinctrl_set_drive(3, 15, PINCTRL_DRIVE_4mA); - imx233_pinctrl_enable_gpio(3, 15, true); - -} -#endif /* BOOTLOADER */ - -void button_init_device(void) -{ - /* init button subsystem */ - imx233_button_init(); -#ifndef BOOTLOADER - touchpad_pin_setup(); - /* Now that is powered up, proceed with touchpad initialization */ - imx233_touchscreen_init(); - imx233_touchscreen_enable(true); -#endif /* BOOTLOADER */ -} - -/* X, Y, RadiusX, RadiusY */ -#define TOUCH_UP 2400, 1050, 650, 250 -#define TOUCH_DOWN 2057, 3320, 500, 350 -#define TOUCH_LEFT 3581, 2297, 300, 350 -#define TOUCH_RIGHT 1000, 2100, 400, 700 -#define TOUCH_CENTER 2682, 2167, 335, 276 - -bool coord_in_radius(int x, int y, int cx, int cy, int rx, int ry) -{ - return ((x >= cx - rx && x <= cx + rx) && (y >= cy - ry && y <= cy + ry)); -} - -int button_read_device(void) -{ - int res = 0; - -#ifndef BOOTLOADER - /* handle the touchpad events */ - touching = imx233_touchscreen_get_touch(&last_x, &last_y); - if(touching) - { - if (coord_in_radius(last_x, last_y, TOUCH_LEFT)) - { - res |= BUTTON_LEFT; - } - else if (coord_in_radius(last_x, last_y, TOUCH_RIGHT)) - { - res |= BUTTON_RIGHT; - } - else if (coord_in_radius(last_x, last_y, TOUCH_DOWN)) - { - res |= BUTTON_DOWN; - } - else if (coord_in_radius(last_x, last_y, TOUCH_UP)) - { - res |= BUTTON_UP; - } - } -#endif /* BOOTLOADER */ - /* handle the generic events */ - return imx233_button_read(res); -} - -#ifndef BOOTLOADER - -#define MAX_ENTRIES 100 -#define VIEWPORT_HEIGHT 100 -#define VIEWPORT_WIDTH 100 -#define MAX_X 3700 -#define MAX_Y 3700 -#define ADAPT_TO_VIEWPORT(cx, cy, rx, ry) ((float)(cx) / MAX_X) * VIEWPORT_WIDTH, \ - ((float)(cy) / MAX_Y) * VIEWPORT_HEIGHT, \ - ((float)(rx) / MAX_X) * VIEWPORT_WIDTH, \ - ((float)(ry) / MAX_Y) * VIEWPORT_HEIGHT -static void draw_calibration_rect(int cx, int cy, int rx, int ry) -{ - if (coord_in_radius(last_x, last_y, cx, cy, rx, ry)) - lcd_set_drawinfo(DRMODE_SOLID, LCD_RGBPACK(0xff, 0xff, 0xff), LCD_BLACK); - else - lcd_set_drawinfo(DRMODE_SOLID, LCD_RGBPACK(0xff, 0, 0), LCD_BLACK); - lcd_drawrect(ADAPT_TO_VIEWPORT(cx - rx, cy - ry, 2 * rx, 2 * ry)); -} - -bool button_debug_screen(void) -{ - int last = 0; - struct point_t - { - int x; - int y; - }; - struct point_t last_entries[MAX_ENTRIES]; - struct viewport report_vp; - - memset(&report_vp, 0, sizeof(report_vp)); - report_vp.x = (LCD_WIDTH - VIEWPORT_WIDTH) / 2; - report_vp.y = (LCD_HEIGHT - VIEWPORT_HEIGHT) / 2; - report_vp.width = VIEWPORT_WIDTH; - report_vp.height = VIEWPORT_HEIGHT; - - lcd_setfont(FONT_SYSFIXED); - lcd_clear_display(); - - while(1) - { - int button = get_action(CONTEXT_STD, HZ / 10); - switch(button) - { - case ACTION_STD_OK: - case ACTION_STD_MENU: - lcd_set_viewport(NULL); - lcd_setfont(FONT_UI); - lcd_clear_display(); - return true; - case ACTION_STD_CANCEL: - lcd_set_viewport(NULL); - lcd_setfont(FONT_UI); - lcd_clear_display(); - return false; - } - - lcd_set_viewport(NULL); - lcd_putsf(0, 1, "(%d,%d) %s", last_x, last_y, touching ? "touching!" : ""); - lcd_putsf(0, 0, "Type %s", imx233_pinctrl_get_gpio(0, 31) ? "CAP" : "REG"); - lcd_set_viewport(&report_vp); - lcd_set_drawinfo(DRMODE_SOLID, LCD_RGBPACK(0, 0, 0xff), LCD_BLACK); - lcd_drawrect(0, 0, 100, 100); - float percent_x = ((float)(last_x) / MAX_X); - float percent_y = ((float)(last_y) / MAX_Y); - if (touching) - { - lcd_set_viewport(NULL); - if (last < MAX_ENTRIES) - { - last_entries[last].x = last_x; - last_entries[last].y = last_y; - last++; - lcd_putsf(0, 17, "Recording: %d captures left", MAX_ENTRIES - last); - } - else - { - int min_x = 9999; - int min_y = 9999; - int max_x = -1; - int max_y = -1; - int median_x = 0; - int median_y = 0; - for (int i = 0; i < MAX_ENTRIES; i++) - { - min_x = MIN(min_x, last_entries[i].x); - min_y = MIN(min_y, last_entries[i].y); - max_x = MAX(max_x, last_entries[i].x); - max_y = MAX(max_y, last_entries[i].y); - median_x += last_entries[i].x; - median_y += last_entries[i].y; - } - median_x /= MAX_ENTRIES; - median_y /= MAX_ENTRIES; - lcd_putsf(0, 17, "center(%d,%d)", median_x, median_y); - lcd_putsf(0, 18, "radius(%d,%d)", median_x / 2, median_y / 2); - } - lcd_set_viewport(&report_vp); - lcd_set_drawinfo(DRMODE_SOLID, LCD_RGBPACK(0xff, 0x8c, 0), LCD_BLACK); - lcd_fillrect(VIEWPORT_WIDTH * percent_x, VIEWPORT_HEIGHT * percent_y, 2, 2); - } - - /* Draw current calibration settings */ - lcd_set_viewport(&report_vp); - draw_calibration_rect(TOUCH_UP); - draw_calibration_rect(TOUCH_DOWN); - draw_calibration_rect(TOUCH_CENTER); - draw_calibration_rect(TOUCH_LEFT); - draw_calibration_rect(TOUCH_RIGHT); - - lcd_update(); - yield(); - } - - return true; -} -#endif diff --git a/firmware/target/arm/imx233/samsung-ypz5/debug-ypz5.c b/firmware/target/arm/imx233/samsung-ypz5/debug-ypz5.c deleted file mode 100644 index c125eac973..0000000000 --- a/firmware/target/arm/imx233/samsung-ypz5/debug-ypz5.c +++ /dev/null @@ -1,29 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2013 by Amaury Pouly - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ****************************************************************************/ - -#include "system.h" -#include "button-target.h" -#include "lcd-target.h" - -bool dbg_hw_target_info(void) -{ - return button_debug_screen() && lcd_debug_screen(); -} diff --git a/firmware/target/arm/imx233/samsung-ypz5/fmradio-target.h b/firmware/target/arm/imx233/samsung-ypz5/fmradio-target.h deleted file mode 100644 index 66bceb4071..0000000000 --- a/firmware/target/arm/imx233/samsung-ypz5/fmradio-target.h +++ /dev/null @@ -1,31 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2013 by Amaury Pouly - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ****************************************************************************/ -#ifndef _FMRADIO_TARGET_H_ -#define _FMRADIO_TARGET_H_ - -#define IMX233_FMRADIO_I2C FMI_HW - -#define IMX233_FMRADIO_POWER FMP_GPIO -#define FMP_GPIO_BANK 0 -#define FMP_GPIO_PIN 10 -#define FMP_GPIO_DELAY (HZ / 5) - -#endif /* _FMRADIO_TARGET_H_ */ diff --git a/firmware/target/arm/imx233/samsung-ypz5/ftl-target.h b/firmware/target/arm/imx233/samsung-ypz5/ftl-target.h deleted file mode 100644 index cb943e34f2..0000000000 --- a/firmware/target/arm/imx233/samsung-ypz5/ftl-target.h +++ /dev/null @@ -1,39 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2009 by Michael Sparmann - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ****************************************************************************/ - -#ifndef __FTL_TARGET_H__ -#define __FTL_TARGET_H__ - -#include "config.h" -#include "inttypes.h" - -#ifdef BOOTLOADER -/* Bootloaders don't need write access */ -#define FTL_READONLY -#endif - -uint32_t ftl_init(void); -uint32_t ftl_read(uint32_t sector, uint32_t count, void* buffer); -uint32_t ftl_write(uint32_t sector, uint32_t count, const void* buffer); -uint32_t ftl_sync(void); - - -#endif diff --git a/firmware/target/arm/imx233/samsung-ypz5/lcd-target.h b/firmware/target/arm/imx233/samsung-ypz5/lcd-target.h deleted file mode 100644 index 9993b7d731..0000000000 --- a/firmware/target/arm/imx233/samsung-ypz5/lcd-target.h +++ /dev/null @@ -1,25 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * - * Copyright (c) 2013 by Amaury Pouly - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ****************************************************************************/ -#ifndef LCD_TARGET_H -#define LCD_TARGET_H - -bool lcd_debug_screen(void); - -#endif /* LCD_TARGET_H */ diff --git a/firmware/target/arm/imx233/samsung-ypz5/lcd-ypz5.c b/firmware/target/arm/imx233/samsung-ypz5/lcd-ypz5.c deleted file mode 100644 index 99fe0b2aef..0000000000 --- a/firmware/target/arm/imx233/samsung-ypz5/lcd-ypz5.c +++ /dev/null @@ -1,295 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * - * Copyright (c) 2013 by Lorenzo Miori - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ****************************************************************************/ -#include /* off_t */ -#include -#include "cpu.h" -#include "system.h" -#include "backlight-target.h" -#include "lcd.h" -#include "lcdif-imx233.h" -#include "clkctrl-imx233.h" -#include "pinctrl-imx233.h" -#include "dcp-imx233.h" -#include "logf.h" -#ifndef BOOTLOADER -#include "button.h" -#include "font.h" -#include "action.h" -#endif -#include "dma-imx233.h" -#include "kernel.h" - -#include "regs/lcdif.h" - -/** - * NOTE - * We don't know exact LCD models nor we have datasheets for them - * Register function are partly guessed from the values, others are guessed from other LCD - * drivers and others have been confirmed studying their values - */ - -static enum lcd_type_t -{ - LCD_TYPE_ZERO = 0, - LCD_TYPE_ONE = 1 -} lcd_type = LCD_TYPE_ZERO; - -static void lcd_write_reg(uint16_t reg, uint16_t data) -{ - imx233_lcdif_pio_send(false, 1, ®); - if(reg != 0x22) - imx233_lcdif_pio_send(true, 1, &data); -} - -/* - * The two LCD types require different initialization sequences - */ -void lcd_init_seq(void) -{ - switch (lcd_type) - { - case LCD_TYPE_ZERO: - { - lcd_write_reg(0x11, 0x1f1e); - lcd_write_reg(0x38, 0xf0f); - lcd_write_reg(0x12, 0x1101); - lcd_write_reg(0x13, 0x808); - lcd_write_reg(0x14, 0x3119); - lcd_write_reg(0x10, 0x1a10); - udelay(0xc350); - lcd_write_reg(0x13, 0x83b); - udelay(0x30d40); - lcd_write_reg(1, 0x90c); /* Display mode */ - lcd_write_reg(2, 0x200); - lcd_write_reg(3, 0x1030); - lcd_write_reg(7, 5); - lcd_write_reg(8, 0x503); - lcd_write_reg(11, 0); - lcd_write_reg(12, 0); - /* Gamma control */ - lcd_write_reg(0x30, 0x606); - lcd_write_reg(0x31, 0x606); - lcd_write_reg(0x32, 0x305); - lcd_write_reg(0x33, 2); - lcd_write_reg(0x34, 0x503); - lcd_write_reg(0x35, 0x606); - lcd_write_reg(0x36, 0x606); - lcd_write_reg(0x37, 0x200); - - lcd_write_reg(0x11, 0x1f1e); - lcd_write_reg(0x38, 0xf0f); - /* Set initial LCD limits and RAM settings */ - lcd_write_reg(0x40, 0); //BPP ? - lcd_write_reg(0x42, 0x9f00); - lcd_write_reg(0x43, 0); - lcd_write_reg(0x44, 0x7f00); /* Horizontal initial refresh zone [0 - 127] */ - lcd_write_reg(0x45, 0x9f00); /* Vertical initial refresh zone [0 - 159] */ - - lcd_write_reg(14, 0x13); - lcd_write_reg(0xa9, 0x14); - lcd_write_reg(0xa7, 0x30); - lcd_write_reg(0xa8, 0x124); - lcd_write_reg(0x6f, 0x1d00); - lcd_write_reg(0x70, 3); - lcd_write_reg(7, 1); - lcd_write_reg(0x10, 0x1a10); - udelay(0x9c40); - lcd_write_reg(7, 0x21); - lcd_write_reg(7, 0x23); - udelay(0x9c40); - lcd_write_reg(7, 0x37); /* Seems to be "power on" */ - break; - } - case LCD_TYPE_ONE: - { - lcd_write_reg(0, 1); - udelay(0x2710); - lcd_write_reg(0x11, 0x171b); - lcd_write_reg(0x12, 0); - lcd_write_reg(0x13, 0x80d); - lcd_write_reg(0x14, 0x18); - lcd_write_reg(0x10, 0x1a10); - udelay(0xc350); - lcd_write_reg(0x13, 0x81d); - udelay(0xc350); - lcd_write_reg(1, 0x90c); /* Display mode */ - lcd_write_reg(2, 0x200); - lcd_write_reg(3, 0x1030); - lcd_write_reg(7, 5); - lcd_write_reg(8, 0x30a); - lcd_write_reg(11, 4); - lcd_write_reg(12, 0); - /* Gamma control */ - lcd_write_reg(0x30, 0x300); - lcd_write_reg(0x31, 0); - lcd_write_reg(0x32, 0); - lcd_write_reg(0x33, 0x404); - lcd_write_reg(0x34, 0x707); - lcd_write_reg(0x35, 0x700); - lcd_write_reg(0x36, 0x703); - lcd_write_reg(0x37, 4); - - lcd_write_reg(0x38, 0); - /* Set initial LCD limits and RAM settings */ - lcd_write_reg(0x40, 0); - lcd_write_reg(0x42, 0x9f00); /* LCD Display Start Address Register 0 */ - lcd_write_reg(0x43, 0); /* LCD Display Start Address Register 1 */ - lcd_write_reg(0x44, 0x7f00); /* Horizontal initial refresh zone [0 - 127] */ - lcd_write_reg(0x45, 0x9f00); /* Vertical initial refresh zone [0 - 159] */ - - lcd_write_reg(7, 1); - udelay(0x2710); - lcd_write_reg(7, 0x21); - lcd_write_reg(7, 0x23); - udelay(0x2710); - lcd_write_reg(7, 0x1037); - udelay(0x2710); - lcd_write_reg(7, 0x35); - lcd_write_reg(7, 0x36); - lcd_write_reg(7, 0x37); - udelay(10000); - break; - } - default: - break; - } -} - -static void send_update_rect(uint8_t x, uint8_t y, uint8_t w, uint8_t h) -{ - /* Set horizontal refresh zone */ - lcd_write_reg(0x44, (x | (y + w - 1) << 0x8)); - /* Set vertical refresh zone */ - lcd_write_reg(0x45, (y | (y + h - 1) << 0x8)); - lcd_write_reg(0x21, x | y << 8); - /* Set register index to 0x22 to write screen data. 0 is mock value */ - lcd_write_reg(0x22, 0); -} - -static void setup_lcd_pins(void) -{ - imx233_lcdif_setup_system_pins(16); - /* lcd_rd */ - imx233_pinctrl_acquire(0, 9, "lcd rd"); - imx233_pinctrl_set_function(0, 9, PINCTRL_FUNCTION_GPIO); - imx233_pinctrl_set_gpio(0, 9, false); - /* - * This pin is important to know the LCD type - * There are two types that require two different initialization sequences - */ - /* lcd_tp */ - imx233_pinctrl_acquire(3, 12, "lcd type"); - imx233_pinctrl_set_function(3, 12, PINCTRL_FUNCTION_GPIO); - imx233_pinctrl_enable_gpio(3, 12, false); - /* Sense LCD Type */ - lcd_type = imx233_pinctrl_get_gpio(3, 12) ? LCD_TYPE_ONE : LCD_TYPE_ZERO; -} - -static void setup_parameters(void) -{ - imx233_lcdif_init(); - imx233_lcdif_enable(true); - imx233_lcdif_set_word_length(16); - imx233_lcdif_set_data_swizzle(false); - imx233_lcdif_set_timings(2, 1, 1, 1); - BF_WR(LCDIF_CTRL, MODE86_V(8080_MODE)); - - imx233_lcdif_reset_lcd(true); - udelay(50); - imx233_lcdif_reset_lcd(false); - udelay(10); - imx233_lcdif_reset_lcd(true); -} - -void lcd_init_device(void) -{ - /* Setup interface pins */ - setup_lcd_pins(); - /* Set LCD parameters */ - setup_parameters(); - /* Send initialization sequence to LCD */ - lcd_init_seq(); -} - -struct lcdif_cmd_t -{ - struct apb_dma_command_t dma; - uint32_t ctrl0; - uint32_t pad[4]; -} __attribute__((packed)) CACHEALIGN_ATTR; - -struct lcdif_cmd_t lcdif_dma; -void lcd_update(void) -{ - unsigned size = LCD_WIDTH * LCD_HEIGHT * sizeof(fb_data); - - send_update_rect(0,0,LCD_WIDTH,LCD_HEIGHT); - /* We can safely do the transfer in a single shot, since 160 * 128 * 2 < 65k, - * the maximum transfer size! - */ - lcdif_dma.dma.cmd |= BF_OR(APB_CHx_CMD, CMDWORDS(1), XFER_COUNT(size), COMMAND(2)); - lcdif_dma.ctrl0 = HW_LCDIF_CTRL & ~BM_LCDIF_CTRL_COUNT; - lcdif_dma.ctrl0 |= BF_OR(LCDIF_CTRL, COUNT(size/2), DATA_SELECT(1)); - lcdif_dma.dma.buffer = FBADDR(0,0); - lcdif_dma.dma.cmd |= BM_APB_CHx_CMD_SEMAPHORE; - - imx233_dma_start_command(APB_LCDIF, &lcdif_dma.dma); - imx233_dma_wait_completion(APB_LCDIF, HZ); -} - -void lcd_update_rect(int x, int y, int w, int h) -{ - (void)x; - (void)y; - (void)w; - (void)h; - lcd_update(); -} - -#ifndef BOOTLOADER -bool lcd_debug_screen(void) -{ - lcd_setfont(FONT_SYSFIXED); - - while(1) - { - int button = get_action(CONTEXT_STD, HZ / 10); - switch(button) - { - case ACTION_STD_NEXT: - case ACTION_STD_PREV: - case ACTION_STD_OK: - case ACTION_STD_MENU: - lcd_setfont(FONT_UI); - return true; - case ACTION_STD_CANCEL: - lcd_setfont(FONT_UI); - return false; - } - - lcd_clear_display(); - lcd_putsf(0, 0, "LCD type: %d", lcd_type); - lcd_update(); - yield(); - } - - return true; -} -#endif diff --git a/firmware/target/arm/imx233/samsung-ypz5/powermgmt-target.h b/firmware/target/arm/imx233/samsung-ypz5/powermgmt-target.h deleted file mode 100644 index 5d32bc5e9c..0000000000 --- a/firmware/target/arm/imx233/samsung-ypz5/powermgmt-target.h +++ /dev/null @@ -1,37 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2013 by Amaury Pouly - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ****************************************************************************/ -#ifndef POWERMGMT_TARGET_H -#define POWERMGMT_TARGET_H - -#include "config.h" -#include "powermgmt-imx233.h" - -#define IMX233_CHARGE_CURRENT 100 -#define IMX233_STOP_CURRENT 10 -#define IMX233_TOPOFF_TIMEOUT (30 * 60 * HZ) -#define IMX233_CHARGING_TIMEOUT (4 * 3600 * HZ) -#define IMX233_DIE_TEMP_HIGH 71 -#define IMX233_DIE_TEMP_LOW 56 -#define IMX233_BATT_TEMP_SENSOR 0 -#define IMX233_BATT_TEMP_HIGH 1100 -#define IMX233_BATT_TEMP_LOW 220 - -#endif /* POWERMGMT_TARGET_H */ diff --git a/firmware/target/arm/imx233/samsung-ypz5/powermgmt-ypz5.c b/firmware/target/arm/imx233/samsung-ypz5/powermgmt-ypz5.c deleted file mode 100644 index 9d9ed7de99..0000000000 --- a/firmware/target/arm/imx233/samsung-ypz5/powermgmt-ypz5.c +++ /dev/null @@ -1,48 +0,0 @@ -/*************************************************************************** - * __________ __ ___. - * Open \______ \ ____ ____ | | _\_ |__ _______ ___ - * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / - * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < - * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ - * \/ \/ \/ \/ \/ - * $Id$ - * - * Copyright (C) 2013 by Amaury Pouly - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - ****************************************************************************/ -#include "config.h" -#include "powermgmt-target.h" -#include "power-imx233.h" - - -const unsigned short battery_level_dangerous[BATTERY_TYPES_COUNT] = -{ - 3400 -}; - -const unsigned short battery_level_shutoff[BATTERY_TYPES_COUNT] = -{ - 3300 -}; - -/* voltages (millivolt) of 0%, 10%, ... 100% when charging disabled */ -const unsigned short percent_to_volt_discharge[BATTERY_TYPES_COUNT][11] = -{ - /* Sansa Fuze+ Li Ion 600mAH figured from discharge curve */ - { 3100, 3650, 3720, 3750, 3780, 3820, 3880, 4000, 4040, 4125, 4230 }, -}; - -/* voltages (millivolt) of 0%, 10%, ... 100% when charging enabled */ -const unsigned short percent_to_volt_charge[11] = -{ - /* Sansa Fuze+ Li Ion 600mAH figured from charge curve */ - 3480, 3790, 3845, 3880, 3900, 3935, 4005, 4070, 4150, 4250, 4335 -}; diff --git a/firmware/target/arm/imx233/touchscreen-imx233.c b/firmware/target/arm/imx233/touchscreen-imx233.c index f98dc9b738..561b2c750a 100644 --- a/firmware/target/arm/imx233/touchscreen-imx233.c +++ b/firmware/target/arm/imx233/touchscreen-imx233.c @@ -23,9 +23,6 @@ #include "kernel.h" #include "touchscreen-imx233.h" #include "stdlib.h" -#ifdef SAMSUNG_YPZ5 -#include "pinctrl-imx233.h" -#endif /* Description: * the driver basically has 2 modes: @@ -82,24 +79,6 @@ static void touch_channel_irq(int chan) process(); } -#ifdef SAMSUNG_YPZ5 -/* On this target we need to manually setup pulldown pins, - * using specific GPIO lines - */ -static void pulldown_setup(bool xminus_enable, bool yminus_enable, - bool xplus_enable, bool yplus_enable) -{ - /* TX+ */ - imx233_pinctrl_set_gpio(0, 25, xplus_enable); - /* TX- */ - imx233_pinctrl_set_gpio(3, 15, xminus_enable); - /* TY+ */ - imx233_pinctrl_set_gpio(0, 26, yplus_enable); - /* TY- */ - imx233_pinctrl_set_gpio(1, 21, yminus_enable); -} -#endif - static void kick_measure(bool pull_x, bool pull_y, bool detect, int src) { #if IMX233_SUBTARGET < 3700 @@ -116,9 +95,6 @@ static void kick_measure(bool pull_x, bool pull_y, bool detect, int src) imx233_icoll_enable_interrupt(INT_SRC_LRADC_CHx(touch_chan), true); imx233_lradc_enable_channel_irq(touch_chan, true); /* setup measurement: x- pull down and x+ pull up */ -#ifdef SAMSUNG_YPZ5 - pulldown_setup(pull_x, pull_y, pull_x, pull_y); -#endif imx233_lradc_setup_touch(pull_x, pull_y, pull_x, pull_y, detect); imx233_lradc_enable_touch_detect_irq(false); imx233_lradc_enable_channel_irq(touch_chan, true); @@ -138,9 +114,6 @@ static void enter_state(enum touch_state_t state) switch(state) { case TOUCH_STATE_WAIT: -#ifdef SAMSUNG_YPZ5 - pulldown_setup(false, false, false, false); -#endif imx233_lradc_setup_touch(false, false, false, false, true); imx233_lradc_enable_touch_detect_irq(true); break; -- cgit v1.2.3