topaz: Initial device configuration

Change-Id: Ie63f31ece78c3acb676faab94dc704dcf2b7ed28
Signed-off-by: ReStranger <restranger@disroot.org>
diff --git a/Android.bp b/Android.bp
new file mode 100644
index 0000000..cdaa513
--- /dev/null
+++ b/Android.bp
@@ -0,0 +1,8 @@
+//
+// Copyright (C) 2025 The LineageOS Project
+//
+// SPDX-License-Identifier: Apache-2.0
+//
+
+soong_namespace {
+}
diff --git a/AndroidProducts.mk b/AndroidProducts.mk
new file mode 100644
index 0000000..d256a9f
--- /dev/null
+++ b/AndroidProducts.mk
@@ -0,0 +1,8 @@
+#
+# Copyright (C) 2025 The LineageOS Project
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+
+PRODUCT_MAKEFILES := \
+    $(LOCAL_DIR)/lineage_topaz.mk
diff --git a/BoardConfig.mk b/BoardConfig.mk
new file mode 100644
index 0000000..a8f6098
--- /dev/null
+++ b/BoardConfig.mk
@@ -0,0 +1,13 @@
+#
+# Copyright (C) 2025 The LineageOS Project
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+
+DEVICE_PATH := device/xiaomi/topaz
+
+# Inherit from xiaomi sm6225-common
+include device/xiaomi/sm6225-common/BoardConfigCommon.mk
+
+# Inherit the proprietary files
+include vendor/xiaomi/topaz/BoardConfigVendor.mk
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..90c3d93
--- /dev/null
+++ b/README.md
@@ -0,0 +1,32 @@
+Copyright (C) 2025 The LineageOS Project
+
+Device configuration for Xiaomi Redmi Note 12 4G/12 4G NFC
+=========================================
+
+The Xiaomi Redmi Note 12 4G/12 4G NFC (codenamed _"tapas/topaz"_) is a mid-range smartphone from Xiaomi.
+
+Redmi Note 12 4G was announced and released in March 2023.
+
+## Device specifications
+
+| Device       | Xiaomi Redmi Note 12 4G                              |
+| -----------: | :-------------------------------------------------- |
+| SoC          | Qualcomm SM6225 Snapdragon 685 (6 nm)                      |
+| CPU          | 4x2.8 GHz Cortex-A73 & 4x1.9 GHz Cortex-A53 |
+| GPU          | Adreno 610                                          |
+| Memory       | 4GB/6GB/8GB RAM (LPDDR4X)                               |
+| Storage      | 64GB/128GB/256GB UFS 2.2 flash storage                    |
+| Shipped Android version | 13.0 with MIUI 14                        |
+| Battery      | Non-removable Li-Po 5000 mAh                        |
+| Dimensions   | 165.7 x 76 x 7.9 mm                               |
+| Display      | 1080 x 2400 pixels, 20:9 ratio 6.67" inch           |
+| Type         | AMOLED, 120Hz, 450 nits (typ), 700 nits (HBM), 1200 nits (peak)      |
+| NFC         | Yes ( Redmi Note 12 4G NFC )                            |
+| Rear camera 1 | 50 MP, f/1.8, (wide), 1/2.76", 0.64µm, PDAF     |
+| Rear camera 2 | 8 MP, f/2.2, 120˚ (ultrawide), 1/4", 1.12µm      |
+| Rear camera 3 | 2 MP, f/2.4, (macro)                               |
+| Front camera  | 13 MP, f/2.5, (wide), 1/3.0"                    |
+
+## Device picture
+
+![Xiaomi Redmi Note 12 4G](https://i02.appmifile.com/224_operator_sg/10/03/2023/cdf4a7f40a92668d1c8fe2fcc5045ea8.png)
diff --git a/device.mk b/device.mk
new file mode 100644
index 0000000..b713920
--- /dev/null
+++ b/device.mk
@@ -0,0 +1,15 @@
+#
+# Copyright (C) 2025 The LineageOS Project
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+
+# Inherit from xiaomi sm6225-common
+$(call inherit-product, device/xiaomi/sm6225-common/common.mk)
+
+# Inherit the proprietary files
+$(call inherit-product, vendor/xiaomi/topaz/topaz-vendor.mk)
+
+# Soong namespaces
+PRODUCT_SOONG_NAMESPACES += \
+    $(LOCAL_PATH)
diff --git a/extract-files.py b/extract-files.py
new file mode 100755
index 0000000..dc63cce
--- /dev/null
+++ b/extract-files.py
@@ -0,0 +1,42 @@
+#!/usr/bin/env -S PYTHONPATH=../../../tools/extract-utils python3
+#
+# SPDX-FileCopyrightText: 2024 The LineageOS Project
+# SPDX-License-Identifier: Apache-2.0
+#
+
+from extract_utils.fixups_blob import (
+    blob_fixup,
+    blob_fixups_user_type,
+)
+from extract_utils.fixups_lib import (
+    lib_fixup_remove,
+    lib_fixups,
+    lib_fixups_user_type,
+)
+from extract_utils.main import (
+    ExtractUtils,
+    ExtractUtilsModule,
+)
+
+namespace_imports = [
+    "device/xiaomi/sm6225-common",
+]
+
+lib_fixups: lib_fixups_user_type = {
+    **lib_fixups,
+}
+
+blob_fixups: blob_fixups_user_type = {
+}  # fmt: skip
+
+module = ExtractUtilsModule(
+    "topaz",
+    "xiaomi",
+    blob_fixups=blob_fixups,
+    lib_fixups=lib_fixups,
+    namespace_imports=namespace_imports,
+)
+
+if __name__ == "__main__":
+    utils = ExtractUtils.device_with_common(module, "sm6225-common", module.vendor)
+    utils.run()
diff --git a/lineage_topaz.mk b/lineage_topaz.mk
new file mode 100644
index 0000000..28406fb
--- /dev/null
+++ b/lineage_topaz.mk
@@ -0,0 +1,19 @@
+#
+# Copyright (C) 2025 The LineageOS Project
+#
+# SPDX-License-Identifier: Apache-2.0
+#
+
+# Inherit from topaz device
+$(call inherit-product, device/xiaomi/topaz/device.mk)
+
+# Inherit from common lineage configuration
+$(call inherit-product, vendor/lineage/config/common_full_phone.mk)
+
+PRODUCT_NAME := lineage_topaz
+PRODUCT_DEVICE := topaz
+PRODUCT_MANUFACTURER := Xiaomi
+PRODUCT_BRAND := Redmi
+PRODUCT_MODEL := 23021RAA2Y
+
+PRODUCT_GMS_CLIENTID_BASE := android-xiaomi
diff --git a/proprietary-files.txt b/proprietary-files.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/proprietary-files.txt
diff --git a/setup-makefiles.py b/setup-makefiles.py
new file mode 100755
index 0000000..32947cf
--- /dev/null
+++ b/setup-makefiles.py
@@ -0,0 +1 @@
+#!./extract-files.py --regenerate_makefiles