Merge branch 'genesys-frontend-type' into 'master'

genesys: Add frontend type to the frontend description

See merge request sane-project/backends!131
merge-requests/131/merge
Povilas Kanapickas 2019-08-31 12:58:50 +00:00
commit 2896c21ffe
3 zmienionych plików z 19 dodań i 1 usunięć

Wyświetl plik

@ -2860,6 +2860,10 @@ static void gl843_offset_calibration(Genesys_Device* dev, const Genesys_Sensor&
Genesys_Register_Set& regs)
{
DBG_HELPER(dbg);
if (dev->frontend.layout.type == FrontendType::UNKNOWN)
return;
unsigned int channels, bpp;
int pass, total_size, i, resolution, lines;
int topavg[3], bottomavg[3], avg[3];
@ -3091,6 +3095,9 @@ static void gl843_coarse_gain_calibration(Genesys_Device* dev, const Genesys_Sen
int resolution;
int bpp;
if (dev->frontend.layout.type == FrontendType::UNKNOWN)
return;
dpihw = sensor.get_logical_hwdpi(dpi);
factor=sensor.optical_res/dpihw;

Wyświetl plik

@ -65,14 +65,24 @@ struct AssignableArray : public std::array<T, Size> {
}
};
enum class FrontendType : unsigned
{
UNKNOWN,
WOLFSON,
ANALOG_DEVICES
};
struct GenesysFrontendLayout
{
FrontendType type = FrontendType::UNKNOWN;
std::array<uint16_t, 3> offset_addr = {};
std::array<uint16_t, 3> gain_addr = {};
bool operator==(const GenesysFrontendLayout& other) const
{
return offset_addr == other.offset_addr && gain_addr == other.gain_addr;
return type == other.type &&
offset_addr == other.offset_addr &&
gain_addr == other.gain_addr;
}
};

Wyświetl plik

@ -52,6 +52,7 @@ void genesys_init_frontend_tables()
s_frontends.init();
GenesysFrontendLayout wolfson_layout;
wolfson_layout.type = FrontendType::WOLFSON;
wolfson_layout.offset_addr = { 0x20, 0x21, 0x22 };
wolfson_layout.gain_addr = { 0x28, 0x29, 0x2a };